Repository navigation
Description
Stage 4 — Readable, configurable exports
Synopsis
Implement the accepted editable DOCX line-numbering approach using the shared logical-line contract, without changing code content.
End goal
DOCX readers in the accepted support matrix display correct optional code-line numbers while retaining the agreed editability and preservation guarantees.
Start after
- Add optional total code-line counts to PDF and DOCX #36 — Add optional total code-line counts to PDF and DOCX
- Establish a verified approach for editable DOCX code-line numbering #38 — Establish a verified approach for editable DOCX code-line numbering
Start implementation only after every prerequisite is merged into main or has a maintainer-accepted technical freeze recorded in its linked issue. A freeze must identify the exact source/prototype commit and settled contracts; an open draft PR alone is insufficient. For an investigation prerequisite, acceptance must identify the approved design/report revision and prototype commit if one exists.
Fetch current origin/main before branching. If using a freeze, record an integration base containing all required prerequisite changes and link the freeze decisions in the PR. Validate the combined result again after the final prerequisite changes are integrated. The recorded freeze governs any agreed early start while a prerequisite issue remains open.
Agreed scope
- Use the investigation's accepted technical freeze and the shared line-count contract. Do not select a different representation without documenting the change for review.
- Default numbering to off; keep it independent of total count and language-label visibility.
- Restart at 1 per block and preserve authored blank lines; visually wrapped continuations do not receive new source-line numbers.
- Do not replace editable code with an image or trim/reformat code to make numbering easier.
- If the accepted design still requires independently substantial work, split implementation before assignment rather than concealing extra scope in the PR.
Acceptance criteria
- The approved representation works in the named target reader/version matrix with correct numbering, highlighting, and block metadata.
- Code text, indentation, tabs, Unicode, and intentional blank lines remain intact and editable according to the accepted contract.
- Long/wrapped and multi-page blocks retain correct line associations without dropped or duplicated content.
- All combinations of labels, total counts, and numbering have coherent layout; disabling numbering retains the existing unnumbered code behavior.
- The PR records reader observations, copy/edit behavior, remaining limitations, and exact source/artifact identity.
Verification
- Reuse the investigation fixtures plus regression cases for discovered failures; inspect actual DOCX readers after production conversion.
- Compare source and document code payloads, inspect document structure, and exercise editing/copying in the target readers.
- Test the setting through a packaged extension and update user-facing export support documentation.
Source pointers
src/export/pandoc.tssrc/export/controller.tssrc/export/types.tsscripts/build-docx-reference.pymedia/export-reference.docxpackage.jsonmedia/export-help.mdtest/fixtures/exports
Delivery contract
Use the existing supported export host and saved-revision capture; do not add standalone Electron export. Preserve authored Markdown and all code whitespace. Capture presentation settings consistently for each job, update supported translations/documentation, and distinguish structural/converter checks from actual target-reader observations.
Work from the repository root using the Node version in .node-version and the maintained instructions in CONTRIBUTING.md, docs/building.md, and docs/testing/README.md; export changes also follow docs/export-verification.md. Run full compilation after webview JavaScript/CSS, shared-module, or translation changes, plus checks that exercise the changed behavior. Rebuild and reinstall for installed-extension evidence. Report failures/skips honestly; follow required CI and review gates. Update affected documentation and review any committed Markdown in source and rendered form.
Link the PR or investigation to this issue. Keep remediation on the same focused work item where practical. Completion requires the stated evidence and accepted outcome; opening a draft PR does not complete the issue. No deadline or assignee is imposed by this issue.
Activity