diff --git a/docs/antora.yml b/docs/antora.yml deleted file mode 100644 index 1807fb28..00000000 --- a/docs/antora.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: antora-ui-default -title: Antora Default UI -version: master -nav: -- modules/ROOT/nav.adoc diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc deleted file mode 100644 index e549a14c..00000000 --- a/docs/modules/ROOT/nav.adoc +++ /dev/null @@ -1,13 +0,0 @@ -* xref:prerequisites.adoc[UI Development Prerequisites] -* xref:set-up-project.adoc[Set up a UI Project] -* xref:build-preview-ui.adoc[Build and Preview the UI] -* xref:development-workflow.adoc[UI Development Workflow] -* xref:templates.adoc[Work with the Handlebars Templates] -* xref:stylesheets.adoc[Work with the CSS Stylesheets] - ** xref:add-fonts.adoc[Add Fonts] -* xref:style-guide.adoc[UI Element Styles] -** xref:inline-text-styles.adoc[Inline Text] -** xref:admonition-styles.adoc[Admonitions] -** xref:list-styles.adoc[Lists] -** xref:sidebar-styles.adoc[Sidebars] -** xref:ui-macro-styles.adoc[UI Macros] diff --git a/docs/modules/ROOT/pages/add-fonts.adoc b/docs/modules/ROOT/pages/add-fonts.adoc deleted file mode 100644 index e4d28484..00000000 --- a/docs/modules/ROOT/pages/add-fonts.adoc +++ /dev/null @@ -1,123 +0,0 @@ -= Add Fonts - -This page explains how to add new fonts to your UI. -These instructions assume you've forked the default UI and are able to customize it. - -There are three steps involved: - -. Add the font to your UI project -. Add a font-face declaration to your stylesheet -. Use the new font in your stylesheet - -How you reference the font file in the font-face declaration depends on how you decide to manage it. -You can manage the font with npm or download it manually and add it directly to your UI project. -The following sections describe each approach in turn. - -== npm managed - -You can use npm (or Yarn) to manage the font. -This approach saves you from having to store the font file directly in your UI project. -Here are the steps involved. - -. Use npm (or Yarn) to install the font files from a package (e.g., https://www.npmjs.com/package/typeface-open-sans[typeface-open-sans]) - - $ npm install --save typeface-open-sans - -. In [.path]_src/css_, add a corresponding CSS file (e.g., [.path]_typeface-open-sans.css_) -. In that file, declare the font face: -+ -[source,css] ----- -@font-face { - font-family: "Open Sans"; - font-style: normal; - font-weight: 400; - src: - local("Open Sans"), - local("Open Sans-Regular"), - url(~typeface-open-sans/files/open-sans-latin-400.woff) format("woff") -} ----- -+ -The Gulp build recognizes the `~` URL prefix and copies the font from the npm package to the build folder (and hence bundle). -+ -You must define one @font-face for each font weight and style combination (e.g., `font-weight: 500` + `font-style: italic`) from the font that you want to use in your stylesheet. - -. Import the typeface CSS file you just created into the main stylesheet, [.path]_src/css/site.css_ (adjacent to the other typeface imports): -+ -[source,css] ----- -@import "typeface-open-sans.css"; ----- - -. Repeat the previous steps for each font style and weight you want to use from that package. -. Change the CSS to use your newly imported font: -+ -[source,css] ----- -html { - font-family: "Open Sans", sans; -} ----- -+ -TIP: If you're building on the default UI, you may instead want to define or update the font family using a variable defined in [.path]_src/css/vars.css_. - -. Test the new font by previewing your UI: - - $ gulp preview - -If you see the new font, you've now successfully added it to your UI. -If you aren't sure, look for the https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Edit_fonts[All fonts on page] section in your browser's developer tools to see whether the font was loaded. - -== Manual - -A simpler approach to adding fonts is to store them directly in your project. -Here are the steps involved. - -. Download the font files and add them to the [.path]_src/font_ folder. -Create this folder if it does not exist. -. In [.path]_src/css_, add a corresponding CSS file (e.g., [.path]_typeface-open-sans.css_) -. In that file, declare the font face: -+ -[source,css] ----- -@font-face { - font-family: "Open Sans"; - font-style: normal; - font-weight: 400; - src: - local("Open Sans"), - local("Open Sans-Regular"), - url(../font/open-sans-latin-400.woff) format("woff") -} ----- -+ -Note that the path is a relative path starting from the [.path]_src/css_ folder to the [.path]_src/font_ folder. -+ -You must define one @font-face for each font weight and style combination (e.g., `font-weight: 500` + `font-style: italic`) from the font that you want to use in your stylesheet. - -. Import the typeface CSS file you just created into the main stylesheet, [.path]_src/css/site.css_ (adjacent to the other typeface imports): -+ -[source,css] ----- -@import "typeface-open-sans.css"; ----- - -. Repeat the previous steps for each font style and weight you want to use. -. Change the CSS to use your newly imported font: -+ -[source,css] ----- -html { - font-family: "Open Sans", sans; -} ----- -+ -TIP: If you're building on the default UI, you may instead want to define or update the font family using a variable defined in [.path]_src/css/vars.css_. - -. Test the new font by previewing your UI: - - $ gulp preview - -If you see the new font, you've now successfully added it to your UI. -If you aren't sure, look for the https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Edit_fonts[All fonts on page] section in your browser's developer tools to see whether the font was loaded. diff --git a/docs/modules/ROOT/pages/admonition-styles.adoc b/docs/modules/ROOT/pages/admonition-styles.adoc deleted file mode 100644 index 292203fd..00000000 --- a/docs/modules/ROOT/pages/admonition-styles.adoc +++ /dev/null @@ -1,38 +0,0 @@ -= Admonition Styles - -An xref:antora:asciidoc:admonitions.adoc[admonition], also known as a notice, helps draw attention to content with a special label or icon. - -== Admonition blocks - -An admonition block is a table. -The table title element is specified by the block class: tip, note, important, warning, or caution. -Here's an AsciiDoc source example that produces an admonition with the table title warning: - -[source,asciidoc] ----- -WARNING: Watch out! ----- - -If font-based icons are enabled (`icons=font`), the table title text is replaced by the associated icon. - -[source,html] ----- -
- - - - - -
- - -
-

Watch out!

-
-
-
----- - -Here's how it might appear when the title is displayed as text: - -WARNING: Watch out! diff --git a/docs/modules/ROOT/pages/build-preview-ui.adoc b/docs/modules/ROOT/pages/build-preview-ui.adoc deleted file mode 100644 index 36251a38..00000000 --- a/docs/modules/ROOT/pages/build-preview-ui.adoc +++ /dev/null @@ -1,66 +0,0 @@ -= Build a UI Project for Local Preview - -== 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-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. - -The pages in the preview site are assembled using the Handlebars templates and link to the pre-compiled asset files (emulating the behavior of the site generator). -Thus, to look at them, you need to run them through the UI build. - -There are two preview modes available. -You can run the build once and examine the result or you can run the build continuously so you can see changes as you make them. -The next two sections explain how to use these modes. - -=== Build Once - -To build the UI once for preview, then stop, execute the following command: - - $ 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 `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 a URL listed in the output of this command: - -.... -[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 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 `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 bundle the UI in order to preview the UI on the real site in local development, run the following command: - - $ gulp bundle - -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-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_. diff --git a/docs/modules/ROOT/pages/development-workflow.adoc b/docs/modules/ROOT/pages/development-workflow.adoc deleted file mode 100644 index 4eb57c28..00000000 --- a/docs/modules/ROOT/pages/development-workflow.adoc +++ /dev/null @@ -1,31 +0,0 @@ -= UI Development Workflow - -// This section provides information about some of the UI files you'll be modifying and how to prepare and submit those changes. - -All changes pushed to a UI project's master branch can trigger a new release (not described here). -Therefore, you want to make your changes to a development branch and submit it as a pull request (PR) to be approved. -(Even better would be to issue the PR from a fork). -Only when the PR is approved and merged will the new release be triggered. - -== git steps - -Use the following command to create a local development branch named `name-me`: - - $ git checkout -b name-me -t origin/master - -You'll then apply your changes to the UI files. -Once you're done making changes, commit those changes to the local branch: - - $ git commit -a -m "describe your change" - -Then, push your branch to the remote repository: - - $ git push origin name-me - -Finally, navigate to your UI project in your browser and create a new pull request from this branch. - -The maintainer of the UI should review the changes. -If the changes are acceptable, the maintainer will merge the pull request. -As soon as the pull request is merged into master, an automated process will take over to publish a new release for the site generator to use. - -Now that you've got the process down, let's review some of the files you'll be working with in more detail. diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc deleted file mode 100644 index f78022eb..00000000 --- a/docs/modules/ROOT/pages/index.adoc +++ /dev/null @@ -1,188 +0,0 @@ -= Antora Default UI -// Settings: -:hide-uri-scheme: -// URLs: -:url-antora: https://antora.org -:url-repo: https://gitlab.com/antora/antora-ui-default -:url-preview: https://antora.gitlab.io/antora-ui-default -:url-hbs: https://handlebarsjs.com -:url-gulp: https://gulpjs.com -:url-npm: https://npmjs.com -:url-node: https://nodejs.org -:url-nvm: https://github.com/creationix/nvm -:url-nvm-install: {url-nvm}#installation -:url-git: https://git-scm.com -:url-git-dl: {url-git}/downloads - -This project produces the {url-preview}[default UI bundle] for documentation sites generated with {url-antora}[Antora]. -It contains the UI assets (page templates, CSS, JavaScript, images, etc.) and a Gulp build script. -The build can be used to preview the UI locally (featuring live updates), or to package it for consumption by the Antora site generator. - -This documentation explains how to use this project to set up, customize and manage a UI for a documentation site generated with Antora. -After reading it, you'll be able to: - -* [x] Understand how an Antora UI project is structured. -* [x] Set up your environment to work on the UI project. -* [x] Launch a preview server to visually inspect the UI. -* [x] Adopt a development workflow to share and accept changes to the UI. -* [x] Package a UI for your documentation site that Antora can use. - -== File type and technology overview - -The Antora UI consists of the following file types that are used to structure and style the documentation site pages generated by Antora. - -* Handlebars "`page`" templates (layouts, partials, and helpers) -* CSS (enhanced using PostCSS) -* JavaScript (UI scripts) -* Images / Graphics (specific to the UI) -* Fonts -* Sample content for previewing the UI (HTML and UI model) - -To understand how the UI works, let's begin by surveying the primary technologies used by the UI. - -Handlebars (file extension: `.hbs`):: -{url-hbs}[Handlebars] is a "`logic-less`" templating engine used to create HTML from template files. -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/index.js_):: -{url-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. - -npm (command: `npm`):: -npm manages software packages (i.e., software dependencies) that it downloads from {url-npm}. -Software this project uses includes libraries that handle compilation as well as shared assets such as font files that are distributed as npm packages. -npm is part of Node.js. - -package.json::: -This file keeps track of the dependencies (described using fuzzy versions) that npm (or Yarn) should fetch. - -package-lock.json::: -This file contains a report of which dependencies npm resolved. -This information ensures that dependency resolution is reproducible. - -node_modules/::: -A local cache of resolved dependencies that npm (or Yarn) fetches. - -PostCSS:: -This project does not use a CSS preprocessor such as Sass or LESS. -Instead, it relies on normal CSS which is enhanced by a series of postprocessors. -The most common postprocessor backports newer CSS features to older browsers by adding properties with vendor prefixes. - -== UI project versus UI bundle - -The [.term]*UI project*, the master branch of a git repository, contains the recipe and raw materials for creating an Antora UI bundle. -It includes a build, source files, project files, and dependency information. -This is your development workspace. - -The [.term]*UI bundle*, a distributable archive, provides pre-compiled (interpreted, consolidated, and/or minimized) files that are ready to be used by Antora. - -=== UI project repository structure (master branch) - -You should think of the UI project's master branch as your UI workspace. -It contains the recipe and raw materials for creating a UI, including a build, source files, project files, and dependency information. - -Here's how the files are structured in the UI project: - -[.output] -.... -README.adoc -gulpfile.js/ - index.js - lib/ - tasks/ -package.json -package-lock.json -src/ - css/ - base.css - breadcrumbs.css - ... - helpers/ - and.js - eq.js - ... - img/ - back.svg - caret.svg - ... - layouts/ - default.hbs - 404.hbs - partials/ - article.hbs - breadcrumbs.hbs - ... - js/ - 01-navigation.js - 02-fragment-jumper.js - ... - vendor/ - highlight.js -preview-src/ - index.html - ui-model.yml -.... - -A Gulp build is used to compile and assemble the UI project files into a UI bundle. - -=== UI bundle structure (releases) - -The UI bundle--a distributable archive--provides files which are ready to be used by Antora. - -When the UI project files are built by Gulp, they are assembled under the [.path]_public_ directory. -Since the [.path]_public_ directory is generated, it's safe to remove. - -The contents of the UI bundle resembles the UI project's master branch contents, except the bundle doesn't contain any files other than the ones that make up the UI. -This is the content that is used by Antora. - -[.output] -.... -css/ - site.css -font/ - ... -helpers/ - and.js - eq.js - ... -img/ - back.svg - caret.svg - ... -layouts/ - default.hbs - 404.hbs -partials/ - article.hbs - breadcrumbs.hbs - ... -js/ - site.js - vendor/ - highlight.js -.... - -Some of these files have been compiled or aggregated, such as the stylesheets and JavaScript. -The benefit of building the UI files is that the files can be optimized for static inclusion in the site without that optimization getting in the way of UI development. -For example, the UI build can optimize SVGs or add vendor prefixes to the CSS. -Since these optimizations are only applied to the pre-compiled files, they don't interfere with the web developer's workflow. - -== UI compilation and generator consumption overview - -The purpose of an Antora UI project is to get the UI files into a state that Antora can use and to make it reusable. - -The UI is served statically in a production site, but the UI's assets live in a source form in a UI project to accommodate development and simplify maintenance. -When handed off to the Antora pipeline, the UI is in an interim, pre-compiled state. -Specifically, the master branch of the git repository contains the files in source form while releases are used to distribute the files in pre-compiled form. - -The responsibility of compiling the UI is shared between a UI project and Antora. -The UI project uses a local build to pre-compile (i.e., interpret, consolidate, and/or minimize) the files. -The pre-compiled files are agnostic to Antora's content model, relieving the generator from having to deal with this part. -It also allows the UI to be reused. - -The UI project build then packages the UI into a bundle, which the UI Loader in Antora consumes. -Antora grabs the bundle, extracts it into a UI catalog, and takes compilation to completion by weaving the Antora's content model into the Handlebars templates to make the pages and auxiliary data files. -Antora then copies the remaining UI assets to the site output. - -Now that you have an overview of the files that make up the UI and how it gets assembled, let's go over how to set up the project, build the UI, and preview it. diff --git a/docs/modules/ROOT/pages/inline-text-styles.adoc b/docs/modules/ROOT/pages/inline-text-styles.adoc deleted file mode 100644 index 653b3454..00000000 --- a/docs/modules/ROOT/pages/inline-text-styles.adoc +++ /dev/null @@ -1,85 +0,0 @@ -= Inline Text Styles -:example-caption!: - -//// -When creating a UI theme for Antora, there are certain elements in the UI that require support from the CSS to work correctly. -This list includes elements in the shell (i.e., frame) and in the document content. -This document identifies these UI elements. -//// - -This page describes how to style text in the contents of the page which is visually emphasized. - -[#bold] -== Bold text () - -How xref:antora:asciidoc:bold.adoc[text marked as bold] appears on your site depends on the fonts loaded by the UI and the CSS styles the UI applies to the `` HTML tag. - -[source,html] ----- -A bold word, or a bold phrase of text. ----- - -Since `` is a semantic HTML element, it automatically inherits default styling (`font-weight: bold`) from the browser. -If you want to override the browser styles, you'll need to define properties on the `strong` selector in the stylesheet for your UI. - -In the default UI, the `` element is styled in the 500 font weight of the current typeface (Roboto). -For example: - -[example] -A bold *word*, or a bold *phrase of text*. - -[#italic] -== Italic text () - -How xref:antora:asciidoc:italic.adoc[italicized text] appears on your site depends on the fonts loaded by the UI and the CSS styles the UI applies to the `` HTML tag. - -[source,html] ----- -An italic word, or an italic phrase of text. ----- - -Since `` is a semantic HTML element, it automatically inherits default styling (`font-style: italic`) from the browser. -If you want to override the browser styles, you'll need to define properties on the `em` selector in the stylesheet for your UI. - -In the default UI, the `em` element is styled in the italic font variant of the current typeface (Roboto). -For example: - -[example] -An italic _word_, or an italic _phrase of text_. - -[#monospace] -== Monospace text () - -How xref:antora:asciidoc:monospace.adoc[inline monospace text] is displayed depends on the fixed-width font loaded by your UI and the CSS styles it applies to the `` HTML tag. - -[source,html] ----- -A monospace word, or a monospace phrase of text. ----- - -Since `` is a semantic HTML element, it automatically inherits default styling (`font-family: monospace`) from the browser. -If you want to override the browser styles, you'll need to define properties on the `code` selector in the stylesheet for your UI. - -In the default UI, the `code` element is styled using the fixed-width font loaded by the stylesheet (Roboto Mono). -For example: - -[example] -A monospace `word`, or a monospace `phrase of text`. - -[#highlight] -== Highlighted text () - -How xref:antora:asciidoc:highlight.adoc[highlighted (or marked) text] appears on your site depends on the CSS styles the UI applies to the `` HTML tag. - -[source,html] ----- -Let’s add some highlight to it. ----- - -Since `` is a semantic HTML element, it automatically inherits default styling (`background-color: yellow`) from the browser. -Here's an example: - -[example] -Let's add some #highlight# to it. - -If you want to override the browser styles, you'll need to define properties on the `mark` selector in the stylesheet for your UI. diff --git a/docs/modules/ROOT/pages/list-styles.adoc b/docs/modules/ROOT/pages/list-styles.adoc deleted file mode 100644 index 5fff9c79..00000000 --- a/docs/modules/ROOT/pages/list-styles.adoc +++ /dev/null @@ -1,80 +0,0 @@ -= List Styles - -== Ordered list numeration - -The browser automatically numbers xref:antora:asciidoc:ordered-and-unordered-lists.adoc[ordered lists] and selects a numeration style by list depth in the following order: decimal, lower-alpha, lower-roman, upper-alpha, upper-roman. - -AsciiDoc allows the author to override the numeration style for an ordered list. -Here's an example of that output: - -[source,html] ----- -
-
    -
  1. a

  2. -
  3. b

  4. -
  5. c

  6. -
-
----- - -In order to support this customization, you must assign the list-style-type property to the following classes on the `
    ` element in your stylesheet. - -|=== -|
      class |list-style-type property value - -|arabic -|decimal - -|decimal -|decimal-leading-zero - -|loweralpha -|lower-alpha - -|lowergreek -|lower-greek - -|lowerroman -|lower-roman - -|upperalpha -|upper-alpha - -|upperroman -|upper-roman -|=== - -== Checklist - -A xref:antora:asciidoc:checklists.adoc[checklist] is an unordered list with items that are prefixed with a checkbox marker (checked or unchecked). -Here's an AsciiDoc source example that produces a checklist: - -[source,asciidoc] ----- -* [ ] todo -* [x] done! ----- - -If font-based icons are enabled (`icons=font`), the checkbox gets inserted as the first element of the paragraph element that contains the list item text. - -[source,html] ----- -
      -
        -
      • -

        todo

        -
      • -
      • -

        done!

        -
      • -
      -
      ----- - -The recommended approach is to hide the list markers (`list-style: none`), then add a checkbox glyph on the icon element using either a background image or a `before` pseudo element. - -Here's how it might appear: - -* [ ] todo -* [*] done! diff --git a/docs/modules/ROOT/pages/prerequisites.adoc b/docs/modules/ROOT/pages/prerequisites.adoc deleted file mode 100644 index 0b6571bd..00000000 --- a/docs/modules/ROOT/pages/prerequisites.adoc +++ /dev/null @@ -1,56 +0,0 @@ -= UI Development Prerequisites -// URLs: -:url-nvm: https://github.com/creationix/nvm -:url-node: https://nodejs.org -:url-gulp: http://gulpjs.com -:url-git: https://git-scm.com -:url-git-dl: {url-git}/downloads -:url-node-releases: https://nodejs.org/en/about/releases/ -// These prerequisite instructions are less detailed than Antora's prerequisite instructions, I don't know if this is a concern or not. - -An Antora UI project is based on tools built atop Node.js, namely: - -* {url-node}[Node.js] (commands: `node` and `npm`) - ** {url-nvm}[nvm] (optional, but strongly recommended) -* {url-gulp}[Gulp CLI] (command: `gulp`) - -You also need {url-git}[git] (command: `git`) to pull down the project and push updates to it. - -== git - -First, make sure you have git installed. - - $ git --version - -If not, {url-git-dl}[download and install] the git package for your system. - -== Node.js - -You need Node.js installed on your machine to use Antora, including the default UI. -Antora follows the Node.js release schedule, so we advise that you choose an active long term support (LTS) release of Node.js. -We recommend using the latest active Node.js LTS version. -While you can use other versions of Node.js, Antora is only tested against LTS releases. - -To check whether you have Node.js installed, and which version, open a terminal and type: - - $ node --version - -You should see a version string, such as: - - v10.15.3 - -If the command fails with an error, it means you don't have Node.js installed. -The best way to install Node.js is to use nvm (Node Version Manager). -Refer to xref:antora:install:linux-requirements.adoc#install-nvm[Install nvm and Node.js (Linux)], xref:antora:install:macos-requirements.adoc#install-nvm[Install nvm and Node.js (macOS)], or xref:antora:install:windows-requirements.adoc#install-nvm[Install nvm and Node.js (Windows)] for instructions. - -Once you have Node.js installed, you can proceed with installing the Gulp CLI. - -== Gulp CLI - -Next, you'll need the Gulp CLI (aka wrapper). -This package provides the `gulp` command which executes the version of Gulp declared by the project. -You should install the Gulp CLI globally (which resolves to a location in your user directory if you're using nvm) using the following command: - - $ npm install -g gulp-cli - -Now that you have Node.js and Gulp installed, you're ready to set up the project. diff --git a/docs/modules/ROOT/pages/set-up-project.adoc b/docs/modules/ROOT/pages/set-up-project.adoc deleted file mode 100644 index 9dad8aa5..00000000 --- a/docs/modules/ROOT/pages/set-up-project.adoc +++ /dev/null @@ -1,60 +0,0 @@ -= Set up a UI Project -:url-project: https://gitlab.com/antora/antora-ui-default.git - -Before you can start working on the UI, you need to grab the sources and initialize the project. -The sources can be {url-project}[Antora's default UI] or an existing UI project structured to work with Antora. - -== Fetch the Default UI project - -To start, clone the default UI project using git: - -[subs=attributes+] - $ git clone {url-project} && - cd "`basename ${_%.git}`" - -The example above clones Antora's default UI project and then switches to the project folder on your filesystem. -Stay in this project folder in order to initialize the project using npm. - -== Install dependencies - -Next, you'll need to initialize the project. -Initializing the project essentially means downloading and installing the dependencies into the project. -That's the job of npm. - -In your terminal, execute the following command (while inside the project folder): - - $ npm install - -This command installs the dependencies listed in [.path]_package.json_ into the [.path]_node_modules/_ folder inside the project. -This folder does not get included in the UI bundle. -The folder is safe to delete, though npm does a great job of managing it. - -You'll notice another file which seems to be relevant here, [.path]_package-lock.json_. -npm uses this file to determine which concrete version of a dependency to use, since versions in [.path]_package.json_ are typically just a range. -The information in this file makes the build reproducible across different machines and runs. - -If a new dependency must be resolved that isn't yet listed in [.path]_package-lock.json_, npm will update this file with the new information when you run `npm install`. -Therefore, you're advised to commit the [.path]_package-lock.json_ file into the repository whenever it changes. - -== Supported build tasks - -Now that the dependencies are installed, you should be able to run the `gulp` command to find out what tasks the build supports: - - $ gulp --tasks-simple - -You should see: - -[.output] -.... -default -clean -lint -format -build -bundle -bundle:pack -preview -preview:build -.... - -We'll explain what each of these tasks are for and when to use them. diff --git a/docs/modules/ROOT/pages/sidebar-styles.adoc b/docs/modules/ROOT/pages/sidebar-styles.adoc deleted file mode 100644 index 9ce0ca64..00000000 --- a/docs/modules/ROOT/pages/sidebar-styles.adoc +++ /dev/null @@ -1,29 +0,0 @@ -= Sidebar Styles - -This page describes the in-page sidebar block styles, not the styles for the navigation sidebar. - -== Sidebar blocks - -xref:antora:asciidoc:sidebar.adoc[Sidebars] can contain any type of content. -The sidebar title is specified by the block class title. -Here's an AsciiDoc source example that produces a sidebar with a title: - -[source,asciidoc] ----- -.Optional Title -**** -This is a paragraph in a sidebar. -**** ----- - -[source,html] ----- -
      -
      -
      Optional Title
      -
      -

      This is a paragraph in a sidebar.

      -
      -
      -
      ----- diff --git a/docs/modules/ROOT/pages/style-guide.adoc b/docs/modules/ROOT/pages/style-guide.adoc deleted file mode 100644 index d23ff602..00000000 --- a/docs/modules/ROOT/pages/style-guide.adoc +++ /dev/null @@ -1,22 +0,0 @@ -= UI Element Style Guide - -When creating a UI theme for Antora, there are certain elements in the UI that require support from the CSS to work correctly. -This list includes elements in the shell (i.e., frame) and in the document content. -This document identifies these UI elements. - -//== UI Shell - -// TODO - -== Document Content - -The HTML in the main content area is generated from AsciiDoc using Asciidoctor. -AsciiDoc has numerous content elements that require assistance from CSS to render properly. - -These elements include: - -* xref:inline-text-styles.adoc[Inline text emphasis] -* xref:admonition-styles.adoc[Admonitions] -* xref:list-styles.adoc[Lists] -* xref:sidebar-styles.adoc[Sidebars] -* xref:ui-macro-styles.adoc[Button, keybinding, and menu UI macros] diff --git a/docs/modules/ROOT/pages/stylesheets.adoc b/docs/modules/ROOT/pages/stylesheets.adoc deleted file mode 100644 index aff53168..00000000 --- a/docs/modules/ROOT/pages/stylesheets.adoc +++ /dev/null @@ -1,29 +0,0 @@ -= Work with the CSS Stylesheets - -The stylesheets are written in CSS. -These stylesheets utilize CSS variables to keep the CSS DRY and easy to customize. - -== Stylesheet organization and processing - -Within the default UI project, the stylesheet files are separated into modules to help organize the rules and make them easier to find. -The UI build combines and minifies these files into a single file named [.path]_site.css_. -During the build, the CSS is enhanced using PostCSS in much the same way as a CSS preprocessor works, only the modifications are made to the CSS directly. -The modifications mostly center around injecting vendor prefixes for compatibility or backporting new features to more broadly supported syntax. - -== Add a new CSS rule - -Let's consider the case when you want to modify the font size of a section title. - -First, make sure you have set up the project and created a development branch. -Next, open the file [.path]_src/css/doc.css_ and modify the rule for the section title. - -[source,css] ----- -.doc h1 { - font-size: 2.5rem; - margin-bottom: 1rem; - margin-top: 2rem -} ----- - -Save the file, commit it to git, push the branch, and allow the approval workflow to play out. diff --git a/docs/modules/ROOT/pages/templates.adoc b/docs/modules/ROOT/pages/templates.adoc deleted file mode 100644 index 39a259b6..00000000 --- a/docs/modules/ROOT/pages/templates.adoc +++ /dev/null @@ -1,201 +0,0 @@ -= Work with the Handlebars Templates - -Antora combines the Handlebars templates with the converted AsciiDoc content and other UI model data to make the pages in the site. -These "`logic-less`" templates are mostly HTML with some special mustache tags sprinkled in where content should be inserted. - -== What do the templates do? - -The layout templates, which are stored in [.path]_src/layouts/_, provide the main page structure. -The partial templates, in [.path]_src/partials/_, fill in different regions of a page, such as the navigation and footer. - -The templates read from a model that's populated by Antora. -The model can be accessed by enclosing path expressions in mustaches, which are `{{` and `}}` or `{{{` and `}}}` (e.g., `+{{{page.title}}}+`). -The double mustaches escape the value for HTML, whereas triple mustaches insert the value as is. - -WARNING: If the mustaches are preceded by a backslash (e.g, `\{{`), the expression will be disabled. -This often comes up when constructing URLs. -To avoid this problem, you should use forward slashes in URLs instead of backslashes. - -When `{{` is immediately followed by `>`, that invokes a partial (from the partials directory) and inserts the result (e.g., `+{{> head}}+`. -In other words, that's not a model reference like the other mustache expressions. - -=== Template variables - -CAUTION: This model is not final. -Variable names and purposes may change. - -Here's an overview of the available UI model: - -.Variables available to the Handlebars templates (top-level variables in bold) -[#template-variables-table,cols="1m,2"] -|=== -| Name | Description - -s| [[site]]site -| Information about the site. - -| site.url -| The base URL of the site, if specified in the playbook. - -| site.path -| The pathname (i.e., subpath) of the site.url under which the site is hosted (e.g., /docs). -This value is empty if site.url is not defined, has no path segment, or matches /. -Can be removed from the site.url value using a helper (e.g., `deleteSuffix site.url site.path`) -(since Antora 2.1) - -| site.title -| The title of the site. - -| site.components -| A map of all the components in the site, keyed by component name. -Properties of each component include name, title, url, latest, and versions. -Properties of each version include name (since 2.3), version, displayVersion, prerelease (if set), title, url, asciidoc (since 2.3), and navigation. -The navigation property on each version provides access to the navigation menu for that component version. - -| site.ui -| Information about the site UI. - -| site.ui.defaultLayout -| The default page layout used for this site. - -| site.ui.url -| The absolute base URL of the UI. - -s| [[page]]page -| Information about the current page. - -| page.title -| The page title in HTML format (often used as the primary heading). -This value may include inline HTML elements and XML character references. - -| page.contents -| The main article content in HTML format. -Sourced from AsciiDoc and converted to HTML by the Asciidoctor processor. - -| page.attributes -| Any AsciiDoc document attribute prefixed with `page-`. -The `page-` prefix is dropped from the name used in this model. -For example, the value of the document attribute named `page-support-phone` can be accessed via the UI model using `page.attributes.support-phone`. -Page attributes can be defined per page in the AsciiDoc document header (e.g., `:page-support-phone: +1 212-555-1234`) or globally in the playbook under the key `asciidoc.attributes`. -The `page-` prefix is used to isolate page-related attributes from the numerous other document attributes in AsciiDoc. - -| page.description -| The text of the description attribute in the AsciiDoc header, if specified. - -| page.keywords -| A comma-separated list of keywords defined in the AsciiDoc header, if specified. - -| page.component -| Information about the component for the current page. -Properties include name, title, url, latest, and versions. - -| page.componentVersion -| Information about the component version for the current page. -Properties include name (since 2.3), version, displayVersion, prerelease (if set), title, url, and asciidoc (since 2.3). - -| page.module -| The name of the module for the current page. - -| page.relativeSrcPath -| The path of the current page relative to the pages directory in the current module (since 2.3). - -| page.version -| The name of the version for the current page. - -| page.displayVersion -| The name of the display version for the current page. - -| page.versions -| All versions of the current page, including the current page. -Each entry has the properties url, string, and missing. - -| page.latest -| The entry from `page.versions` that corresponds to the latest version available of this page. -The latest page may not come from the latest version of the component (if the page is missing in that version). -This property is not set if this page is in a versionless component. - -| page.breadcrumbs -| An array of breadcrumb items that represent the current selection in the navigation tree. -Includes text-only and external items. - -| page.navigation -| The hierarchical navigation menu for the component version of the current page. -Each navigation item contains the property `content` as well as the optional properties `url` and (child) `items`. - -| page.url -| The URL for the current page. -This value is a root-relative path. -It's often used as the base URL to generate relative URLs from this page. - -| page.canonicalUrl -| The canonical URL for the current page. -The canonicalUrl is only set if site.url is set. -If there are multiple versions of the component, the canonical URL is the qualified URL of the most recent version of the page (excluding any prerelease versions). -If there's only a single version of the component, the canonical URL is the qualified URL of the current page. - -| page.editUrl -| The URL to edit the current page (i.e., activates the web-based editor on the git host). -This value is derived automatically for the hosts github.com, gitlab.com, pagure.io, and bitbucket.org, even if the repository is private. -If the host is not recognized, or you want to customize the value, you can use the `edit_url` key on the content source in the playbook. - -The default UI shows an "Edit this Page" link that points to this URL unless the repository is private (i.e., `page.origin.private` is true) or `page.fileUri` is set. -You can force this link to be shown by setting the environment variable `FORCE_SHOW_EDIT_PAGE_LINK` (e.g., `FORCE_SHOW_EDIT_PAGE_LINK=true`) or by customizing the logic in the UI template. - -| page.fileUri -| The local file:// URI to edit the current page if the page originates from the local filesystem (i.e., the worktree). - -If this property is set, the default UI shows an "Edit this Page" link that points to this URI (instead of the `page.editUrl` value) unless the `CI` environment variable is set (e.g., `CI=true`). -When the `CI` environment variable is set, the default UI ignores this property (since linking to a local file:// URI in a published site doesn't make any sense). - -| page.origin.private -| This value will be true if the repository requires authentication or the repository URL embeds credentials. -In the default UI, if this value is `true`, the "Edit this Page" link is disabled. -A quick way to force this property to be `true` (even if the repository is public) is to begin the content source URL in the playbook with empty credentials, as in `\https://@`. -Then, the "Edit the Page" link will not appear. - -| page.home -| Indicates whether the current page is the start (aka home) page of the site. - -| page.layout -| The page layout for the current page. - -| page.next -| The next reachable page in the navigation tree (skips past text-only and external items). - -| page.previous -| The previous reachable page in the navigation tree (skips past text-only and external items). - -| page.parent -| The parent page in the navigation tree (skips past text-only and external items). - -s| env -| The map of environment variables (sourced from `process.env`). - -s| siteRootPath -| The relative path to the root of the published site. - -s| uiRootPath -| The relative path to the root directory of the UI. - -s| antoraVersion -| The version of Antora used to build the site (specifically the version of the @antora/page-composer package). -|=== - -This model is likely to grow over time. - -== Modify a template - -Let's consider the case when you want to add a new meta tag inside the HTML head. - -First, make sure you have set up the project and created a development branch. -Next, open the file [.path]_templates/partials/head.hbs_ and add your tag. - -[source,html] ----- - ----- - -Each template file has access to the template model, which exposes information about the current page through variable names. -The variables currently available are listed in <>. - -Save the file, commit it to git, push the branch, and allow the approval workflow to play out. diff --git a/docs/modules/ROOT/pages/ui-macro-styles.adoc b/docs/modules/ROOT/pages/ui-macro-styles.adoc deleted file mode 100644 index 8a58017d..00000000 --- a/docs/modules/ROOT/pages/ui-macro-styles.adoc +++ /dev/null @@ -1,61 +0,0 @@ -= UI Macro Styles - -Asciidoctor supports xref:antora:asciidoc:ui-macros.adoc[three UI element representations] out of the box, which are made from corresponding inline UI macros. - -* button (btn macro) -* keybinding (kbd macro) -* menu (menu macro) - -The UI elements are output using semantic HTML elements, so they inherit some default styling from the browser. -However, to look proper, they require some additional styling. - -== Button - -A xref:antora:asciidoc:ui-macros.adoc#button[button] is meant to represent an on-screen button (`+btn:[Save]+`). -However, it should not appear like an actual button as that could confuse the reader into thinking it's interactive. -Therefore, a button is rendered as a bold text by default: - -[source,html] ----- -Save ----- - -Traditionally, a button reference is styled by surrounding the text with square brackets, as shown here: - -btn:[Save] - -== Keybinding - -A xref:antora:asciidoc:ui-macros.adoc#keybinding[keybinding] can be a single key (`+kbd:[F11]+`) or a sequence of keys (`+kbd:[Ctrl+F]`). -Here's the HTML that's generated for these two forms. - -[source,html] ----- -F11 -Ctrl+F ----- - -Here's how these might appear: - -[%hardbreaks] -kbd:[F11] -kbd:[Ctrl+F] - -== Menu - -A xref:antora:asciidoc:ui-macros.adoc#menu[menu] can be a top-level menu reference (`+menu:File[]+`) or a nested selection (`+menu:File[Save]+`). -Here's the HTML that's generated for these two forms. - -[source,html] ----- -File -File  Save ----- - -This might be rendered as: - -menu:File[] - -menu:File[Save] - -The default styling applied to a menu reference is usually sufficient.