Skip to content

Releases: go-slides/slides

v0.9.0

Choose a tag to compare

@tannevaled tannevaled released this 23 Oct 12:38
6b06692
go install github.com/go-slides/slides/cmd/slides@v0.9.0
  • Callouts you can follow (#50): in HTML, hovering or focusing a callout disc tints its note, and a note rings its disc. It is pure CSS, with no script, so it also works in the playground's sandboxed preview and in VS Code's preview.
    • Each disc is described by its note for screen readers (aria-describedby), and discs and notes can be reached with the keyboard.
    • The tint fades in only when the reader has not asked for reduced motion.
    • PDF, PPTX, ODP and PNG outputs are byte-identical to v0.8.1's. A page grows by about 1.2 KB for two callouts.

v0.8.1

Choose a tag to compare

@tannevaled tannevaled released this 23 Oct 06:47
957e552
go install github.com/go-slides/slides/cmd/slides@v0.8.1

Fixes, through go-webengine v0.13.2 (#49):

  • Editable PPTX and ODP: a line that started with a smaller run of text, such as a callout disc's number or a line number, was split into two text boxes. It is one text box again.
  • Inline-block baseline: an inline-block's baseline is now its last line's, as CSS 2.1 §10.8 says, instead of its bottom edge. Text in such boxes no longer sits half a leading too high in images, PDF and office exports.

v0.8.0

Choose a tag to compare

@tannevaled tannevaled released this 23 Oct 06:31
2b83421
go install github.com/go-slides/slides/cmd/slides@v0.8.0
  • Overview view (#39): press o or Escape, use the controller's button, or click the presenter's page counter to see every slide in a grid. It follows marp-cli's bespoke template: arrows, Home and End move, Enter or a click jumps, and it syncs with the presenter view. It adds 4.7 KB to a page.
  • Presenter view through the parent window (#40): viewer.SyncParent syncs the presenter and audience windows with postMessage, so the presenter view also works where a page has no storage, such as a sandboxed frame. The playground and the VS Code preview use it.
  • Incremental rendering (#41, #42): deck.RenderCache re-renders only the slides an edit changed, or whose inherited directives, page number or total changed, and reuses the rest. A byte-for-byte comparison with a full render over random edit sequences checks it. Typing in slide 50 of 100 re-renders one slide: 2.5 ms natively, 11.5 ms in WebAssembly. The VS Code preview after an edit takes 19 ms, against 23–24 ms for Marp for VS Code. The editor package also gives the preview's markup slide by slide, so a preview can patch only what changed.
  • Line numbers on code blocks (#43–#45, #47): ```go {lineNumbers}, {lineNumbers=10} to start at 10, or the lineNumbers directive (_lineNumbers for one slide, or from a kind). Slidev's {lines:true} and Pandoc's .numberLines are read too. The numbers cannot be selected or copied, and are left out of a PDF's extractable text. Each number sits on its own line's baseline, and its colour is mixed from the theme's code colours.
  • Code callouts (#46, #47): a marker in a comment at the end of a line (// <1>, # <1>, -- <1>, <!-- <1> --> …), followed by a numbered list after the block, gives a numbered disc on the line and the same disc on its note. This is the syntax of Quarto and of Asciidoctor's comment form. The discs are vector rings in the PDF and editable shapes in PPTX and ODP. They are not copied with the code, and Marp shows the same deck with its plain comments.

A deck that uses none of these renders byte for byte as with v0.7.1; the oracle tests against marp-cli are unchanged. go-webengine v0.12.0 and v0.13.0 add the ch unit, widest-line intrinsic widths and unselectable text kept out of PDF text (go-pdfkit v0.17.0).

v0.7.1

Choose a tag to compare

@tannevaled tannevaled released this 21 Oct 06:32
c2f2d89
go install github.com/go-slides/slides/cmd/slides@v0.7.1

A performance release, with no change in output or API.

  • Caches (#36): built-in themes are parsed once per process. Project themes, packed style sheets and highlighted code blocks go through small caches keyed by content: 32 themes, 16 style sheets and 256 code blocks of at most 8 KiB. A deck whose style changes on every keystroke cannot make them grow, and a changed theme replaces its cached entry.
  • Fewer copies (#37, #38): the line marker used for scroll sync copies plain text in runs instead of byte by byte; a fuzz test against the old version found no difference in 4.1 M runs. Each render reuses one writer for text and code.

The editor render of the 100-slide deck allocates 5.7 MB instead of 11.4 MB. In WebAssembly it takes 17.9 ms instead of 35.9 ms. The VS Code preview after an edit takes 24 ms at Go's default GOGC, level with Marp for VS Code's 23 ms; it took 44 ms with v0.7.0. The first preview takes 52 ms, against Marp's 78 ms.

v0.7.0

Choose a tag to compare

@tannevaled tannevaled released this 20 Oct 12:50
33cf440
go install github.com/go-slides/slides/cmd/slides@v0.7.0
  • Presenter view (#29): press p, or click the controller's button, to open the presenter view, as marp-cli's bespoke template does (?view=presenter). It shows the current slide, the next step, the speaker notes, a timer and the page counter. The two windows follow each other through localStorage in both directions, with no network. Notes are escaped and kept out of the audience view's accessible text. A page grows by about 10 KB.
  • Scoped custom transitions (#31): a transition whose keyframes a slide's <style scoped> defines is renamed per slide, as marp-cli does.
  • Globs (#32): ** and {a,b} in file arguments follow marp-cli's glob rules, including dotfiles, node_modules and case sensitivity.
  • Editor line marks (#30): the editor package marks every slide and block with its source line, traced through templates, {{ include }}, front matter, headingDivider and ---hcl. The VS Code extension uses them for scroll sync. The command's output is unchanged.
  • Faster highlighting and themes (#33): go-regexp/engine v0.3.2 allocates about a fifth as many bytes on a deck with code: 10.9 MB against 52.7 MB natively. It also rejects a rule at once when its first byte or prefix cannot match. Theme regexps are skipped when the literal they need is absent. In the VS Code extension, the preview after an edit went from 61 to 35 ms.
  • Watch (#34): the debounce is now tested on a fake clock (testing/synctest), which fixes a test that failed on loaded CI runners. Behaviour is unchanged.

v0.6.0

Choose a tag to compare

@tannevaled tannevaled released this 20 Oct 08:39
5f4b714
go install github.com/go-slides/slides/cmd/slides@v0.6.0

marp-cli's command line, nearly all of it. Each of these was compared with marp-cli 4.5.1's own output (testdata/oracle/gen-cli.js).

  • Watch, server and preview (#24): -w, -s and -p, plus --host. The server listens on 127.0.0.1 by default and checks the Host and Origin headers, so a DNS-rebinding page cannot reach it. It serves only files under its directory and answers only GET and HEAD. ?pdf, ?pptx and the other conversions refuse cross-site requests. Live reload uses a WebSocket.
  • Directories (#23): -I/--input-dir mirrors a tree of decks into --output, and -P/--parallel sets how many decks convert at once.
  • Metadata and theme (#19): --title, --description, --author, --keywords, --url and --og-image override the deck's directives. --theme takes a name or a CSS file.
  • Notes and PDF options (#21): --notes writes the speaker notes as a .txt file. --pdf-notes adds them to the PDF as annotations. --pdf-outlines, .pages and .headings shape the outline as marp does. go-slides keeps its outline on by default; --no-pdf-outlines turns it off. These use go-pdfkit v0.16.0.
  • Template and transitions (#26):
    • --template bare|bespoke and --bespoke.osc, --bespoke.progress and --bespoke.transition. The transition directive plays through the View Transition API.
    • marp-cli's configuration files are read: .marprc*, package.json and --config-file, in JSON or YAML. JS configurations are named in a warning and not run.
    • The --browser* options are accepted and ignored with a warning, so scripts written for marp keep working.

For editors (#20, #22): new vfs, project and editor packages give the preview, positioned errors, completion, hover and deck detection that the new VS Code extension (v0.1.0) runs as WebAssembly. slides kinds --json is also new.

Fixes

  • A template error after a fenced code block was reported two lines too early (#22).
  • The transition directive was taken for a speaker note (#26).
  • A watch test that failed on slow runners is fixed (#27).

Behaviour changes

  • The bespoke progress bar is off by default, as in marp-cli; --bespoke.progress brings it back.
  • HTML builds create the output's directory.

Not done yet: a presenter view, ** globs in file arguments, and renaming keyframes in custom transitions.

v0.5.0

Choose a tag to compare

@tannevaled tannevaled released this 19 Oct 20:53
be20994
go install github.com/go-slides/slides/cmd/slides@v0.5.0
  • Editable PPTX and ODP (#18): --pptx and --odp now write slides made of text boxes, shapes and pictures, instead of one picture per slide. Text keeps its position, font, size, colour and links. Shapes, borders and linear gradients stay editable. Each picture is embedded once. Speaker notes are kept. Elements with no editable form (opacity, filters, blur, formulas, radial gradients, and every ODP gradient) are drawn as a picture of that element, with their text kept underneath. Lato, Roboto Mono and Inter (all OFL) are embedded, so the deck shows in its fonts on a machine that lacks them, and new text can still be typed in them. --pptx-raster and --odp-raster keep the old picture decks. On the 100-slide deck on an M4 Max:

    PPTX, 100 slides go-slides v0.5.0 go-slides v0.4.0 marp-cli 4.5.1
    Time 348 ms 4.7 s 7.8 s
    Size 760 KiB 4.8 MiB 7.2 MiB
    Memory 204 MiB 540 MiB 1.4 GiB

    marp-cli's PPTX holds pictures. Its --pptx-editable prints a PDF and converts it through LibreOffice, losing the notes; go-slides needs neither. internal/cmd/officecheck renders the decks back through LibreOffice and compares them with the PNG export: 1.7 % (PPTX) and 1.4 % (ODP) of pixels differ, on glyph edges. The layout comes from go-webengine's new officecanvas (go-webengine v0.10.1). The writers are in go-ooxml v0.5.0 and go-odf v0.9.0. Only LibreOffice was tested; PowerPoint and Keynote were not.

  • SVG fidelity (#16, #17): clipPath, fill-rule: evenodd, arc commands with several parameter sets, and arc flags written without separators now draw as Chrome draws them, through the fleet's new fork go-gfx/oksvg v0.2.0. One Twemoji (🪇) and 211 others changed, and SVG logos such as the octocat are no longer garbled.

v0.4.0

Choose a tag to compare

@tannevaled tannevaled released this 19 Oct 19:31
c273b15
go install github.com/go-slides/slides/cmd/slides@v0.4.0
  • Vector PDF (#15): --pdf (or -o deck.pdf) now draws each slide into the PDF instead of embedding a picture of it. Text is real text in embedded subset fonts, so it can be selected, searched and copied. Shapes and gradients are vectors, each image is embedded once, and links are kept. Layout comes from the same go-webengine layout tree as the PNG output, so the two match. Only effects with no vector form (opacity below 1, filters, masks, rotation, blurred shadows) are drawn as a picture of that element, with the element's text kept selectable on top. --pdf-raster keeps the old one-picture-per-slide PDF. On a 100-slide deck on an M4 Max:

    go-slides v0.4.0 go-slides v0.3.0 marp-cli 4.5.1
    Time 306 ms 1.15 s 1.84 s
    Size 758 KiB 10.0 MiB 837 KiB
    Memory 158 MiB 243 MiB 1.5 GiB

    On each test deck, between 0 % and 1.7 % of pixels differ from the PNG render, all of them on glyph edges (internal/cmd/pdfcheck measures this). The engine work is in go-webengine v0.9.0 (paint.PaintVector, pdfcanvas) and go-pdfkit v0.15.0.

  • Emoji (#14): emoji shortcodes (:smile:) and Unicode emoji become Twemoji images, written as Marp Core writes them but embedded in the deck instead of loaded from a CDN, so no network is needed. They appear in every output: HTML, PDF, PNG, PPTX and ODP. --no-emoji turns this off. The images come from the new go-icons/twemoji module (Twemoji 17.0.3, CC-BY 4.0). It adds 2.3 MB to the binary, and a deck without emoji pays nothing at run time.

v0.3.0

Choose a tag to compare

@tannevaled tannevaled released this 19 Oct 07:54
8d64a92
go install github.com/go-slides/slides/cmd/slides@v0.3.0
  • Faster and lighter than marp-cli (#11): slides render on a bounded worker pool, are written as they finish, and the fonts are installed once. On a 100-slide deck on an M4 Max:

    Format go-slides marp-cli 4.5.1 go-slides memory marp-cli memory
    PDF 1.14 s 1.88 s 242 MiB 1.5 GiB
    PNG 0.97 s 5.44 s 225 MiB 1.3 GiB
    PPTX 3.4 s 8.0 s 530 MiB 1.3 GiB

    The method and all the figures are in BENCHMARKS.md. go-webengine v0.8.0 and go-pdfkit v0.14.1 carry the shared optimisations.

  • OpenDocument (#12): --odp (or -o deck.odp) writes one picture per slide with its speaker notes, through go-odf v0.8.0's new WritePresentation.

  • HCL2 (#13): front matters opened with ---hcl, slides.hcl, and kinds and data files ending in .hcl accept HCL, with its expressions and functions: cty's standard library, plus page(), total(), env(), file() and now(). slides expand writes the YAML back for Marp.

  • Fitting headings (#9): # <!-- fit --> Title fills the slide width on one line, in the page and in every export.

  • Italics (#10): Lato and Roboto Mono italics are embedded.

Known limit: a PDF holds one image per slide, so it is larger than marp's vector PDF (about 10 MiB against 0.8 MiB for 100 slides).

v0.2.0

Choose a tag to compare

@tannevaled tannevaled released this 18 Oct 14:03
48b6864
go install github.com/go-slides/slides/cmd/slides@v0.2.0
  • Math: $…$ inline and $$…$$ display follow Marp Core's delimiter rules. go-tex/math typesets them into SVG sized in em, aligned on the text baseline, in HTML, images, PDF and PPTX (#7).
  • Code highlighting: go-rouge colours code blocks with highlight.js class names, the classes Marp's themes style (#7; go-rouge v0.5.0 adds the formatter).
  • Bold faces: Lato Bold and Black and Roboto Mono Bold are embedded, so gaia's headings and code get their weight (#7; go-opentype/fonts v0.13.0).
  • PowerPoint: --pptx (or -o deck.pptx) writes one picture per slide with its speaker notes through go-ooxml v0.4.0's WritePresentation, at scale 2 by default (#8).

Known limit: no italic face is embedded yet, so italic text renders upright.