asciidoctor new, noteworthy and beyond devoxx-2017

62
Asciidoctor New, Noteworthy, & Beyond Alex Soto Red Hat @alexsotob

Upload: alex-soto

Post on 22-Jan-2018

66 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

AsciidoctorNew, Noteworthy, & Beyond

A l e x S o t o R e d H a t @ a l e x s o t o b

Page 2: Asciidoctor New, Noteworthy and Beyond Devoxx-2017
Page 3: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Logo

Page 4: Asciidoctor New, Noteworthy and Beyond Devoxx-2017
Page 5: Asciidoctor New, Noteworthy and Beyond Devoxx-2017
Page 6: Asciidoctor New, Noteworthy and Beyond Devoxx-2017
Page 7: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Processor

Page 8: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Asciidoctor AsciiDoc

Page 9: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

xrefstyle

Page 10: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Refer to <<foreign-keys>>.

...

=== Foreign Keys

Refer to Section 3.2, “Foreign Keys”.:xre

fsty

le: f

ull

Page 11: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Refer to Section 3.2.:xre

fsty

le: s

hort

Refer to <<foreign-keys>>.

...

=== Foreign Keys

Page 12: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Translations

Page 13: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

data/locale/attributes-<lang>.adoc

ar bg ca da de es fa

� fr hu id it ja kr

nb nl nn pl pt pt_BR ro

ru sr sr_Latn tr uk zh_CN zh_TW

Page 14: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Tran

slat

ed a

ttrib

utes

:: 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 ...

Page 15: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Advanced tag �ltering

Page 16: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Tagg

ed in

clud

e �l

epackage 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 { ... }

java

Page 17: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

---- include::TheBeanCalledX.java[tags=!*] ----

package com.acme; import javax.enterprise.context.RequestScoped;

@RequestScoped public class TheBeanCalledX { ... }

Excl

ude

all t

ags

Page 18: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

package com.acme; import javax.enterprise.context.RequestScoped;

@RequestScoped public class TheBeanCalledX { ... }Ex

clud

e ta

gs b

y na

me ----

include::TheBeanCalledX.java[tags=!named] ----

Page 19: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

---- include::TheBeanCalledX.java[tags=**] ----

package com.acme;

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

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

Incl

ude

ever

ythi

ng

Page 20: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Stronger SVG support

Page 21: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

image::diagram.svg[opts=interactive]

<object type="image/svg+xml" data="diagram.svg"> <span class="alt">diagram</span> </object>

Inte

ract

ive

SVG

Page 22: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 400" version="1.1"> <g>...</g> </svg>In

line

SVG image::diagram.svg[opts=inline]

Page 23: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Dia

gram

s 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 ----

Page 24: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Going to Devoxx?yes no

attend talks

network

drink beer

watch talks

live on YouTube

(without pants)

… mea

ns d

iagr

ams

are

cris

p

Page 25: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Compliance & stability

Page 26: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Asciidoctor Bespoke

Page 27: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Basi

c pr

esen

tatio

n= My Awesome Presentation

== Get Ready In...

[%build] * 3 * 2 * 1

== Gather the Crowd

== Shout It Aloud

== Creative Cloud!

Page 28: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

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

THIS IS ACALLTO ALL ENGINEERS

Fanc

y Te

xt

Page 29: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Performance

Page 30: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Why ?

Page 31: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

GitHub AsciiDoc

Page 32: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

35% faster!

Page 33: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Ecosystem

Page 34: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Source: http://bestgems.org/gems/asciidoctor

Page 35: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

GEM

2.5m ASCIIDOCTORJ

0.5m/y ASCIIDOCTOR.JS

35.5k

REPOSITORIES

70CONTRIBUTORS

376SUPPORTERS

80

Page 36: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

AsciidoctorJ

Page 37: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

AsciidoctorJ

MavenPlugin

GradlePlugin

IntelliJPlugin

JavaDocDoclet

AntPlugin

LeanpubConverter

Page 38: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Inlin

e is

sue

mac

ro# 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

ruby

Page 39: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Inlin

e is

sue

mac

ro// 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 ]) } } }

groovy

Page 40: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Asciidoctor.js

Page 41: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Asciidoctor.js

BrowserPreviews

BracketsExtension

GitBookAsciidocFX

AtomPackage

docgist

Page 42: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Inlin

e is

sue

mac

ro# 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

ruby

Page 43: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Inlin

e is

sue

mac

ro// 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 }) }) }) })

js

Page 44: Asciidoctor New, Noteworthy and Beyond Devoxx-2017
Page 45: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Adoption

Page 46: Asciidoctor New, Noteworthy and Beyond Devoxx-2017
Page 47: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Future

Page 48: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Semantic versioning

Page 49: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

1.5.6 1.5.7 1.6.0 1.7.0 2.0.0

Page 50: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Semantic HTML

Page 51: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

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

Page 52: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Validation

Page 53: Asciidoctor New, Noteworthy and Beyond Devoxx-2017
Page 54: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

text

lint :

: inse

cure

-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 })) } }) } })

js

Page 55: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

$ 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)

Page 56: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Antora

Page 57: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Source 3 Source 5Source 4Source 2Source 1

GIT CLONE / FETCH

Component A Component B Component C Component DComponent D

GRAB FILES FROM SELECT BRANCHES

ASCIIDOC

PAGES

ASSETS

 

Page 58: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Ant

ora

play

book

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: [email protected]:acme/api-gateway-docs.git branches: v2*

yml

Page 59: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Documentation

Page 60: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

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

Page 61: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Antora Asciidoctor

Page 62: Asciidoctor New, Noteworthy and Beyond Devoxx-2017

Thank You!asciidoctor.org

A l e x S o t o R e d H a t @ a l e x s o t o b