Skip to content

Commit

Permalink
use antora for documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Aguilera <[email protected]>
  • Loading branch information
jagedn committed Jul 24, 2024
1 parent 88474c9 commit f680e15
Show file tree
Hide file tree
Showing 72 changed files with 413 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
distribution: 'temurin'
architecture: x64
- name: Generate
run: ./gradlew asciidoctor
run: ./gradlew antora
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
Expand Down
14 changes: 14 additions & 0 deletions antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
site:
title: Nextflow nf-nomad plugin
start_page: main:ROOT:index.adoc
content:
sources:
- url: .
start_path: ./src/docs/antora
edit_url: false
branches: HEAD

ui:
bundle:
url: ./src/docs/antora/ui
snapshot: true
19 changes: 15 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

plugins {
id("org.asciidoctor.jvm.convert") version "3.3.2"
id 'org.antora' version '1.0.0'
}

repositories {
Expand All @@ -22,7 +22,18 @@ nextflowPlugin{
]
}

asciidoctor{
baseDir 'src/docs/asciidoc'
attributes revnumber : { project.version.toString() }
node {
version = 'latest'
}

antora {
version = '3.0.3'
options = [
clean: true,
fetch: true,
stacktrace: true,
attributes: [product: 'Nf-Nomad Plugin']
]
environment = [:]
packages = [:]
}
5 changes: 5 additions & 0 deletions src/docs/antora/antora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: main
version: final
title: Nf-Nomad
nav:
- modules/ROOT/nav.adoc
9 changes: 9 additions & 0 deletions src/docs/antora/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

* xref:index.adoc[Introduction]
* xref:usage.adoc[Usage]
* xref:config.adoc[Configuration]
* xref:development.adoc[Development]
25 changes: 25 additions & 0 deletions src/docs/antora/modules/ROOT/pages/config.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
== Configuration

Most of the basic configuration is in a `nomad` closure in the `nextflow.config` file

i.e.

```
nomad{
client{
address = "http://localhost:4646"
}
jobs{
deleteoncompletion = false
}
}
```

=== Client configuration

- address, a URL
- token, if the cluster is protected you must to provide a token

=== Jobs configuration

- deleteOnCompletion, a boolean indicating if the job will be removed once completed
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ The plugin itself is similar in design and scope to other executor integrations
Hope you enjoy using the plugin and please participate in the development/feedback of the plugin in the `platform-nomad` channel on the Nextflow Slack instance. We would love to hear your feedback!


=== Resources

==== Some resources for familiarizing yourself with Nomad:
Some resources for familiarizing yourself with Nomad:

- https://developer.hashicorp.com/nomad/docs?product_intent=nomad[Hashicorp Documentation website for Nomad]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ workflow {
}
----

TIP:: You need to use an S3 bucket as working dir
TIP: You need to use an S3 bucket as working dir

Run the pipeline

`$ nextflow run main.nf`
`$ nextflow run main.nf -w s3://YOUR_BUCKET`

3 changes: 3 additions & 0 deletions src/docs/antora/ui/css/site.css

Large diffs are not rendered by default.

Binary file added src/docs/antora/ui/font/roboto-latin-400.woff
Binary file not shown.
Binary file added src/docs/antora/ui/font/roboto-latin-400.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/docs/antora/ui/font/roboto-latin-500.woff
Binary file not shown.
Binary file added src/docs/antora/ui/font/roboto-latin-500.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 9 additions & 0 deletions src/docs/antora/ui/helpers/and.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict'

module.exports = (...args) => {
const numArgs = args.length
if (numArgs === 3) return args[0] && args[1]
if (numArgs < 3) throw new Error('{{and}} helper expects at least 2 arguments')
args.pop()
return args.every((it) => it)
}
5 changes: 5 additions & 0 deletions src/docs/antora/ui/helpers/detag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict'

const TAG_ALL_RX = /<[^>]+>/g

module.exports = (html) => html && html.replace(TAG_ALL_RX, '')
3 changes: 3 additions & 0 deletions src/docs/antora/ui/helpers/eq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict'

module.exports = (a, b) => a === b
3 changes: 3 additions & 0 deletions src/docs/antora/ui/helpers/increment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict'

module.exports = (value) => (value || 0) + 1
3 changes: 3 additions & 0 deletions src/docs/antora/ui/helpers/ne.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict'

module.exports = (a, b) => a !== b
3 changes: 3 additions & 0 deletions src/docs/antora/ui/helpers/not.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict'

module.exports = (val) => !val
9 changes: 9 additions & 0 deletions src/docs/antora/ui/helpers/or.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict'

module.exports = (...args) => {
const numArgs = args.length
if (numArgs === 3) return args[0] || args[1]
if (numArgs < 3) throw new Error('{{or}} helper expects at least 2 arguments')
args.pop()
return args.some((it) => it)
}
24 changes: 24 additions & 0 deletions src/docs/antora/ui/helpers/relativize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict'

const { posix: path } = require('path')

module.exports = (to, from, ctx) => {
if (!to) return '#'
// NOTE only legacy invocation provides both to and from
if (!ctx) from = (ctx = from).data.root.page.url
if (to.charAt() !== '/') return to
if (!from) return (ctx.data.root.site.path || '') + to
let hash = ''
const hashIdx = to.indexOf('#')
if (~hashIdx) {
hash = to.substr(hashIdx)
to = to.substr(0, hashIdx)
}
return to === from
? hash || (isDir(to) ? './' : path.basename(to))
: (path.relative(path.dirname(from + '.'), to) || '.') + (isDir(to) ? '/' + hash : hash)
}

function isDir (str) {
return str.charAt(str.length - 1) === '/'
}
3 changes: 3 additions & 0 deletions src/docs/antora/ui/helpers/year.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict'

module.exports = () => new Date().getFullYear().toString()
1 change: 1 addition & 0 deletions src/docs/antora/ui/img/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/docs/antora/ui/img/caret.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/docs/antora/ui/img/chevron.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/docs/antora/ui/img/home-o.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/docs/antora/ui/img/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/docs/antora/ui/img/menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/docs/antora/ui/img/octicons-16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/docs/antora/ui/js/site.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/docs/antora/ui/js/vendor/highlight.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/docs/antora/ui/layouts/404.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{> head defaultPageTitle='Page Not Found'}}
</head>
<body class="status-404">
{{> header}}
{{> body}}
{{> footer}}
</body>
</html>
11 changes: 11 additions & 0 deletions src/docs/antora/ui/layouts/default.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{> head defaultPageTitle='Untitled'}}
</head>
<body class="article{{#with (or page.attributes.role page.role)}} {{{this}}}{{/with}}">
{{> header}}
{{> body}}
{{> footer}}
</body>
</html>
10 changes: 10 additions & 0 deletions src/docs/antora/ui/partials/article-404.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<article class="doc">
<h1 class="page">{{{or page.title 'Page Not Found'}}}</h1>
<div class="paragraph">
<p>The page you&#8217;re looking for does not exist. It may have been moved. You can{{#with site.homeUrl}} return to the <a href="{{{this}}}">start page</a>, or{{/with}} follow one of the links in the navigation to the left.</p>
</div>
<div class="paragraph">
<p>If you arrived on this page by clicking on a link, please notify the owner of the site that the link is broken.
If you typed the URL of this page manually, please double check that you entered the address correctly.</p>
</div>
</article>
7 changes: 7 additions & 0 deletions src/docs/antora/ui/partials/article.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<article class="doc">
{{#with page.title}}
<h1 class="page">{{{this}}}</h1>
{{/with}}
{{{page.contents}}}
{{> pagination}}
</article>
4 changes: 4 additions & 0 deletions src/docs/antora/ui/partials/body.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="body">
{{> nav}}
{{> main}}
</div>
20 changes: 20 additions & 0 deletions src/docs/antora/ui/partials/breadcrumbs.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<nav class="breadcrumbs" aria-label="breadcrumbs">
{{#if page.breadcrumbs}}
<ul>
{{#with page.componentVersion}}
{{#if (and ./title (ne ./title @root.page.breadcrumbs.0.content))}}
<li><a href="{{{relativize ./url}}}">{{{./title}}}</a></li>
{{/if}}
{{/with}}
{{#each page.breadcrumbs}}
<li>
{{~#if (and ./url (eq ./urlType 'internal'))~}}
<a href="{{{relativize ./url}}}">{{{./content}}}</a>
{{~else~}}
{{{./content}}}
{{~/if~}}
</li>
{{/each}}
</ul>
{{/if}}
</nav>
3 changes: 3 additions & 0 deletions src/docs/antora/ui/partials/footer-content.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<footer class="footer">
<p>This site was built using Antora.</p>
</footer>
5 changes: 5 additions & 0 deletions src/docs/antora/ui/partials/footer-scripts.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script src="{{{uiRootPath}}}/js/site.js"></script>
<script async src="{{{uiRootPath}}}/js/vendor/highlight.js"></script>
{{#if env.SITE_SEARCH_PROVIDER}}
{{> search-scripts}}
{{/if}}
2 changes: 2 additions & 0 deletions src/docs/antora/ui/partials/footer.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{> footer-content}}
{{> footer-scripts}}
1 change: 1 addition & 0 deletions src/docs/antora/ui/partials/head-icons.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{!-- <link rel="icon" href="{{{uiRootPath}}}/img/favicon.ico" type="image/x-icon"> --}}
20 changes: 20 additions & 0 deletions src/docs/antora/ui/partials/head-info.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{#with page.canonicalUrl}}
<link rel="canonical" href="{{{this}}}">
{{/with}}
{{#unless (eq page.attributes.pagination undefined)}}
{{#with page.previous}}
<link rel="prev" href="{{{relativize ./url}}}">
{{/with}}
{{#with page.next}}
<link rel="next" href="{{{relativize ./url}}}">
{{/with}}
{{/unless}}
{{#with page.description}}
<meta name="description" content="{{{detag this}}}">
{{/with}}
{{#with page.keywords}}
<meta name="keywords" content="{{{this}}}">
{{/with}}
{{#with (or antoraVersion site.antoraVersion)}}
<meta name="generator" content="Antora {{{this}}}">
{{/with}}
1 change: 1 addition & 0 deletions src/docs/antora/ui/partials/head-meta.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{!-- Add additional meta tags here --}}
2 changes: 2 additions & 0 deletions src/docs/antora/ui/partials/head-prelude.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
5 changes: 5 additions & 0 deletions src/docs/antora/ui/partials/head-scripts.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{#with site.keys.googleAnalytics}}
<script async src="https://www.googletagmanager.com/gtag/js?id={{this}}"></script>
<script>function gtag(){dataLayer.push(arguments)};window.dataLayer=window.dataLayer||[];gtag('js',new Date());gtag('config','{{this}}')</script>
{{/with}}
<script>var uiRootPath = '{{{uiRootPath}}}'</script>
1 change: 1 addition & 0 deletions src/docs/antora/ui/partials/head-styles.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" href="{{{uiRootPath}}}/css/site.css">
1 change: 1 addition & 0 deletions src/docs/antora/ui/partials/head-title.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<title>{{{detag (or page.title defaultPageTitle)}}}{{#with site.title}} :: {{this}}{{/with}}</title>
Loading

0 comments on commit f680e15

Please sign in to comment.