Skip to content

Experimenting HTML build with mdbook #10

Open
@idoleat

Description

@idoleat

The book is currently available for experimentation on https://idoleat.github.io/concurrency-primer/, with content up to section 6. The rest will be added once styling are converted. mdbook is similar to gitbook. Some changes on styling are:

  • Unify all \textit , \introcude and \emph as italic text since there's no visual difference in current pdf publication
  • smart-punctuation is enabled to achieve same affect as ``some words''
  • mathjax-support is enabled to write math inside \\( \\) (inline) and \\[ \\] (block)
  • \clang{} and \Cplusplus are expanded to normal C and C++
  • \textsc are expanded as <small> tag and capital letters, as the sc suggested
  • Images are all converted to SVGs and embedded using {{#include images/xxx.svg}} instead of ![image](images/xxx.svg) to make characters in SVGs select-able. SVGs now are poorly converted/made and should be remade later.

Some advantages of mdbook are:

  • cargo install mdbook (or just download the binary) is all you need to setup build environment
  • Live preview in browser on changes saved with mdbook serve
  • Easier custom styling via CSS
  • Fast build time in GitHub action (13s)

Some conserncs are:

  • pdf rendering backend options: mdbook-pdf and mdbook-pandoc. The first one is hard to deploy in CI. Haven't tried the later yet. The print button on in the upper-right corner can print a pretty raw pdf though.
  • Maybe figure captions need costum styling

Source code link and "new issue" button are enabled at the upper-right corner.

Another HTML build option is typst but the feature is still on the 2024 roadmap. In typst you can edit like markdown, styling and arranging like CSS (but richer) and scripting like python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions