Skip to content

Commit b4e1878

Browse files
committed
docs: prioritize npm workflow; add if/then to Quick Start
Reorder README (AsciiDoc + Markdown) so Method 1 is the npm-based install; pre-built ui-bundle is for no-Node setups. Align the Antora installation guide with the same ordering and stacked supplementalexample.
1 parent 9d9c70e commit b4e1878

3 files changed

Lines changed: 129 additions & 83 deletions

File tree

README.adoc

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -40,45 +40,14 @@ Your support helps the Antora team prioritize this feature!
4040

4141
== Quick Start
4242

43-
=== Method 1: Use pre-built bundle (Recommended)
43+
=== Which installation path should I use?
4444

45-
The easiest way to use this theme is to point your Antora playbook directly to the latest pre-built UI bundle. This includes the Antora Default UI plus all dark mode enhancements.
45+
* **If your project already uses Node/npm/pnpm** (common for Antora sites) — Prefer *Method 1* (install from npm) and *Method 2* when you need layered overrides. The theme stays in `package.json` / your lockfile like the rest of your toolchain.
46+
* **If you want no JavaScript install step** (minimal CI image, or a repo without Node) — Use *Method 3* (pre-built `ui-bundle.zip`): one URL in the playbook, no `node_modules`.
4647

47-
. Configure your `antora-playbook.yml` to use the release bundle:
48-
+
49-
[source,yaml]
50-
----
51-
ui:
52-
bundle:
53-
url: https://github.com/antora-supplemental/antora-dark-theme/releases/latest/download/ui-bundle.zip
54-
snapshot: true
55-
----
56-
57-
=== Method 2: Copy supplemental-ui folder
58-
59-
If you want to customize the dark mode styles or logic locally, you can copy the `supplemental-ui` folder into your project.
60-
61-
. Copy the `supplemental-ui` folder to your project root:
62-
+
63-
[source,bash]
64-
----
65-
cp -r supplemental-ui /path/to/your/antora-project/
66-
----
67-
68-
. Configure your `antora-playbook.yml` to use the supplemental files alongside the default UI:
69-
+
70-
[source,yaml]
71-
----
72-
ui:
73-
bundle:
74-
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
75-
snapshot: true
76-
supplemental_files: ./supplemental-ui
77-
----
78-
79-
=== Method 3: Use as npm dependency
48+
=== Method 1: Use as npm dependency (recommended for Node-based projects)
8049

81-
You can also install this theme as a dev dependency. This is useful for version tracking and easy updates within your project's ecosystem.
50+
Install this theme as a dev dependency so the version is tracked with your project.
8251

8352
[tabs]
8453
====
@@ -122,9 +91,9 @@ ui:
12291
supplemental_files: ./node_modules/antora-dark-theme/supplemental-ui
12392
----
12493

125-
=== Method 4: Stacked Overrides (Deep Customization)
94+
=== Method 2: Stacked supplemental_files (project overrides)
12695

127-
To override the dark theme's own overrides with your project-specific customizations, use an array for `supplemental_files`. Paths listed later take precedence.
96+
To override or extend this theme with your own supplemental UI, use an array for `supplemental_files`. Paths listed **later** take precedence.
12897

12998
[source,yaml]
13099
----
@@ -137,6 +106,42 @@ ui:
137106
- ./site/src
138107
----
139108

109+
=== Method 3: Pre-built UI bundle (no JavaScript toolchain)
110+
111+
Point your Antora playbook at the latest release bundle. This ships the Antora Default UI plus all dark mode enhancements—no npm install.
112+
113+
. Configure your `antora-playbook.yml`:
114+
+
115+
[source,yaml]
116+
----
117+
ui:
118+
bundle:
119+
url: https://github.com/antora-supplemental/antora-dark-theme/releases/latest/download/ui-bundle.zip
120+
snapshot: true
121+
----
122+
123+
=== Method 4: Copy `supplemental-ui` into your repo
124+
125+
If you want to **vendor** or heavily customize the dark mode assets, copy the `supplemental-ui` folder into your project (instead of resolving it from npm).
126+
127+
. Copy the folder:
128+
+
129+
[source,bash]
130+
----
131+
cp -r supplemental-ui /path/to/your/antora-project/
132+
----
133+
134+
. Point the playbook at your copy, on top of the default UI bundle:
135+
+
136+
[source,yaml]
137+
----
138+
ui:
139+
bundle:
140+
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
141+
snapshot: true
142+
supplemental_files: ./supplemental-ui
143+
----
144+
140145
== Live Demo
141146

142147
See the dark theme in action: {url-demo}[Live Demo]

README.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55

66
Dark mode supplemental UI for [Antora](https://antora.org) documentation sites.
77

8-
## Install
8+
## Quick start
99

10-
Install the published package as a development dependency:
10+
### Which installation path should I use?
11+
12+
- **If your project already uses Node/npm/pnpm** (common for Antora sites) — use **Method 1** (npm) and **Method 2** when you need layered overrides. The theme stays in `package.json` / your lockfile like the rest of your toolchain.
13+
- **If you want no JavaScript install step** (minimal CI, or a repo without Node) — use **Method 3** (pre-built `ui-bundle.zip`): one URL in the playbook, no `node_modules`.
14+
15+
### Method 1: npm dependency (recommended for Node-based projects)
1116

1217
```bash
1318
# npm
@@ -23,49 +28,49 @@ yarn add -D antora-dark-theme
2328
bun add -d antora-dark-theme
2429
```
2530

26-
Then configure your playbook file(s) (typically `antora-playbook.yml`) to use the theme.
27-
28-
### Method 1: Use pre-built bundle (Recommended)
29-
30-
The easiest way to use this theme is to point your Antora playbook directly to the latest pre-built UI bundle. This includes the Antora Default UI plus all dark mode enhancements without requiring any local package installation.
31+
Then reference the supplemental UI from `node_modules` in `antora-playbook.yml` (or your playbook file):
3132

3233
```yaml
3334
ui:
3435
bundle:
35-
url: https://github.com/antora-supplemental/antora-dark-theme/releases/latest/download/ui-bundle.zip
36+
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
3637
snapshot: true
38+
supplemental_files: ./node_modules/antora-dark-theme/supplemental-ui
3739
```
3840
39-
### Method 2: Use as npm dependency
41+
### Method 2: Stacked `supplemental_files` (project overrides)
4042

41-
Install the package:
43+
Paths listed **later** take precedence.
4244

43-
```bash
44-
pnpm add -D antora-dark-theme
45+
```yaml
46+
ui:
47+
bundle:
48+
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
49+
snapshot: true
50+
supplemental_files:
51+
- ./node_modules/antora-dark-theme/supplemental-ui
52+
- ./site/src
4553
```
4654

47-
Then reference the supplemental UI from `node_modules`:
55+
### Method 3: Pre-built UI bundle (no JavaScript toolchain)
4856

4957
```yaml
5058
ui:
5159
bundle:
52-
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
60+
url: https://github.com/antora-supplemental/antora-dark-theme/releases/latest/download/ui-bundle.zip
5361
snapshot: true
54-
supplemental_files: ./node_modules/antora-dark-theme/supplemental-ui
5562
```
5663

57-
### Method 3: Stacked Overrides (Deep Customization)
64+
### Method 4: Copy `supplemental-ui` into your repo
5865

59-
To override the dark theme's own overrides with your project-specific customizations, use an array for `supplemental_files`. Paths listed later take precedence.
66+
Vendor or fork the theme assets by copying the `supplemental-ui` folder into your project, then:
6067

6168
```yaml
6269
ui:
6370
bundle:
6471
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
6572
snapshot: true
66-
supplemental_files:
67-
- ./node_modules/antora-dark-theme/supplemental-ui
68-
- ./site/src
73+
supplemental_files: ./supplemental-ui
6974
```
7075

7176
## Features
@@ -80,7 +85,7 @@ ui:
8085

8186
Full documentation and live demo: [antora-supplemental.github.io/antora-dark-theme](https://antora-supplemental.github.io/antora-dark-theme)
8287

83-
For other installation options, including the pre-built UI bundle and copying `supplemental-ui` directly, see the [official README.adoc](https://github.com/antora-supplemental/antora-dark-theme/README.adoc).
88+
For the full AsciiDoc guide (same content, more detail), see [README.adoc](https://github.com/antora-supplemental/antora-dark-theme/blob/main/README.adoc).
8489

8590
## License
8691

docs/modules/guide/pages/installation.adoc

Lines changed: 60 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,47 @@
44

55
There are several ways to add the dark theme to your Antora project.
66

7-
== Method 1: Install from GitHub (Recommended)
7+
== Which installation path should I use?
88

9-
Install directly from the GitHub repository:
9+
* **If your project already uses Node/npm/pnpm** (common for Antora sites) — Prefer *Method 1* (npm registry) or *Method 2* (GitHub as a package dependency). Both keep the theme in your package graph and lockfile.
10+
* **If you want no JavaScript install step** (minimal CI, or a repo without Node) — Use *Method 3* (pre-built `ui-bundle.zip`).
11+
12+
== Method 1: npm registry (recommended)
13+
14+
Install the published package:
1015

1116
[tabs]
1217
====
1318
pnpm::
1419
+
1520
[source,bash]
1621
----
17-
# Latest version
18-
pnpm add -D github:antora-supplemental/antora-dark-theme
19-
20-
# Specific version
21-
pnpm add -D github:antora-supplemental/antora-dark-theme#v0.1.0
22+
pnpm add -D antora-dark-theme
2223
----
2324
2425
npm::
2526
+
2627
[source,bash]
2728
----
28-
npm install --save-dev github:antora-supplemental/antora-dark-theme
29+
npm install --save-dev antora-dark-theme
2930
----
3031
3132
yarn::
3233
+
3334
[source,bash]
3435
----
35-
yarn add -D github:antora-supplemental/antora-dark-theme
36+
yarn add -D antora-dark-theme
37+
----
38+
39+
bun::
40+
+
41+
[source,bash]
42+
----
43+
bun add -D antora-dark-theme
3644
----
3745
====
3846

39-
Then configure your `antora-playbook.yml`:
47+
Then configure your `antora-playbook.yml` with the Antora Default UI bundle and this theme’s supplemental files:
4048

4149
[source,yaml]
4250
----
@@ -47,39 +55,68 @@ ui:
4755
supplemental_files: ./node_modules/antora-dark-theme/supplemental-ui
4856
----
4957

50-
== Method 2: Install from npm Registry
58+
To layer your own supplemental UI after this theme, use an array; later paths win:
59+
60+
[source,yaml]
61+
----
62+
ui:
63+
bundle:
64+
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
65+
snapshot: true
66+
supplemental_files:
67+
- ./node_modules/antora-dark-theme/supplemental-ui
68+
- ./site/src
69+
----
5170

52-
If the package is published to npm:
71+
== Method 2: Install from GitHub as a package dependency
72+
73+
Useful for an unreleased commit or when you prefer the `github:` protocol:
5374

5475
[tabs]
5576
====
5677
pnpm::
5778
+
5879
[source,bash]
5980
----
60-
pnpm add -D antora-dark-theme
81+
# Latest default branch
82+
pnpm add -D github:antora-supplemental/antora-dark-theme
83+
84+
# Specific tag
85+
pnpm add -D github:antora-supplemental/antora-dark-theme#v0.1.0
6186
----
6287
6388
npm::
6489
+
6590
[source,bash]
6691
----
67-
npm install --save-dev antora-dark-theme
92+
npm install --save-dev github:antora-supplemental/antora-dark-theme
6893
----
6994
7095
yarn::
7196
+
7297
[source,bash]
7398
----
74-
yarn add -D antora-dark-theme
99+
yarn add -D github:antora-supplemental/antora-dark-theme
75100
----
76101
====
77102

78-
Same playbook configuration as Method 1.
103+
Use the same `supplemental_files` path as *Method 1* (`./node_modules/antora-dark-theme/supplemental-ui`).
104+
105+
== Method 3: Pre-built UI bundle (no JavaScript toolchain)
106+
107+
Point your playbook at the release artifact (Antora Default UI + dark theme, no `npm install`):
79108

80-
== Method 3: Install from Release Tarball
109+
[source,yaml]
110+
----
111+
ui:
112+
bundle:
113+
url: https://github.com/antora-supplemental/antora-dark-theme/releases/latest/download/ui-bundle.zip
114+
snapshot: true
115+
----
81116

82-
Download a specific release directly:
117+
== Method 4: Install from release tarball
118+
119+
Download a specific `.tgz` from link:https://github.com/antora-supplemental/antora-dark-theme/releases[GitHub Releases] if you need an exact version without using the npm registry:
83120

84121
[tabs]
85122
====
@@ -105,9 +142,11 @@ yarn add -D https://github.com/antora-supplemental/antora-dark-theme/releases/do
105142
----
106143
====
107144

108-
== Method 4: Copy supplemental-ui Folder
145+
Then use the same playbook `supplemental_files` path as *Method 1*.
146+
147+
== Method 5: Copy `supplemental-ui` folder
109148

110-
For maximum control, copy the `supplemental-ui` folder directly into your project:
149+
For maximum control, copy the `supplemental-ui` folder into your project:
111150

112151
. Clone or download the repository
113152
. Copy the `supplemental-ui` folder to your project root:
@@ -128,7 +167,7 @@ ui:
128167
supplemental_files: ./supplemental-ui
129168
----
130169

131-
== Verify Installation
170+
== Verify installation
132171

133172
Build your site to verify the installation:
134173

@@ -140,6 +179,3 @@ antora antora-playbook.yml
140179
Open the generated site in a browser.
141180
You should see a sun/moon toggle button in the navbar.
142181
Click it to switch between light and dark modes.
143-
144-
145-

0 commit comments

Comments
 (0)