Skip to content
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

Fixes #14385: Update antora theme/tools to 2.0.0 #565

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions rudder-theme/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: node:8.11.1-alpine
image: node:10.14.2-alpine
stages: [setup, verify, deploy]
yarn:
stage: setup
Expand All @@ -24,7 +24,7 @@ bundle-stable:
cache: *pull_cache
script:
- *run_yarn
- node_modules/.bin/gulp pack
- node_modules/.bin/gulp bundle
artifacts:
paths:
- build/ui-bundle.zip
Expand All @@ -35,7 +35,7 @@ bundle-dev:
cache: *pull_cache
script:
- *run_yarn
- node_modules/.bin/gulp pack
- node_modules/.bin/gulp bundle
artifacts:
expire_in: 1 day # unless marked as keep from job page
paths:
Expand All @@ -47,7 +47,7 @@ pages:
cache: *pull_cache
script:
- *run_yarn
- node_modules/.bin/gulp build:preview
- node_modules/.bin/gulp preview:build
# FIXME figure out a way to avoid copying these files to preview site
- rm -rf public/_/{helpers,layouts,partials}
artifacts:
Expand Down
4 changes: 4 additions & 0 deletions rudder-theme/.gulp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"description": "Build tasks for the Antora default UI project",
"flags.tasksDepth": 1
}
2 changes: 1 addition & 1 deletion rudder-theme/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8
10
3 changes: 2 additions & 1 deletion rudder-theme/.stylelintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "stylelint-config-standard",
"rules": {
"comment-empty-line-before": null
"comment-empty-line-before": null,
"no-descending-specificity": null,
}
}
111 changes: 58 additions & 53 deletions rudder-theme/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
// Settings:
:experimental:
:hide-uri-scheme:
// Project URIs:
:uri-project: https://gitlab.com/antora/antora-ui-default
:uri-preview: https://antora.gitlab.io/antora-ui-default
:uri-ci-pipelines: {uri-project}/pipelines
:img-ci-status: {uri-project}/badges/master/pipeline.svg
// External URIs:
:uri-antora: https://antora.org
:uri-git: https://git-scm.com
:uri-git-dl: {uri-git}/downloads
:uri-gulp: http://gulpjs.com
:uri-opendevise: https://opendevise.com
:uri-node: https://nodejs.org
:uri-nvm: https://github.com/creationix/nvm
:uri-nvm-install: {uri-nvm}#installation
:uri-yarn: https://yarnpkg.com

image:{img-ci-status}[CI Status (GitLab CI), link={uri-ci-pipelines}]

This project is an archetype that demonstrates how to produce a UI bundle for use in a documentation site generated with {uri-antora}[Antora].
You can see a preview of the default UI at {uri-preview}.
// Project URLs:
:url-project: https://gitlab.com/antora/antora-ui-default
:url-preview: https://antora.gitlab.io/antora-ui-default
:url-ci-pipelines: {url-project}/pipelines
:img-ci-status: {url-project}/badges/master/pipeline.svg
// External URLs:
:url-antora: https://antora.org
:url-git: https://git-scm.com
:url-git-dl: {url-git}/downloads
:url-gulp: http://gulpjs.com
:url-opendevise: https://opendevise.com
:url-node: https://nodejs.org
:url-nvm: https://github.com/creationix/nvm
:url-nvm-install: {url-nvm}#installation
:url-yarn: https://yarnpkg.com

image:{img-ci-status}[CI Status (GitLab CI), link={url-ci-pipelines}]

This project is an archetype that demonstrates how to produce a UI bundle for use in a documentation site generated with {url-antora}[Antora].
You can see a preview of the default UI at {url-preview}.

== Use the Default UI

Expand All @@ -30,7 +30,9 @@ If you want to use the default UI for your Antora-generated site, add the follow
[source,yaml,subs=attributes+]
----
ui:
bundle: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable
bundle:
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable
snapshot: true
----

Read on to learn how to use your own build of the default UI.
Expand All @@ -44,44 +46,44 @@ A more comprehensive tutorial will be made available in the documentation.

To preview and bundle the default UI, you need the following software on your computer:

* {uri-git}[git] (command: `git`)
* {uri-node}[Node 8] (command: `node`)
* {uri-gulp}[Gulp CLI] (command: `gulp`)
* {uri-yarn}[Yarn] (command: `yarn`)
* {url-git}[git] (command: `git`)
* {url-node}[Node] (command: `node`)
* {url-gulp}[Gulp CLI] (command: `gulp`)
* {url-yarn}[Yarn] (command: `yarn`)

==== git

First, make sure you have git installed.

$ git --version

If not, {uri-git-dl}[download and install] the git package for your system.
If not, {url-git-dl}[download and install] the git package for your system.

==== Node 8
==== Node

Next, make sure that you have Node 8 installed.
Next, make sure that you have Node.js (herein "`Node`") installed.

$ node --version

If this command fails with an error, you don't have Node installed.
If the command doesn't report a Node 8 version (e.g., v8.9.4), you don't have a suitable version of Node installed.
If the command doesn't report a Node LTS version (e.g., v10.14.2), you don't have a suitable version of Node installed.

While you can install Node from the official packages, we strongly recommend that you use {uri-nvm}[nvm] (Node Version Manager) to install and manage Node.
Follow the {uri-nvm-install}[nvm installation instructions] to set up nvm on your machine.
While you can install Node from the official packages, we strongly recommend that you use {url-nvm}[nvm] (Node Version Manager) to install and manage Node.
Follow the {url-nvm-install}[nvm installation instructions] to set up nvm on your machine.

Once you've installed nvm, open a new terminal and install Node 8 using the following command:
Once you've installed nvm, open a new terminal and install Node 10 using the following command:

$ nvm install 8
$ nvm install 10

You can switch to this version of Node at any time using the following command:

$ nvm use 8
$ nvm use 10

To make Node 8 the default in new terminals, type:
To make Node 10 the default in new terminals, type:

$ nvm alias default 8
$ nvm alias default 10

Now that you have Node 8 installed, you can proceed with installing the Gulp CLI and Yarn.
Now that you have Node 10 installed, you can proceed with installing the Gulp CLI and Yarn.

==== Gulp CLI

Expand All @@ -107,7 +109,7 @@ Now that you have the prerequisites installed, you can fetch and build the defau
Clone the default UI project using git:

[subs=attributes+]
$ git clone {uri-project} &&
$ git clone {url-project} &&
cd "`basename $_`"

The example above clones Antora's default UI project and then switches to the project folder on your filesystem.
Expand All @@ -124,40 +126,43 @@ This folder does not get included in the UI bundle.
=== Preview the UI

The default UI project is configured to preview offline.
That's what the files in the [.path]_preview-site-src/_ folder are for.
That's what the files in the [.path]_preview-src/_ folder are for.
This folder contains HTML file fragments that provide a representative sample of content from the site.

To build the UI and preview it in a local web server, run the `preview` command:

$ gulp preview

You'll see two URLs listed in the output of this command:
You'll see a URL listed in the output of this command:

....
[BS] Access URLs:
----------------------------------
Local: http://localhost:5252
External: http://192.168.1.7:5252
----------------------------------
[BS] Serving files from: build
[BS] Watching files...
[12:59:28] Starting 'preview:serve'...
[12:59:28] Starting server...
[12:59:28] Server started http://localhost:5252
[12:59:28] Running server
....

Navigate to the first URL to see the preview site.
Navigate to that URL to view the preview site.

While this command is running, any changes you make to the source files will be instantly reflected in the browser.
This works by monitoring the project for changes, running the `build` task if a change is detected, and sending the updates to the browser.
This works by monitoring the project for changes, running the `preview:build` task if a change is detected, and sending the updates to the browser.

Press kbd:[Ctrl+C] to stop the preview server and end the continuous build.

=== Package for Use with Antora

If you need to package the UI in order to preview the UI on the real site in local development, run the following command:
If you need to bundle the UI in order to preview the UI on the real site in local development, run the following command:

$ gulp pack
$ gulp bundle

The UI bundle will be available at [.path]_build/ui-bundle.zip_.
You can then point Antora at this bundle using the `--ui-bundle` command-line option.
You can then point Antora at this bundle using the `--ui-bundle-url` command-line option.

If you have the preview running, and you want to bundle without causing the preview to be clobbered, use:

$ gulp bundle:pack

The UI bundle will again be available at [.path]_build/ui-bundle.zip_.

== Copyright and License

Expand All @@ -168,4 +173,4 @@ See link:LICENSE[] to find the full license text.

== Authors

Development of Antora is led and sponsored by {uri-opendevise}[OpenDevise Inc].
Development of Antora is led and sponsored by {url-opendevise}[OpenDevise Inc].
3 changes: 0 additions & 3 deletions rudder-theme/docs/modules/ROOT/pages/admonition-styles.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
= Admonition Styles
ifndef::env-site,env-github[]
include::_attributes.adoc[]
endif::[]

An xref:antora:asciidoc:admonitions.adoc[admonition], also known as a notice, helps draw attention to content with a special label or icon.

Expand Down
42 changes: 21 additions & 21 deletions rudder-theme/docs/modules/ROOT/pages/build-preview-ui.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
= Build a UI Project for Local Preview
ifndef::env-site,env-github[]
include::_attributes.adoc[]
endif::[]
// Settings:
:idprefix:
:idseparator: -
Expand All @@ -10,7 +7,7 @@ endif::[]
== Build Preview Site

Once you've modified the site UI, the first thing you'll want to do is check out how it looks.
That's what the files in the [.path]_preview-site-src/_ folder are for.
That's what the files in the [.path]_preview-src/_ folder are for.
This folder contains HTML file fragments that provide a representative sample of content from the site.
The preview saves you from having to generate the whole site just to test the UI.
These files should give you an idea of how the UI will look when applied to the actual site.
Expand All @@ -24,47 +21,50 @@ The next two sections explain how to use these modes.

=== Build Once

To build the UI once for preview, then stop, execute the `build-preview` task using the following command:
To build the UI once for preview, then stop, execute the following command:

$ gulp build:preview
$ gulp preview:build

This task pre-compiles the UI files into the [.path]_public_ directory.
To view the preview pages, navigate to the HTML pages in the [.path]_public_ directory using your browser (e.g., [.path]_public/index.html_).

=== Build Continuously

To avoid the need to run the `build-preview` task over and over, you can use the `preview` command instead to have it run continuously.
To avoid the need to run the `preview:build` task over and over while developing, you can use the `preview` command instead to have it run continuously.
This task also launches a local HTTP server so updates get synchronized with the browser (i.e., "`live reload`").

To launch the preview server, execute the following command:

$ gulp preview

You'll see two URLs listed in the output of this command:
You'll see a URL listed in the output of this command:

....
[BS] Access URLs:
----------------------------------
Local: http://localhost:5252
External: http://192.168.1.7:5252
----------------------------------
[BS] Serving files from: build
[BS] Watching files...
[12:59:28] Starting 'preview:serve'...
[12:59:28] Starting server...
[12:59:28] Server started http://localhost:5252
[12:59:28] Running server
....

Navigate to the first one to see the preview site.
Navigate to the URL to view the preview site.
While this command is running, any changes you make to the source files will be instantly reflected in the browser.
This works by monitoring the project for changes, running the `build` task if a change is detected, and sending the updates to the browser.
This works by monitoring the project for changes, running the `preview:build` task if a change is detected, and sending the updates to the browser.

Press kbd:[Ctrl+C] to stop the preview server and end the continuous build.

== Package for Previewing

If you need to package the UI in order to preview the UI on the real site in local development, run the following command:
If you need to bundle the UI in order to preview the UI on the real site in local development, run the following command:

$ gulp pack
$ gulp bundle

The `pack` command also invokes the `lint` command to check that the CSS and JavaScript follow the coding standards.
The `bundle` command also invokes the `lint` command to check that the CSS and JavaScript follow the coding standards.

The UI bundle will be available at [.path]_build/ui-bundle.zip_.
You can then point Antora at this bundle using the `--ui-bundle` command-line option.
You can then point Antora at this bundle using the `--ui-bundle-url` command-line option.

If you have the preview running, and you want to bundle without causing the preview to be clobbered, use:

$ gulp bundle:pack

The UI bundle will again be available at [.path]_build/ui-bundle.zip_.
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
= UI Development Workflow
ifndef::env-site,env-github[]
include::_attributes.adoc[]
endif::[]
// Settings:
:idprefix:
:idseparator: -
Expand Down
19 changes: 6 additions & 13 deletions rudder-theme/docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Handlebars (file extension: `.hbs`)::
Templates contain placeholders (i.e., mustache expressions like `+{{{page.title}}}+`) into which content is injected from a model.
They also accommodate simple logic expressions for repeating content or including it conditionally (e.g., `+{{#each navigation}}+`) as well as partials (e.g., `+{{> header}}+`).

Gulp (script file: [.path]_gulpfile.js_)::
Gulp (script file: [.path]_gulpfile.js/index.js_)::
{uri-gulp}[Gulp] is a build tool for JavaScript projects.
It configures a collection of tasks that can be used to perform automated tasks such as compiling files, running a preview server, or publishing a release.

Expand Down Expand Up @@ -91,7 +91,10 @@ Here's how the files are structured in the UI project:
[.output]
....
README.adoc
gulpfile.js
gulpfile.js/
index.js
lib/
tasks/
package.json
yarn.lock
src/
Expand Down Expand Up @@ -120,19 +123,9 @@ src/
...
vendor/
highlight.js
preview-site-src/
preview-src/
index.html
ui-model.yml
tasks/
lib/
gulp-prettier-eslint.js
build.js
build-preview.js
format.js
lint-css.js
lint-js.js
pack.js
preview.js
....

A Gulp build is used to compile and assemble the UI project files into a UI bundle.
Expand Down
3 changes: 0 additions & 3 deletions rudder-theme/docs/modules/ROOT/pages/inline-text-styles.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
= Inline Text Styles
ifndef::env-site,env-github[]
include::_attributes.adoc[]
endif::[]
:example-caption!:

////
Expand Down
Loading