node_modules/
package-lock.json
+build
+output
+site-working.yml
$ nvm install --lts
----
-=== Install Ansible
-
-There is one peice of the puzzle using Ansible at the moment. Better get that installed.
-
-[source,bash]
-----
-$ sudo apt-get install ansible
-----
-
=== Run generate_docs.pl
This tool does the rest of the work. You will be requried to supply these things:
|===
|base-url
-|[eg: http//examplesite.org]
+|[URL where html output is expected to be available eg: http//examplesite.org]
|tmp-space
-|[Writable path where we stage antora UI repo and the antora HTML, eg: ../../tmp]
+|[Writable path for staging the antora UI repo and build files, defaults to ./build]
|html-output
-|[Path where you want the generated HTML files to go, eg: /var/www/html]
+|[Path for the generated HTML files, defaults to ./output]
|antora-ui-repo
-|[git link to a repo, could be community repo: https://gitlab.com/antora/antora-ui-default.git]
+|[Antora-UI repository for the built UI, defaults to git://git.evergreen-ils.org/eg-antora.git]
|antora-version
-|[target version of antora, eg: 2.1]
+|[Version of antora to use for build, defaults to 2.3]
|===
----
-NOTE: This tool will create two folders within the temp space folder path: "staging" and "antora-ui". These folders will be erased and re-created with each execution.
+NOTE: This tool will create the tmp-space and html-ouput directories if they do not exist. These folders will be erased and re-created with each execution.
[source,bash]
----
-$ git clone git://git.evergreen-ils.org/working/Evergreen.git
+$ git clone git://git.evergreen-ils.org/Evergreen.git
$ git clone git://git.evergreen-ils.org/eg-antora.git
$ cd Evergreen
-$ git checkout collab/blake/LP1848524_antora_ize_docs
----
First we have to install antora:
[source,bash]
----
$ cd docs
-# (we want to install into directory as opposed to globally)
-$ npm i @antora/cli@2.1 @antora/site-generator-default@2.1
+# (we want to install into the local directory as opposed to globally)
+$ npm install @antora/cli@2.3 @antora/site-generator-default@2.3 antora-lunr antora-site-generator-lunr
----
Now, install the ui pre-reqs building
-lifted from:
+lifted from
https://docs.antora.org/antora-ui-default/set-up-project/
+and
+https://github.com/Mogztter/antora-lunr
[source,bash]
----
[source,bash]
----
$ cd ../Evergreen/docs
-antora site.yml
+DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr antora --generator antora-site-generator-lunr site.yml
----
If all went well - then you will have the site built in the output folder that was configured in site.yml!
NOTE: https://owncloud.org/news/owncloud-docs-migrating-antora-pt-1-2/
-
-== Search stuff
-
-First you need to have ansible installed
-
-NOTE: If you want to manually edit the file, you don't need to install ansible
-
-[source,bash]
-----
-$ sudo apt-get -y install ansible
-----
-
-Now, let's run through the antora-lunr procedure:
-
-NOTE: Lifted from the base install notes from the https://github.com/Mogztter/antora-lunr[ git repo]
-
-
-[source,bash]
-----
-$ ansible-playbook setup_lunr.yml
-
-----
-
-This should have edited this file: node_modules/@antora/site-generator-default/lib/generate-site.js
-as outlined in the git repo notes
-
-Now, install the lunr bits (from the docs folder)
-
-[source,bash]
-----
-$ npm i antora-lunr
-----
-
-And now, you can re-generate the site but this time with the search box:
-
-[source,bash]
-----
-$ DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr antora site.yml
-----
-
use Data::Dumper;
my $base_url;
-my $tmp_space;
-my $html_output;
-my $antoraui_git;
-my $antora_version;
+my $tmp_space = './build';
+my $html_output = './output';
+my $antoraui_git = 'https://gitlab.com/antora/antora-ui-default.git';
+my $antora_version = '2.3';
my $help;
--tmp-space ../../tmp
--html-output /var/www/html
--antora-ui-repo https://gitlab.com/antora/antora-ui-default.git
- --antora-version 2.1
+ --antora-version 2.3
You must specify
- --base-url [eg: http//examplesite.org]
- --tmp-space [Writable path where we stage antora UI repo and the antora HTML, eg: ../../tmp]
- --html-output [Path where you want the generated HTML files to go, eg: /var/www/html]
- --antora-ui-repo [git link to a repo, could be community repo: https://gitlab.com/antora/antora-ui-default.git]
- --antora-version [target version of antora, eg: 2.1]
+ --base-url [URL where html output is expected to be available eg: http//examplesite.org/docs]
+ --tmp-space [Writable path for staging the antora UI repo and build files, defaults to ./build]
+ --html-output [Path for the generated HTML files, defaults to ./output]
+ --antora-ui-repo [Antora-UI repository for the built UI, defaults to https://gitlab.com/antora/antora-ui-default.git]
+ --antora-version [Target version of antora, defaults to 2.3]
HELP
exit;
exit;
}
-# make sure the temp folder is good
-mkdir $tmp_space if ( !( -d $tmp_space ));
-
-# make sure the output folder is good
-mkdir $html_output if ( !( -d $html_output ));
# deal with destination folders
-print "cleaning $tmp_space/antora-ui/\n" if (-d "$tmp_space/antora-ui");
-rmtree("$tmp_space/antora-ui/") if (-d "$tmp_space/antora-ui");
+if (-d "$tmp_space/antora-ui") {
+ print "cleaning $tmp_space/antora-ui/\n";
+ rmtree("$tmp_space/antora-ui/");
+}
-print "cleaning $tmp_space/staging/\n" if (-d "$tmp_space/staging");
-rmtree("$tmp_space/staging/") if (-d "$tmp_space/staging");
+if (-d "$html_output") {
+ print "cleaning $html_output/\n";
+ rmtree("$html_output/");
+}
-mkdir "$tmp_space/staging/";
+# make sure the temp folder is good
+mkdir $tmp_space unless ( -d $tmp_space );
+
+# make sure the output folder is good
+mkdir $html_output unless ( -d $html_output );
+
+die "Both " . $tmp_space . " and " . $html_output . " must be writable!" unless ( -w $tmp_space && -w $html_output );
# Deal with ui repo
exec_system_cmd("git clone $antoraui_git $tmp_space/antora-ui");
exec_system_cmd("cd $tmp_space/antora-ui && npm install");
-exec_system_cmd("cd $tmp_space/antora-ui && $tmp_space/antora-ui/node_modules/.bin/gulp build && $tmp_space/antora-ui/node_modules/.bin/gulp pack");
-
-# Deal with root URL Antora configuration
-rewrite_yml($base_url,"site/url","site.yml");
-rewrite_yml("$tmp_space/staging","output/dir","site.yml");
-rewrite_yml("$tmp_space/antora-ui/build/ui-bundle.zip","ui/bundle/url","site.yml");
-
+exec_system_cmd("cd $tmp_space/antora-ui && ./node_modules/.bin/gulp build && ./node_modules/.bin/gulp pack");
-#npm build antora
-exec_system_cmd('npm i @antora/cli@'.$antora_version.' @antora/site-generator-default@'.$antora_version);
-#make sure the lunr bits are accounted for
-exec_system_cmd('ansible-playbook setup_lunr.yml');
-exec_system_cmd('npm i antora-lunr');
+exec_system_cmd("cp site.yml site-working.yml");
-# Install the antora site generator with lunr
-exec_system_cmd('npm i antora-site-generator-lunr');
+# Deal with root URL Antora configuration
+rewrite_yml($base_url,"site/url","site-working.yml");
+rewrite_yml("$html_output","output/dir","site-working.yml");
+rewrite_yml("$tmp_space/antora-ui/build/ui-bundle.zip","ui/bundle/url","site-working.yml");
-# Now, finally, let's build antora
-exec_system_cmd('DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr NODE_PATH="$(npm root)" ./node_modules/@antora/cli/bin/antora --generator antora-site-generator-lunr site.yml');
+#npm install antora
+exec_system_cmd('npm install @antora/cli@' . $antora_version . ' @antora/site-generator-default@' . $antora_version . ' antora-lunr antora-site-generator-lunr');
-# rsync to production
-exec_system_cmd('rsync -av --delete '.$tmp_space.'/staging/* '.$html_output.'/');
+# Now, finally, let's build the site
+exec_system_cmd('DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr NODE_PATH="$(npm root)" ./node_modules/@antora/cli/bin/antora --generator antora-site-generator-lunr site-working.yml');
-print "Success: your site should be viewable here: $base_url\n";
+print "Success: your site files are available at " . $html_output . " and can be moved into place for access at " . $base_url . "\n";
sub rewrite_yml
{
my $file = shift;
my $contents = replace_yml($replacement,$yml_path,$file);
$contents =~ s/[\n\t]*$//g;
- write_file("site.yml", $contents) if ($contents =~ m/$replacement/);
+ write_file($file, $contents) if ($contents =~ m/$replacement/);
}
sub write_file
+++ /dev/null
----
-- hosts: 'localhost'
- connection: local
- remote_user: user
- become_method: sudo
- tasks:
- - name: Insert const generateIndex
- lineinfile:
- path: node_modules/@antora/site-generator-default/lib/generate-site.js
- insertafter: 'use strict'
- line: "const generateIndex = require('antora-lunr')"
-
- - name: Insert const index
- lineinfile:
- path: node_modules/@antora/site-generator-default/lib/generate-site.js
- insertafter: 'const siteFiles = mapSit'
- line: " const index = generateIndex(playbook, pages)"
-
- - name: Insert line siteFiles.push(generateIndex.createIndexFile(index))
- lineinfile:
- path: node_modules/@antora/site-generator-default/lib/generate-site.js
- insertafter: 'const index = generateIn'
- line: " siteFiles.push(generateIndex.createIndexFile(index))"
-...
\ No newline at end of file
+++ /dev/null
-root = true
-
-[*]
-indent_style = space
-indent_size = 2
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
+++ /dev/null
-{
- "extends": "standard",
- "rules": {
- "arrow-parens": ["error", "always"],
- "comma-dangle": ["error", "always-multiline"],
- "max-len": [1, 120, 2],
- "spaced-comment": "off"
- }
-}
+++ /dev/null
-/build/
-/node_modules/
-/public/
+++ /dev/null
-image: node:10.14.2-stretch
-stages: [setup, verify, deploy]
-install:
- stage: setup
- cache:
- paths:
- - .cache/npm
- script:
- - &npm_install
- npm install --quiet --no-progress --cache=.cache/npm
-lint:
- stage: verify
- cache: &pull_cache
- policy: pull
- paths:
- - .cache/npm
- script:
- - *npm_install
- - node_modules/.bin/gulp lint
-bundle-stable:
- stage: deploy
- only:
- - master@antora/antora-ui-default
- cache: *pull_cache
- script:
- - *npm_install
- - node_modules/.bin/gulp bundle
- artifacts:
- paths:
- - build/ui-bundle.zip
-bundle-dev:
- stage: deploy
- except:
- - master
- cache: *pull_cache
- script:
- - *npm_install
- - node_modules/.bin/gulp bundle
- artifacts:
- expire_in: 1 day # unless marked as keep from job page
- paths:
- - build/ui-bundle.zip
-pages:
- stage: deploy
- only:
- - master@antora/antora-ui-default
- cache: *pull_cache
- script:
- - *npm_install
- - 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:
- paths:
- - public
+++ /dev/null
-{
- "description": "Build tasks for the Antora default UI project",
- "flags.tasksDepth": 1
-}
+++ /dev/null
-{
- "extends": "stylelint-config-standard",
- "rules": {
- "comment-empty-line-before": null,
- "no-descending-specificity": null,
- }
-}
--- /dev/null
+<header class="header" role="banner">
+ <nav class="navbar">
+ <div class="navbar-brand">
+ <a class="navbar-item" href="{{or site.url (or siteRootUrl siteRootPath)}}">{{site.title}}</a>
+ {{#if env.DOCSEARCH_ENABLED}}
+ <div class="navbar-item">
+ <input id="search-input" type="text" placeholder="Search docs">
+ </div>
+ {{/if}}
+ <button class="navbar-burger" data-target="topbar-nav">
+ <span></span>
+ <span></span>
+ <span></span>
+ </button>
+ </div>
+ <div id="topbar-nav" class="navbar-menu">
+ <div class="navbar-end">
+ <a class="navbar-item" href="#">Home</a>
+ <div class="navbar-item has-dropdown is-hoverable">
+ <a class="navbar-link" href="#">Services</a>
+ <div class="navbar-dropdown">
+ <a class="navbar-item" href="#">Service A</a>
+ <a class="navbar-item" href="#">Service B</a>
+ <a class="navbar-item" href="#">Service C</a>
+ </div>
+ </div>
+ <div class="navbar-item">
+ <span class="control">
+ <a class="button is-primary" href="#">Download</a>
+ </span>
+ </div>
+ </div>
+ </div>
+ </nav>
+</header>
--- /dev/null
+<div class="toolbar" role="navigation">
+{{> nav-toggle}}
+ {{#with site.homeUrl}}
+ <a href="{{{relativize this}}}" class="home-link{{#if @root.page.home}} is-current{{/if}}"></a>
+ {{/with}}
+{{> breadcrumbs}}
+{{> page-versions}}
+</div>