You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: The `snapshot` flag tells Antora to fetch the UI when the `--fetch` command-line flag is present.
43
-
This setting is required because updates to the UI bundle are pushed to the same URL.
44
-
If the URL were to be unique, this setting would not be required.
45
-
46
-
Read on to learn how to customize the default UI for your own documentation.
53
+
Read on to learn how to develop the UI.
47
54
48
55
== Development Quickstart
49
56
50
-
This section offers a basic tutorial to teach you how to set up the default UI project, preview it locally, and bundle it for use with Antora.
57
+
This section offers a basic tutorial to teach you how to set up the UI project, preview it locally, and bundle it for use with Antora.
51
58
A more comprehensive tutorial can be found in the documentation at {url-antora-docs}.
52
59
53
60
=== Prerequisites
54
61
55
-
To preview and bundle the default UI, you need the following software on your computer:
62
+
To preview and bundle the UI, you need the following software on your computer:
56
63
57
64
* {url-git}[git] (command: `git`)
58
65
* {url-nodejs}[Node.js] (commands: `node` and `npm`)
@@ -118,13 +125,13 @@ Now that you have the prerequisites installed, you can fetch and build the UI pr
118
125
119
126
=== Clone and Initialize the UI Project
120
127
121
-
Clone the default UI project using git:
128
+
Clone the UI project using git:
122
129
123
130
[subs=attributes+]
124
131
$ git clone {url-project} &&
125
132
cd "`basename $_`"
126
133
127
-
The example above clones Antora's default UI project and then switches to the project folder on your filesystem.
134
+
The example above clones the UI project and then switches to the project folder on your filesystem.
128
135
Stay in this project folder when executing all subsequent commands.
129
136
130
137
Use npm to install the project's dependencies inside the project.
@@ -135,17 +142,10 @@ In your terminal, execute the following command:
135
142
This command installs the dependencies listed in [.path]_package.json_ into the [.path]_node_modules/_ folder inside the project.
136
143
This folder does not get included in the UI bundle and should _not_ be committed to the source control repository.
137
144
138
-
[TIP]
139
-
====
140
-
If you prefer to install packages using Yarn, run this command instead:
141
-
142
-
$ yarn
143
-
====
144
-
145
145
=== Preview the UI
146
146
147
-
The default UI project is configured to preview offline.
148
-
The files in the [.path]_preview-src/_ folder provide the sample content that allow you to see the UI in action.
147
+
The UI project is configured to preview offline.
148
+
The files in the [.path]_preview-site-src/_ folder provide the sample content that allow you to see the UI in action.
149
149
In this folder, you'll primarily find pages written in AsciiDoc.
150
150
These pages provide a representative sample and kitchen sink of content from the real site.
151
151
@@ -200,14 +200,90 @@ If you need to include source maps in the bundle, you can do so by setting the `
200
200
$ SOURCEMAPS=true gulp bundle
201
201
202
202
In this case, the bundle will include the source maps, which can be used for debuggging your production site.
203
+
=== Create an Online Preview
204
+
205
+
You can share a preview of the UI online by submitting a pull request to GitHub.
206
+
The repository is configured to create a deploy preview on Netlify for every pull request.
207
+
Here's how that process works:
208
+
209
+
. Fork the repository on GitHub (only has to be done once).
210
+
. Create a local branch.
211
+
. Make changes to the UI.
212
+
. Commit your changes to that branch.
213
+
. Push that branch to your fork (on GitHub).
214
+
. Submit a pull request from the branch you pushed to your fork.
215
+
. Wait for deploy/netlify check to say "`Deploy preview ready!`" on the pull request page.
216
+
. Click on the "`Details`" link under "`Show all checks`" on the pull request page to get the preview URL.
217
+
. Visit the preview URL to view your changes or share the preview URL with others.
218
+
219
+
The deploy preview works because there is a webhook on the repository that pings \https://api.netlify.com/hooks/github for the following events: push, pull_request, delete_branch.
220
+
Netlify then runs the command specified in netlify.toml, deploys the site, and allocates a temporary preview URL for it.
221
+
222
+
Included in that temporary preview URL is the UI bundle itself.
223
+
That means you can test it directly with Antora.
224
+
Simply append `dist/ui-bundle.zip` to the end of the preview URL and pass it to Antora as follows:
The temporary preview URL will automatically be decommissioned once the PR is closed.
229
+
230
+
== Releases
231
+
232
+
Releases are handled by the `gulp release` task, which is automated by a CI job.
233
+
The release process boils down to the following steps:
234
+
235
+
. Pack the UI bundle.
236
+
. Tag the git repository using the next version number in the sequence (e.g., v100 after v99)
237
+
. Create a GitHub release from that git tag.
238
+
. Attach the UI bundle to that release as an asset in zip format.
239
+
. Update the README to reference the URL of the lastest bundle and commit that update to the repository.
240
+
241
+
Fortunately, you don't have to do any of these steps yourself.
242
+
These steps are fully automated by the `gulp release` task.
243
+
In fact, you don't even have to run this task.
244
+
Whenever a commit is pushed to the master branch of the repository, it triggers the CI job on master, which executes the `gulp release` task using pre-configured credentials.
245
+
246
+
IMPORTANT: A release will only be made if the project validates (i.e., all lint tasks pass).
247
+
To validate the project, run `gulp lint` before pushing your changes to GitHub.
248
+
249
+
The CI job is already configured, so there's nothing you need to do to make automated release work.
250
+
All you have to do is commit your changes and push those commits to the master branch of the git repository.
251
+
A few seconds later, a new bundle will be available for use with Antora.
252
+
Run `git pull` to retrieve the updated README that includes the new URL.
253
+
254
+
If you want to commit a change to master without making a release, add the string `[skip ci]` to the end of the commit message.
255
+
256
+
The next two sections document how the CI job is set up an configured.
257
+
258
+
=== Release Task Prerequisites
259
+
260
+
In addition to the <<Prerequisites>> covered above, you'll need a personal access token for the automated GitHub account, asciidoctor-docbot, so it has permission to make changes to the repository on GitHub.
261
+
The asciidoctor-docbot account will need at least write access to the {url-project} repository, though admin access is recommended.
262
+
263
+
Start by creating a https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/[personal access token] for the asciidoctor-docbot user.
264
+
The `release` task relies on this token to interact with the GitHub API to create the tag, create the release, and attach the UI bundle.
265
+
The token must have the `public_repo` scope.
266
+
No other scopes are required (as long as the asciidoctor-docbot user has write access to the repository).
267
+
268
+
=== CI Job
269
+
270
+
The {url-ci}[CI job] is executed by GitHub Actions and is defined in the file [.path]_.github/workflows/release.yml_.
271
+
It boils down to running the `gulp release` task on the main branch.
272
+
The GITHUB_API_TOKEN environment variable is defined in the job configuration.
273
+
274
+
Once the CI job runs and a new UI bundle is available, you can update the URL of the UI bundle in the Antora playbook file.
275
+
See <<Usage>> for details.
203
276
204
277
== Copyright and License
205
278
206
-
Copyright (C) 2017-2019 OpenDevise Inc. and the Antora Project.
279
+
=== Software
207
280
208
-
Use of this software is granted under the terms of the https://www.mozilla.org/en-US/MPL/2.0/[Mozilla Public License Version 2.0] (MPL-2.0).
281
+
The software assets in this repository (Gulp build script and tasks, web JavaScript files, Handlebars templates and JavaScript helpers, common CSS, utility icons, etc.) are part of the {url-antora}[Antora project].
282
+
As such, use of the software is granted under the terms of the https://www.mozilla.org/en-US/MPL/2.0/[Mozilla Public License Version 2.0] (MPL-2.0).
209
283
See link:LICENSE[] to find the full license text.
210
284
211
-
== Authors
285
+
=== Branding and Design
212
286
213
-
Development of Antora is led and sponsored by {url-opendevise}[OpenDevise Inc].
0 commit comments