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

Support prerendering of code blocks. #1627

Merged
merged 1 commit into from
Jul 8, 2021
Merged

Support prerendering of code blocks. #1627

merged 1 commit into from
Jul 8, 2021

Conversation

fredrikekre
Copy link
Member

No description provided.

@mortenpi mortenpi added Format: HTML Related to the default HTML output Type: Feature labels Jul 6, 2021
@fredrikekre fredrikekre marked this pull request as ready for review July 7, 2021 23:54
@fredrikekre
Copy link
Member Author

I marked this as experimental for now.

Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, other than the one thing.

This file is getting way too complicated though. I was wondering if the pre-rendering could be somehow more self-contained in a separate file.. but I don't actually see how. In any case, I think we need to properly refactor this at some stage.

src/Writers/HTMLWriter.jl Outdated Show resolved Hide resolved
src/Writers/HTMLWriter.jl Outdated Show resolved Hide resolved
@fredrikekre fredrikekre force-pushed the fe/prerender branch 3 times, most recently from 4c8cf01 to b0146f7 Compare July 8, 2021 02:53
test/prerender/prerender.jl Show resolved Hide resolved
Passing `prerender=true` to `Documenter.HTML` now renders syntax
highlighting of code blocks when building the page rather than
in the browser when the page is loaded. This requires a `node`
(NodeJS) executable in PATH or that a path to an executable is
passed as the `node` keyword argument. The `highlightjs` keyword
argument can be used to give a (local) file path to a custrom
hightlight.js library.

Example configuration:

  using Documenter, NodeJS_16_jll

  makedocs(;
      format = Documenter.HTML(
          prerender = true,            # enable prerendering
          node = NodeJS_16_jll.node(), # specify node executable (required if not available in PATH)
          # ...
      )
      # ...
  )

This feature is marked as experimental for now.
@fredrikekre fredrikekre merged commit 13c0300 into master Jul 8, 2021
@fredrikekre fredrikekre deleted the fe/prerender branch July 8, 2021 08:41
@fredrikekre fredrikekre mentioned this pull request Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Format: HTML Related to the default HTML output Type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants