-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Docs: Basic Antora page #11783
Open
ericholscher
wants to merge
4
commits into
main
Choose a base branch
from
antora-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Docs: Basic Antora page #11783
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
Antora | ||
====== | ||
|
||
.. meta:: | ||
:description lang=en: Hosting Antora documentation on Read the Docs. | ||
|
||
`Antora`_ is a powerful documentation framework that allows you to write documentation in AsciiDoc. | ||
|
||
Minimal configuration is required to build an existing Antora project on Read the Docs. | ||
|
||
.. code-block:: yaml | ||
:caption: .readthedocs.yaml | ||
|
||
version: 2 | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
nodejs: "20" | ||
commands: | ||
- npm i -g -D -E antora | ||
- antora -v | ||
- antora --fetch antora-playbook.yml --to-dir $READTHEDOCS_OUTPUT/html | ||
|
||
.. _Antora: https://antora.org/ | ||
|
||
Example configuration | ||
--------------------- | ||
|
||
In order to build an Antora project on Read the Docs, | ||
you need a playbook file that specifies the sources and UI bundle to use: | ||
|
||
.. code-block:: yaml | ||
:caption: antora-playbook.yml | ||
|
||
site: | ||
title: Antora Demo site on Read the Docs | ||
start_page: component-b::index.adoc | ||
|
||
content: | ||
sources: | ||
- url: https://gitlab.com/antora/demo/demo-component-a.git | ||
branches: HEAD | ||
- url: https://gitlab.com/antora/demo/demo-component-b.git | ||
branches: [v2.0, v1.0] | ||
start_path: docs | ||
|
||
ui: | ||
bundle: | ||
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable | ||
snapshot: true | ||
|
||
Quick start | ||
----------- | ||
|
||
- If you have an existing Antora project you want to host on Read the Docs, check out our :doc:`/intro/add-project` guide. | ||
|
||
- If you're new to Antora, check out the official `Install and Run Antora Quickstart`_ guide. | ||
|
||
.. _Install and Run Antora Quickstart: https://docs.antora.org/antora/latest/install-and-run-quickstart/ | ||
|
||
Example repository and demo | ||
--------------------------- | ||
|
||
Example repository | ||
https://github.com/readthedocs/test-builds/tree/antora | ||
|
||
Demo | ||
https://test-builds.readthedocs.io/en/antora/ | ||
|
||
Further reading | ||
--------------- | ||
|
||
* `Antora documentation`_ | ||
|
||
.. _Antora documentation: https://docs.antora.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
Markdoc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems you pushed Markdoc changes by mistake in this PR. |
||
======= | ||
|
||
.. meta:: | ||
:description lang=en: Hosting Markdoc documentation on Read the Docs. | ||
|
||
`Markdoc`_ is a powerful documentation framework that allows you to write documentation in a flavor of Markdown. | ||
|
||
Minimal configuration is required to build an existing Markdoc project on Read the Docs. | ||
|
||
.. code-block:: yaml | ||
:caption: .readthedocs.yaml | ||
|
||
version: 2 | ||
|
||
build: | ||
os: ubuntu-24.04 | ||
tools: | ||
nodejs: "18" | ||
commands: | ||
# Install dependencies | ||
- cd docs/ && npm install | ||
# Build the site | ||
- cd docs/ && npm run build | ||
# Copy generated files into Read the Docs directory | ||
- mkdir --parents $READTHEDOCS_OUTPUT/html/ | ||
- cp --verbose --recursive docs/out/* $READTHEDOCS_OUTPUT/html/ | ||
|
||
.. _Markdoc: https://markdoc.io/ | ||
|
||
Example configuration | ||
--------------------- | ||
|
||
In order to build a Markdoc project on Read the Docs, | ||
you need to generate static HTML from the Next JS build: | ||
|
||
.. code-block:: js | ||
:caption: next.config.js | ||
|
||
const withMarkdoc = require('@markdoc/next.js'); | ||
|
||
const nextConfig = { | ||
// Optional: Export HTML files instead of a Node.js server | ||
output: 'export', | ||
|
||
// Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html` | ||
trailingSlash: true, | ||
|
||
// Ensure pages have relative asset URLs | ||
assetPrefix: './', | ||
|
||
// Ensure links are relative | ||
// TODO: Make this dynamic with the Read the Docs base path, | ||
// so PR builds work nicely | ||
basePath: '/en/markdoc', | ||
} | ||
|
||
module.exports = | ||
withMarkdoc({mode: 'static'})({ | ||
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdoc'], | ||
...nextConfig, | ||
}); | ||
|
||
Quick start | ||
----------- | ||
|
||
- If you have an existing Markdoc project you want to host on Read the Docs, check out our :doc:`/intro/add-project` guide. | ||
|
||
- If you're new to Markdoc, check out the official `Getting started with Markdoc`_ guide. | ||
|
||
.. _Getting started with Markdoc: https://markdoc.io/docs/getting-started | ||
|
||
Example repository and demo | ||
--------------------------- | ||
|
||
Example repository | ||
https://github.com/readthedocs/test-builds/tree/markdoc | ||
|
||
Demo | ||
https://test-builds.readthedocs.io/en/markdoc/ | ||
|
||
Further reading | ||
--------------- | ||
|
||
* `Markdoc documentation`_ | ||
|
||
.. _Markdoc documentation: https://markdoc.io/docs |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.