Skip to main content

Asciidoctor backend for MkDocs

Project description

Getting started

Use AsciiDoc with Material for MkDocs.

[!IMPORTANT] This package is an early release. The API may change without notice, and stability is not guaranteed. Use in production environments is not recommended. Feedback and testing are welcome.

This MkDocs plugin replaces the MkDocs default Markdown processor with Asciidoctor for AsciiDoc files, allowing you to write documentation in AsciiDoc while keeping full compatibility with Material for MkDocs.

It uses a long-running Ruby Asciidoctor backend server for fast rendering of *.adoc files, normalizes the output HTML with BeautifulSoup, and adjusts it to match MkDocs conventions. The plugin ships some CSS/JS/RB and optionally injects "edit this page" links for included AsciiDoc modules when repo_url and edit_uri are configured.

Supports hot reload on the development server for all AsciiDoc source files when writing.

Asciidoctor attributes can be injected via the mkdocs.yml.

Using mkdocs-asciidoctor-backend

pip install mkdocs-asciidoctor-backend --upgrade --pre

[!IMPORTANT]

  • MkDocs expects docs source in a docs/ folder. See Strategy for including docs from repository root for further discussion.

  • For larger doc sets, set up a nav element in the mkdocs.yml, and optionally a root docs/index.adoc file. See nav for more details.

  • Asciidoctor xrefs might require you to set relfileprefix either globally in mkdocs.yml or per section/assembly file.

The following example mkdocs.yml can be dropped into the root of an existing AsciiDoc project.

site_name: Example
repo_url: https://github.com/example/repo
repo_name: example-repo
edit_uri: edit/main/

theme:
  name: material
  features:
    - content.action.edit
    - content.code.annotate
    - content.code.copy
    - content.code.select
    - navigation.footer
    - navigation.top
    - navigation.tracking
    - palette.toggle
    - search.highlight
    - search.suggest
    - toc.follow
    - toc.sticky
  palette:
    - scheme: default
      primary: indigo
      accent: indigo
      toggle:
        icon: material/toggle-switch-off-outline
        name: Switch to dark mode
    - scheme: slate
      primary: indigo
      accent: indigo
      toggle:
        icon: material/toggle-switch
        name: Switch to light mode

exclude_docs: |
  partials/**
  snippets/**
  modules/**

plugins:
  - search
  - asciidoctor_backend:
      symlink_dirs: ["partials", "snippets", "modules", "assemblies"] #configure project symlink folders to ignore
      edit_includes: true
      fail_on_error: false
      ignore_missing: true
      safe_mode: safe
      attributes:
        imagesdir: images
        showtitle: true
        sectanchors: true
        sectlinks: true
        icons: font
        idprefix: ""
        idseparator: "-"
        outfilesuffix: .html
        source-highlighter: rouge

A demo docs site is published here: https://aireilly.github.io/mkdocs-asciidoctor-backend/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_asciidoctor_backend-0.1.3.tar.gz (188.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_asciidoctor_backend-0.1.3-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_asciidoctor_backend-0.1.3.tar.gz.

File metadata

File hashes

Hashes for mkdocs_asciidoctor_backend-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ef94da496b43aaab350bf89e7269b07cce4c8af31d6e706a9517e1ca4624d0fb
MD5 b7299e826b03de858fa30692e807df7b
BLAKE2b-256 e0d81610b865c821242fed07e5ff8042def400612edbbc183f82b26664e5e544

See more details on using hashes here.

File details

Details for the file mkdocs_asciidoctor_backend-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_asciidoctor_backend-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ca43146e8d32c84082fdc71efd1d26822de6b9c19f716b47eeeb676f0b63e0eb
MD5 efd80a77b56ecee23979aff68fd00e78
BLAKE2b-256 ffa39c34d3c75b4408f64fcae97b7e846e23fdec6d76a415a737ca27c9541077

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page