Skip to content

countableSet/antora-ui

Repository files navigation

Antora Default UI Customized

This is forked version of the antora default ui.

Enhancements that have been made to the original are:

  • light/dark mode and theme switcher button

  • github highlightjs styles for light/dark modes

  • source code tabs

  • styled admonition blocks with icons

  • font-awesome 4 (font and css)

  • widens main content panel by percentages #10

  • replace Roboto font with system font #11

Release

See releases for publish versions of the ui-bundle zip.

Development

Original docs for full help.

For a link of all the gulp tasks

$ gulp --tasks-simple

Preview the UI

The default UI project is configured to preview offline. The files in the preview-src/ folder provide the sample content that allow you to see the UI in action. In this folder, you’ll primarily find pages written in AsciiDoc. These pages provide a representative sample and kitchen sink of content from the real site.

To build the UI and preview it in a local web server, run the preview command:

$ gulp preview

You’ll see a URL listed in the output of this command:

[12:00:00] Starting server...
[12:00:00] Server started http://localhost:5252
[12:00:00] Running server

Navigate to this URL to preview the site locally.

While this command is running, any changes you make to the source files will be instantly reflected in the browser. This works by monitoring the project for changes, running the preview:build task if a change is detected, and sending the updates to the browser.

Press kbd:[Ctrl+C] to stop the preview server and end the continuous build.

Package for Use with Antora

If you need to package the UI so you can use it to generate the documentation site locally, run the following command:

$ gulp bundle

If any errors are reported by lint, you’ll need to fix them.

When the command completes successfully, the UI bundle will be available at build/ui-bundle.zip. You can point Antora at this bundle using the --ui-bundle-url command-line option.

If you have the preview running, and you want to bundle without causing the preview to be clobbered, use:

$ gulp bundle:pack

The UI bundle will again be available at build/ui-bundle.zip.

Source Maps

The build consolidates all the CSS and client-side JavaScript into combined files, site.css and site.js, respectively, in order to reduce the size of the bundle. {url-source-maps}[Source maps] correlate these combined files with their original sources.

This “source mapping” is accomplished by generating additional map files that make this association. These map files sit adjacent to the combined files in the build folder. The mapping they provide allows the debugger to present the original source rather than the obfuscated file, an essential tool for debugging.

In preview mode, source maps are enabled automatically, so there’s nothing you have to do to make use of them. If you need to include source maps in the bundle, you can do so by setting the SOURCEMAPS environment variable to true when you run the bundle command:

$ SOURCEMAPS=true gulp bundle

In this case, the bundle will include the source maps, which can be used for debugging your production site.

Merge Upstream

git remote add upstream git@gitlab.com:antora/antora-ui-default.git
git fetch upstream
git checkout master
git merge --no-ff upstream/master