Asciidoctor

New, Noteworthy, & Beyond

Alex SotoRed Hat

love writing tweet

Logo

issue 48 open
Asciidoctor logoAsciidoctor logo
issue 48 closed

Processor

Asciidoctor AsciiDoc

xrefstyle

:xrefstyle: full

Refer to <<foreign-keys>>.

...

=== Foreign Keys
Refer to Section 3.2, “Foreign Keys”.

:xrefstyle: short

Refer to <<foreign-keys>>.

...

=== Foreign Keys
Refer to Section 3.2.

Translations

data/locale/attributes-<lang>.adoc

Translated attributes :: fr

:appendix-caption: Appendice
:appendix-refsig: {appendix-caption}
:caution-caption: Avertissement
:example-caption: Exemple
:figure-caption: Figure
:important-caption: Important
:last-update-label: Dernière mise à jour
...

Advanced tag filtering

Tagged include file

package com.acme;
//tag::named[]
import javax.inject.Named;
//end::named[]
import javax.enterprise.context.RequestScoped;

//tag::named[]
@Named("X")
//end::named[]
@RequestScoped
public class TheBeanCalledX {
  ...
}

Exclude all tags

----
include::TheBeanCalledX.java[tags=!*]
----
package com.acme;
import javax.enterprise.context.RequestScoped;

@RequestScoped
public class TheBeanCalledX {
  ...
}

Exclude tags by name

----
include::TheBeanCalledX.java[tags=!named]
----
package com.acme;
import javax.enterprise.context.RequestScoped;

@RequestScoped
public class TheBeanCalledX {
  ...
}

Include everything

----
include::TheBeanCalledX.java[tags=**]
----
package com.acme;

import javax.inject.Named;
import javax.enterprise.context.RequestScoped;

@Named("X")
@RequestScoped
public class TheBeanCalledX {
  ...
}

Stronger SVG support

Interactive SVG

image::diagram.svg[opts=interactive]
<object type="image/svg+xml" data="diagram.svg">
<span class="alt">diagram</span>
</object>

Inline SVG

image::diagram.svg[opts=inline]
<svg xmlns="http://www.w3.org/2000/svg"
    viewBox="0 0 600 400" version="1.1">
  <g>...</g>
</svg>

Diagrams in SVG…​

[plantuml,devoxx,svg,opts=inline]
----
start
if (Going to Devoxx?) then (yes)
  : attend talks \n network \n drink beer;
else (no)
  : watch talks \n live on YouTube \n (without pants);
endif
stop
----

…​means diagrams are crisp

devoxx activity diagram

Compliance & stability

Asciidoctor Bespoke

Basic presentation

= My Awesome Presentation

== Get Ready In...

[%build]
* 3
* 2
* 1

== Gather the Crowd

== Shout It Aloud

== Creative Cloud!

Fancy Text

[.remark%slice%fit]
== This is a  Call  to All Engineers

This is a Call to All Engineers

Performance

Why ?

GitHub AsciiDoc

35% faster!

Ecosystem

gem download chart
Source: http://bestgems.org/gems/asciidoctor

Gem 2.5m

AsciidoctorJ 0.5m/y

Asciidoctor.js 35.5k

Repositories 70

Contributors 376

Supporters 80

AsciidoctorJ

asciidoctorj

Inline issue macro

# ex. issue:48[]
Asciidoctor::Extensions.register do
  inline_macro :issue do
    process do |parent, id, attrs|
      base_uri = parent.document.attr 'uri-issues'
      create_anchor parent, id, \
          type: :link,
          target: "#{base_uri}/#{id}",
          attributes: attrs
    end
  end
end

Inline issue macro

// ex. issue:48[]
asciidoctor {
  extensions {
    inline_macro (name: 'issue') { parent, id, attrs ->
      baseUri = parent.document.getAttribute('uri-issues')
      createInline(parent, 'anchor', id, attrs, [
        type: ':link',
        target: "${baseUri}/${id}".toString(),
        attributes: attrs
      ])
    }
  }
}

Asciidoctor.js

asciidoctorjs

Inline issue macro

# ex. issue:48[]
Asciidoctor::Extensions.register do
  inline_macro :issue do
    process do |parent, id, attrs|
      base_uri = parent.document.attr 'uri-issues'
      create_anchor parent, id, \
          type: :link,
          target: "#{base_uri}/#{id}",
          attributes: attrs
    end
  end
end

Inline issue macro

// ex. issue:48[]
Opal.Asciidoctor.Extensions.register(function () {
  this.inlineMacro('issue', function () {
    this.process((parent, id, attrs) => {
      const baseUri = parent.getDocument()
          .getAttribute('uri-issues')
      return this.createInline(parent, 'anchor', id, {
        type: 'link',
        target: `${baseUri}/${id}`,
        attributes: attrs
      })
    })
  })
})
asciidoc in atom

Adoption

Fedora
Red Hat
Java EE
Spring Framework
Vogella Company
Khronos Group
JHipster Mini-book

Future

Semantic versioning

versions

Semantic HTML

asciidoctor html5s
https://github.com/jirutka/asciidoctor-html5s

Validation

textlint

textlint :: insecure-url-rule

const LinkMacroRx = /(http(s)?:\/\/[^\[]+)\[[\s\S]*?\]/g
module.exports = ({ RuleError, report }) => ({
  'ParagraphNode': (node) => {
    node.children.forEach((line) => {
      let match
      while ((match = LinkMacroRx.exec(line.raw)) != null) {
        if (match[2] != null) continue
        report(line, new RuleError(
          `Illegal link to a non-secure URL: ${match[1]}`,
          { index: match.index }))
      }
    })
  }
})
$ textlint "**/*.adoc"

server-docs/modules/ROOT/content/user-manual.adoc

  14:124  error  Illegal link to a non-secure URL:
                 http://example.com (non-secure-url)

✖ 1 problem (1 error, 0 warnings)

Antora

antora pipeline aggregate classify

Antora playbook

site:
  url: https://docs.example.com
  title: Docs Site
content:
  sources:
  - url: https://github.com/acme/solution-docs.git
  - url: /home/username/projects/server-docs
    branches: [ v2.5, v3.0, v3.1 ]
  - url: git@github.com:acme/api-gateway-docs.git
    branches: v2*

Documentation

asciidoctor user manual
http://asciidoctor.org/docs/user-manual/

Antora Asciidoctor

Thank You!

asciidoctor.org