Export a page with its source and where its asides are sent

Open
#317 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
tooling

Research direction

Start in src/export.js at exportHtml and see how it currently assembles the rendered HTML plus stylesheet, then look at the renderer used for asides (#202) since the inlined script must reuse it. Read #68 for the review-copy flow and #69 for the POST target so the new option names line up with where the export is consumed. Done means the new options are optional and today's output is unchanged, plus a test asserting a comment's text is absent while line numbering is preserved.

Written by the indexing model from the issue text.

Description

enhancement

Part of #68.

Today

An exported page is the rendered HTML and its stylesheet, and nothing in it runs ("Nothing in the file draws", src/export.js). A review copy (#68) needs more than that, and so does a page served by reader-margin:

What to do

Let an export carry:

  • Its source. The script draws asides from it, with the same renderer (#202), so they look as they do in reader. HTML comments are blanked line for line, so a note to whoever opens the file isn't published, and every line keeps its number.
  • Which version it is. For a review copy, that's the sent copy's id (#68). For a page served from git, it's the commit it was exported from, so asides sent back can be placed against that commit and merged.
  • Where its asides go. #68 downloads a file, #69 POSTs to a local reader, and reader-margin sends them to its server. The page's script is the same each time, and the export says which target it uses.
  • The script itself. Inline for a review copy, with a content policy that allows only that script and no network. A served page may load the script from its server instead.

Done when

  • exportHtml takes these as options, and an export without them is exactly what it is today.
  • A test checks that a comment's text isn't in the exported page and that its lines still number the same.

🤖 Generated with Claude Code

Dominant language
JavaScript
Stars
0
Forks
1
Avg merge
2d 4h
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jzheaux/reader

All issues in jzheaux/reader

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.