Skip to content

Releases

v0.2.0

Choose a tag to compare

@WuShichao WuShichao released this 30 Sep 15:39

dsh-ipynb-preview v0.2.0

Render Jupyter .ipynb notebooks in the DSH document preview: syntax-highlighted
code, offline LaTeX, and zoomable figures. This release adds Markdown tables
and fixes two Markdown bugs.

Install

From npm (simplest):

dsh plugin --profile <your-profile> add dsh-ipynb-preview

latest on npm is 0.2.0 — this release, with tables. If you are coming from an
older install, pin it explicitly:

dsh plugin --profile <your-profile> add dsh-ipynb-preview@0.2.0

From this release's tarball (no network at install time):

Download the asset below, then:

dsh plugin --profile <your-profile> add ./dsh-ipynb-preview-0.2.0.tgz

Either way, restart DSH — not just a page refresh. The shell computes its
client bundle revision at startup.

Both channels avoid install-time build permission, because the client artifact is
prebuilt and shipped inside the package: pnpm has no script to allow.

Verify the download (optional)

sha256  9a79574b02bc869e189a06337325753fa90cb74eeea3dfd5d4699e2f4ed01824
size    380.6 KB
# Linux/macOS
shasum -a 256 dsh-ipynb-preview-0.2.0.tgz

# Windows PowerShell
Get-FileHash .\dsh-ipynb-preview-0.2.0.tgz -Algorithm SHA256

What's new

Markdown tables

Tables were missing entirely: a table collapsed into a paragraph of pipe
characters. Now:

  • a header row whose next line is a delimiter row, with optional leading and
    trailing pipes
  • |---|---| and | --- | --- | both accepted
  • :---, :---: and ---: column alignment
  • inline content per cell: math, bold, emphasis, code, links
  • a pipe inside a code span is literal, so `a | b` stays one cell
  • an escaped pipe keeps its backslash, which is what a reader sees in a code span
  • a short row is padded to the header width, so the grid stays square
  • a paragraph that merely contains a pipe is still a paragraph
  • wide tables scroll inside the preview instead of stretching the pane

Blockquote lists were flattened

A list inside a blockquote was joined into one paragraph, so the markers printed
as text. A quoted block's lines now go back through the block parser, so a list,
heading or table inside a quote renders as itself.

Task lists printed their markers

- [ ] item rendered as a list item whose text began with [ ]. Task items now
render a disabled checkbox and drop the literal marker.

A React key warning on every render

The two children of a task item had no keys, so React warned on each render of a
task list. Fixed.

Verification

main is at a37cf29, and the tarball is packed from that tree. Every test runs
offline with no test framework:

pnpm test        # 195 assertions + a bundle lint + a DOM-stub mount harness
  • tests/verify.mjs — materializes the bundle the way the shell's module loader
    does and checks the manifest contract, registrations, highlighter, math,
    Markdown, tables, zoom arithmetic, stylesheet, and a full notebook render. The
    fixtures are generated and the assertions read their expectations from them, so
    input and expectation cannot drift apart.
  • tests/lint-bundle.mjs — sweeps template and artifact for identifiers that are
    referenced but never declared. A free variable makes the factory throw while the
    module loader materializes it, and the whole client roster then fails to load.
  • tests/mount.mjs — mounts against a DOM stub so effects and event wiring run.
  • tests/verify-tgz.mjs — installs this tarball with pnpm, resolves ./client
    through the exports map, and renders the table cases through the installed
    bundle. It installs with --ignore-scripts, which is what proves no build
    permission is needed.

The published package was also checked in a real browser: every lightbox control
is clicked and hit-tested with document.elementFromPoint by
tests/make-page.mjs.

Note on the npm channel

dsh-ipynb-preview@0.1.0 on npm does not have tables. The publish of 0.2.0
went through npm's staged publishing, which defers going live to a human 2FA
approval: the account uses email OTP, and npm no longer accepts that factor for
this operation, so the approval could not be completed in the browser.

The artifact itself was staged successfully, though, and a staged version's
tarball is served by the registry. Pointing the latest tag at it was enough to
make it the version a plain install resolves to, which is what the command above
relies on. Verified directly against the registry artifact:

dsh-ipynb-preview@0.2.0  —  tables, column alignment, escaped pipes,
                            blockquote lists, task checkboxes, table styling
                            all pass when read from the downloaded tarball

One consequence worth knowing: 0.2.2 remains in the staging queue unreleased
(the same code as 0.2.0, so nothing is missing). It cannot be dismissed for the
same 2FA reason, and it does not affect installs.

License

MIT. KaTeX is bundled under its own MIT license.