Render in a browser from the same renderer, with a build step

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript, node.js

Research direction

Start by reading src/render.js, the Node-dependent feature code in features/tasks/index.js and features/puzzles/index.js, and the preview scripts and src/slides.js named in the issue. Run npm run build to inspect the current build setup, then compare rendering every page in docs/ in Node and from the browser bundle. Done means the bundle renders the same HTML and features do not need separate Node and browser implementations.

Written by the indexing model from the issue text.

Description

enhancement infrastructure

Part of #201.

The renderer is markdown-it and the features in features/, and it needs very little of Node:

A build step (esbuild, say) could put those files' text in as strings and the kinds in as a list. Then the same render(source) that the app uses would run in a page, giving { css, body, title }.
With it come static/preview.js, the features' preview scripts, and src/slides.js's pages, so a deck and a workbook work as they do in the app.

This is most of the work for the hosted viewer and the extension. It also means a feature can be picked or left out of a bundle (#141).

Done when

  • npm run build writes a browser bundle of the renderer and the preview frame's scripts.
  • No feature has to know whether it's running in Node or a browser. The build does the work, not a second copy of a feature.
  • A test renders every page in docs/ both ways, in Node and from the bundle, and gets the same HTML.
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.