All Projects → Mogztter → antora-site-generator-lunr

Mogztter / antora-site-generator-lunr

Licence: MIT license
An Antora's site generator that produces a Lunr index

Programming Languages

javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to antora-site-generator-lunr

docs
ownCloud Documentation (v2)
Stars: ✭ 50 (+85.19%)
Mutual labels:  antora
So Simple Theme
A simple Jekyll theme for words and pictures.
Stars: ✭ 1,701 (+6200%)
Mutual labels:  lunr
Minimal Mistakes
📐 Jekyll theme for building a personal site, blog, project documentation, or portfolio.
Stars: ✭ 8,967 (+33111.11%)
Mutual labels:  lunr
Lunr.js
A bit like Solr, but much smaller and not as bright
Stars: ✭ 7,846 (+28959.26%)
Mutual labels:  lunr
react-search-example
📉📈 An example of using React with D3, Lunr.js and an autocomplete UI to build an accessible keyboard-centric search experience. Also – service workers for offline caching, and desktop app with Electron.
Stars: ✭ 15 (-44.44%)
Mutual labels:  lunr
gatsby-plugin-lunr
Gatsby plugin for full text search implementation based on lunr client-side index. Supports multilanguage search.
Stars: ✭ 69 (+155.56%)
Mutual labels:  lunr
lunr-mutable-indexes
Mutable indexes for lunr.js 2.1.x
Stars: ✭ 19 (-29.63%)
Mutual labels:  lunr
lunr-module
Full-text search with pre-build indexes for Nuxt.js using lunr.js
Stars: ✭ 45 (+66.67%)
Mutual labels:  lunr

ℹ️ Information ℹ️

If you are using Antora 3, you should use the Antora Lunr extension (package: @antora/lunr-extension), which is an official Antora project.

This repository will go into maintenance mode for users who have not yet transitioned from Antora 2 to Antora 3. After some time, the repository will be archived.


Antora Site Generator With Lunr

npm Docker Image Version (tag latest semver) Build

This site generator is a copy of the default site generator that in addition produces a Lunr index that can be used in your documentation UI. Lunr provides a great search experience in your documentation site without the need for external, server-side, search services.

Antora is a modular static site generator designed for creating documentation sites from AsciiDoc documents. Its site generator pipeline aggregates documents from versioned content repositories and processes them using Asciidoctor.

Usage

Install the site generator. Open a terminal and type:

$ npm i -g antora-site-generator-lunr

When generating your documentation site, use the --generator option:

$ DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr NODE_PATH="$(npm -g root)" antora --generator antora-site-generator-lunr site.yml

NOTE: The NODE_PATH assignment is necessary to ensure Antora can locate node modules install globally. Depending on your environment, you may find that this assignment is unnecessary. If you've installed Antora globally using Yarn, you may need to add "$(yarn global dir)/node_modules" to the NODE_PATH environment variable instead.

Please read the documentation to enable the search component in your documentation UI.

Using the Docker image

The Docker image is built upon the Antora's official Docker image and should be used as a replacement. For example, instead of running:

$ docker run -u $(id -u) -v $PWD:/antora:Z --rm -t antora/antora:2.3.4 antora-playbook.yml

You will run:

$ docker run -u $(id -u) -v $PWD:/antora:Z --rm -t ggrossetie/antora-lunr antora-playbook.yml

The image sets DOCSEARCH_ENABLED=true and DOCSEARCH_ENGINE=lunr environment variables. When executing docker run, you can overwrite any variable defined in the image. For example:

$ docker run --env DOCSEARCH_ENABLED=false # ...

Moreover, the site generator is automatically configured on the antora command (i.e. --generator antora-site-generator-lunr).

Upgrading

When installing this generator globally (i.e., npm i -g), it also installs a private copy of Antora (minus the CLI). Thus, to upgrade the copy of Antora this site generator uses, you need to reinstall this package. Upgrading Antora alone isn't sufficient.

To upgrade this site generator and Antora, open a terminal and type the following commands:

$ npm uninstall -g antora-site-generator-lunr @antora/cli @antora/site-generator-default

$ npm i -g antora-site-generator-lunr @antora/cli @antora/site-generator-default

These commands ensure you have the latest version of both the site generator and Antora regardless of whether you're using this site generator.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].