Skip to content

Commit 2280a19

Browse files
authored
Docs: update markdoc example to use build.jobs (#11929)
The test-builds example was updated as well https://github.com/readthedocs/test-builds/tree/markdoc
1 parent ba21134 commit 2280a19

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

docs/user/intro/markdoc.rst

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@ Minimal configuration is required to build an existing Markdoc project on Read t
1414
version: 2
1515
1616
build:
17-
os: ubuntu-24.04
18-
tools:
19-
nodejs: "22"
20-
commands:
21-
# Install dependencies
22-
- cd docs/ && npm install
23-
# Build the site
24-
- cd docs/ && npm run build
25-
# Copy generated files into Read the Docs directory
26-
- mkdir --parents $READTHEDOCS_OUTPUT/html/
27-
- cp --verbose --recursive docs/out/* $READTHEDOCS_OUTPUT/html/
17+
os: ubuntu-24.04
18+
tools:
19+
nodejs: "22"
20+
jobs:
21+
install:
22+
# Install dependencies
23+
- cd docs/ && npm install
24+
build
25+
# Build the site
26+
- cd docs/ && npm run build
27+
# Copy generated files into Read the Docs directory
28+
- mkdir --parents $READTHEDOCS_OUTPUT/html/
29+
- cp --verbose --recursive docs/out/* $READTHEDOCS_OUTPUT/html/
2830
2931
.. _Markdoc: https://markdoc.io/
3032

@@ -37,27 +39,27 @@ you need to generate static HTML from the Next JS build:
3739
.. code-block:: js
3840
:caption: next.config.js
3941
40-
const withMarkdoc = require('@markdoc/next.js');
42+
const withMarkdoc = require('@markdoc/next.js');
4143
42-
const nextConfig = {
43-
// Optional: Export HTML files instead of a Node.js server
44-
output: 'export',
44+
const nextConfig = {
45+
// Optional: Export HTML files instead of a Node.js server
46+
output: 'export',
4547
46-
// Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html`
47-
trailingSlash: true,
48+
// Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html`
49+
trailingSlash: true,
4850
49-
// Use Canonical URL, but only the path and with no trailing /
50-
// End result is like: `/en/latest`
51-
basePath: process.env.READTHEDOCS_CANONICAL_URL
52-
? new URL(process.env.READTHEDOCS_CANONICAL_URL).pathname.replace(/\/$/, "")
53-
: "",
54-
}
51+
// Use Canonical URL, but only the path and with no trailing /
52+
// End result is like: `/en/latest`
53+
basePath: process.env.READTHEDOCS_CANONICAL_URL
54+
? new URL(process.env.READTHEDOCS_CANONICAL_URL).pathname.replace(/\/$/, "")
55+
: "",
56+
}
5557
56-
module.exports =
57-
withMarkdoc({mode: 'static'})({
58-
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdoc'],
59-
...nextConfig,
60-
});
58+
module.exports =
59+
withMarkdoc({mode: 'static'})({
60+
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdoc'],
61+
...nextConfig,
62+
});
6163
6264
Limitations
6365
-----------

0 commit comments

Comments
 (0)