hotedit

v0.5.0
io.github.Thewhey-Brian/hotedit Checked 11 hours ago Published 1 month ago

Open HTML reports in the browser and edit them live while the person watches, or by hand.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

open

Open an HTML file in hotedit so the person can watch and edit it in their browser. Returns the page URL. Call this before outline/read/edit when the page isn't open yet.

ParameterTypeDescription
file *stringpath of the HTML file
browserbooleanopen the browser (default true)

outline

List the elements of the page as an indented tree: [id] tag#id.class “text…”. Use the ids with read. Ids change when elements are added, removed or moved, so call outline again after such edits.

ParameterTypeDescription
filestringpath of the HTML file; optional when only one page is open

read

The exact HTML source of one element (by id from outline), as it is in the file. Copy text from here into edit's `find`. Long data: URLs are shortened and can't be edited.

ParameterTypeDescription
id *integerelement id from outline
filestringpath of the HTML file; optional when only one page is open

edit

Replace text in the HTML file: `find` must appear exactly once (add surrounding context to make it unique) unless `all` is true. The change is saved and shown to the user immediately. Use it for text, attributes, styles, inserted or removed elements, and chart data in <script> blocks.

ParameterTypeDescription
find *stringexact source text to replace
replace *stringnew text
allbooleanreplace every occurrence
filestringpath of the HTML file; optional when only one page is open