Skip to content

whynot 0.5.0

Choose a tag to compare

@github-actions github-actions released this 29 Sep 20:50
· 105 commits to main since this release
b8a659d

whynot 0.5.0

On macOS:

brew install arnodel/tap/whynot

Otherwise, download the archive for your platform below, unzip it,
and run whynot (or whynot some-file.md).

Building from source instead:

go install github.com/arnodel/whynot/cmd/whynot@v0.5.0

What's new

  • Gio backend and app. giorenderer renders whynot with Gio, alongside the existing Ebitengine backend. cmd/giowhynot is a full viewer built on it, with an editable address bar. Both apps share their navigation, history and loading logic through the new browser package. The Gio app is live on the web next to the Ebitengine one; this release ships binaries for whynot only.
  • Table of contents for the current document, from the toolbar.
  • Mermaid diagrams: ```mermaid code blocks render as diagrams (via Kroki).
  • Horizontal scrolling for code blocks and tables wider than the window. On desktop: trackpad, Shift+wheel, or a scrollbar that appears while you scroll or point at the block. On touch: swipe sideways, with momentum; vertical swipes still scroll the page. A fade at the edge shows there's more.
  • Web apps: links to web pages open in a new tab. The Gio web app is now the right size on phones, and its touch scrolling has momentum.

Fixes

  • Ordered lists now start from their own number (3. used to render as 1.).
  • List items no longer wrap one space too early.

Breaking changes (library)

  • Parse returns a *Document, and NewView takes it instead of source bytes: NewView(whynot.Parse(source), faceSelector, ...). Highlighting and code-block plugins are Parse options: WithSyntaxHighlighter, WithCodeBlockPlugin. The NewView options WithHighlighter and WithCodeBlockPlugins are gone. Title and TOCEntries moved from View to Document.
  • Canvas has a new method, Clip(r image.Rectangle) Canvas: custom Canvas implementations need to add it.
  • Interaction.AccumulateMomentum is replaced by TouchStart/TouchDrag/TouchEnd.
  • A RenderingContext with no ImageCache no longer loads images, and shows their alt text instead. NewView always sets one.

Changelog

Features

  • 8af63cd feat: add a Gio-based rendering backend (giorenderer), v1 static Canvas (#9)
  • 38dc3fc feat: add a table of contents to the document browsers (#14)
  • 165e16d feat: add cmd/giowhynot, a Gio-based whynot app (#11)
  • abc797c feat: editable address bar for cmd/giowhynot (#12)
  • b65b82f feat: extract browser package, migrate cmd/whynot onto it (#10)
  • 9b4a4d7 feat: open web page links in a new tab in the web apps (#24)
  • 71732df feat: pan wide code blocks and tables sideways by touch (#27)
  • fbbd026 feat: publish cmd/giowhynot's wasm build to GitHub Pages (#13)
  • 84dd82b feat: scroll code blocks sideways when wider than the view (#26)
  • 6e99a1b Render mermaid fenced code blocks as diagrams via Kroki (#15)

Bug Fixes

  • 5e6e779 fix: Gio web app is too small on phones and touch flings stop dead (#23)
  • 79c2b43 fix: a touch leaves nothing hovered in the Gio app (#28)
  • b8a659d fix: sideways scrollbar shows only while scrolling or pointing, then fades (#29)

Other Changes

  • 98c2637 refactor: make View render a parsed Document (#17)
  • 1b9b01b refactor: move View's scroll and height-estimate state into documentStack (#18)
  • b545d2b refactor: place inline parts once and store their positions on LineBox (#19)
  • 3692824 refactor: remove repetition from the Markdown compiler (#21)
  • af4c27c refactor: stop Blocks creating their own ImageCache during layout (#20)

Full Changelog: v0.4.0...v0.5.0