StructEdit is an importer and editor of tree-structured documents.
- On input, StructEdit accepts plaintext, HTML, or DOCX documents.
- DOCX documents are converted to HTML using Mammoth.
- StructEdit translates the intermediate format (HTML or plaintext) into a tree structure described by the data model in src/types/document.ts.
- A set of rules is applied to (re)construct as much as possible from the original semantic structure of the document. We mostly expect Swiss legal drafts (new laws or amendments). For example, blocks of text starting with
Art. 123are inferred to be headings. - The tree structure is presented side-by-side with the original document in a user interface designed to make structure edits and fixes simple and efficient.
- After manual editing the document tree can be downloaded as JSON.
The current main branch is always deployed at https://structedit.demokratis.ch/.
StructEdit can be opened with a document preloaded from the Demokratis platform via a signed URL: https://structedit.demokratis.ch/?loadFile=<url-encoded signed URL>. The file is fetched, parsed, and opened in the editor. The fetched document may be HTML (parsed like an upload) or a DocTree JSON envelope previously exported by StructEdit (opened directly as a tree). See the remote-document-loading spec.
- Direct upload of the structured document to the Demokratis platform.
- PDF document support