Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helium theme - add mermaid support #516

Merged
merged 1 commit into from
Sep 7, 2023
Merged

Helium theme - add mermaid support #516

merged 1 commit into from
Sep 7, 2023

Conversation

jenshalm
Copy link
Contributor

@jenshalm jenshalm commented Sep 5, 2023

The final feature PR for version 0.19, adding support for mermaid diagrams to the Helium theme.

The initial support is implemented as follows:

  • Since this feature requires templating, it is part of the Helium theme and not available for the laika-core module.
  • In contrast to most other functionality in Laika it is only supported for HTML output, mermaid blocks passed to EPUB or PDF renderers trigger warnings and will be skipped.
  • The mermaid theme is automatically adjusted to the theme colors configured for Helium.
  • Dark mode is supported, but since mermaid styling is driven by JavaScript and not CSS, it is detected at load time and not dynamically.
  • Mermaid support is not configurable in this initial implementation. It's best to wait for actual adoption and user feedback to find out which level of configurability users might want, if any, meaning it'll be a topic for version 1.x.
  • The loading of mermaid JavaScript is driven by inspecting the content of pages, meaning we avoid unnecessary script loading times for pages that do not contain any mermaid diagrams.
  • Markup syntax is a standard fenced code block starting with ```mermaid, which means that GitHubFlavor needs to be active (it will be included by default when using Laika with sbt-typelevel, but not when using Laika standalone).

Closes #331.

@jenshalm jenshalm added this to the 0.19.4 milestone Sep 5, 2023
@jenshalm jenshalm marked this pull request as draft September 5, 2023 18:52
@jenshalm jenshalm marked this pull request as ready for review September 5, 2023 19:16
@jenshalm jenshalm merged commit 986a9ac into 0.19.x Sep 7, 2023
1 check passed
@jenshalm jenshalm deleted the feature/mermaid branch September 7, 2023 14:00
jenshalm added a commit that referenced this pull request Sep 7, 2023
* fix CSS for Helium UI-components for setups diverging from the defaults (#456)
* render class attribute as render hint for top navigation bar
* render class attribute as render hint for landing page
  based on approximate perceptual luminance of configured gradient colors
* amend Helium CSS variable generator to produce new scoped mappings
* adjust Helium CSS for new CSS variable mappings
* fix css for ui-components on landing page
* adjust transparent overlay for inverted color mode
* hover for landing page button that works in all modes
* satisfy mima with default impl

* prepare 0.19.3 release

* release version 0.19.3

* Update sbt, scripted-plugin to 1.9.1 in 0.19.x (#458)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update scalafmt-core to 3.7.7 in 0.19.x (#459)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update cats-effect to 3.5.1 in 0.19.x (#460)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* link validation - more config options and better defaults (#432)

* add new LinkValidation config types
* switch config default to LinkValidation.Local for core transformer

* introduce DocumentTree.builder (#436)

* extract DocumentTreeBuilder from parser runtime in laika-io
* DocumentTreeBuilder - scaladoc and deprecations
* DocumentTreeBuilder - add new spec that tests new API directly

* Update sbt, scripted-plugin to 1.9.2 in 0.19.x (#471)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update sbt-scalajs-crossproject to 1.3.2 in 0.19.x (#470)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update scalafmt-core to 3.7.9 in 0.19.x (#472)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update sbt-mima-plugin to 1.1.3 in 0.19.x (#476)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update scalafmt-core to 3.7.10 in 0.19.x (#478)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update http4s-dsl, http4s-ember-server to 0.23.23 in 0.19.x (#477)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update sbt, scripted-plugin to 1.9.3 in 0.19.x (#479)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update scalafmt-core to 3.7.11 in 0.19.x (#480)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update scalafmt-core to 3.7.12 in 0.19.x (#486)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update cats-core to 2.10.0 in 0.19.x (#496)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update fs2-io to 3.8.0 in 0.19.x (#481)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* plugin: print full URL in preview server boot message (#500)

* TreeParserSpec: add test for skipping validation to other versions

* Update sbt, scripted-plugin to 1.9.4 in 0.19.x (#504)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* manual: add missing info for running separate parsers and renderers (#501)

* helium: introduce new config for including CSS and JS

* helium: add tests for new config for CSS/JS includes

* adjust whitespace in plugin tests for helium template changes

* manual: documentation for new Helium config for CSS/JS includes.

* Added css to ensure code renders properly in sidebar on highlight (#507)

* Markdown spec: bullet lists do no longer require preceding empty lines (#502)

* scala 3 support: avoid use of inline as member name

* exclude mima issue on package-private type

* formatting

* Update fs2-io to 3.9.1 in 0.19.x (#508)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update scalafmt-core to 3.7.13 in 0.19.x (#510)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* Update sbt-scalafmt to 2.5.2 in 0.19.x (#509)

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>

* introduce cursor.currentDocument.rawTitle (#512)

* ASTRenderer - simplify rendering of ResolvedInternalTarget

* preview server - add rendering of AST pages

* preview server - fix URLs and links of new AST page renderer

* preview server - formatting

* Markdown spec compliance: allow URLs with nested parenthesis (#514)

* link directives - properly support custom link text as documented (#515)

* link directives - properly support custom link text as documented
* address mima issues by using a new private case class instead

* helium - add mermaid support (#516)

* remove old directives for linking CSS/JS and their config API

* rename LaikaConfig.encoding to withEncoding to match 0.19.4

* Revert "adjust whitespace in plugin tests for helium template changes"

This reverts commit aeeb7f1

* remove old HTML head directives from documentation

* remove unused parameter in DocumentTreeBuilder

* resurrect test for including resources from a theme

---------

Co-authored-by: typelevel-steward[bot] <106827141+typelevel-steward[bot]@users.noreply.github.com>
Co-authored-by: Jamie Willis <J_mie@hotmail.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant