Repository navigation
Description
Stage 4 — Readable, configurable exports
Synopsis
Render a line-number gutter beside each logical source line in PDF code blocks using the shared line model.
End goal
Readers can reference exported PDF code by stable source-line numbers without losing or changing the code.
Start after
- Add optional total code-line counts to PDF and DOCX #36 — Add optional total code-line counts to PDF and DOCX
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
- Default numbering to off and keep it independent of the total count and language label.
- Restart numbering at 1 for each code block; count intentional blank lines according to the shared contract.
- A visually wrapped source line keeps one source-line number; do not count each visual continuation as a new line.
- Keep the actual code body intact and selectable; numbers are presentation metadata, not inserted code characters.
Acceptance criteria
- Numbers match the shared logical-line model for ordinary, highlighted, empty/blank-line, and long-line examples.
- Wrapped continuations and page breaks remain understandable, with correct alignment and no skipped/duplicated source lines.
- Enabling numbering preserves complete code text, spaces, tabs, intentional blank lines, and saved Markdown.
- Numbering works with count/label settings independently and does not collide with block metadata.
- Actual PDF selection/copy and text-extraction behavior is checked and documented; do not claim number-free copying across readers without evidence.
Verification
- Generate PDFs using real converters with multi-page highlighted and plain code, long wrapped lines, tabs, and authored blank lines.
- Inspect the chosen PDF reader and text extraction; compare complete code content and expected numbering.
- Exercise the installed-extension setting and saved-export capture, and add focused regressions to the PDF export checks.
Source pointers
src/export/pdf.tssrc/export/html.tssrc/export/controller.tssrc/export/types.tspackage.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