SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
10 Useful Asciidoctor Tips 
Andres Almiray 
Canoo Engineering AG 
#devoxx #asciidoctor_tips @aalmiray
#devoxx #asciidoctor_tips @aalmiray
#1 Live Reload + Browser Extension 
• http://livereload.com/ 
! 
• https://github.com/asciidoctor/asciidoctor-chrome-extension 
! 
• https://github.com/asciidoctor/asciidoctor-firefox-addon 
#devoxx #asciidoctor_tips @aalmiray
#2 Build Tool integration 
• https://github.com/asciidoctor/asciidoctor-maven-plugin 
! 
• https://github.com/asciidoctor/asciidoctor-gradle-plugin 
! 
• https://github.com/aalmiray/livereload-gradle-plugin 
#devoxx #asciidoctor_tips @aalmiray
#3 Provide a _links.adoc file 
• Use an attribute per link 
• Include the _links.adoc file at the beginning of your index file 
// 
_links.adoc 
:link_gradle: 
http://www.gradle.org/[Gradle, 
window="_blank"] 
:link_maven: 
http://maven.apache.org/[Maven, 
window="_blank"] 
// 
index.adoc 
include::_links.adoc[] 
! 
Asciidoctor 
has 
great 
integration 
with 
{link_gradle} 
and 
{link_maven}. 
#devoxx #asciidoctor_tips @aalmiray
#4 Blank lines at top and bottom 
• Simplifies including files into others 
// 
without 
blank 
lines 
// 
with 
blank 
lines 
// 
index.adoc 
// 
index.adoc 
! 
! 
include::chapter1.adoc[] 
include::chapter1.adoc[] 
! 
include::chapter2.adoc[] 
include::chapter2.adoc[] 
include::chapter3.adoc[] 
! 
include::chapter3.adoc[] 
#devoxx #asciidoctor_tips @aalmiray
#5 Comment your documentation! 
• Yes, comments on documentation ;-) 
= 
Chapter 
Title 
The 
following 
chapter 
discusses 
lorem 
ipsum 
dolor 
sit 
amet 
consecutur 
ad 
nauseam. 
// 
IDEA: 
insert 
a 
lorem 
ipsum 
generator 
here? 
! 
Lorem 
ipsum 
dolor 
sit 
amet 
consecutur. 
Lorem 
ipsum 
dolor 
sit 
amet 
consecutur. 
Lorem 
ipsum 
dolor 
sit 
amet 
consecutur. 
Lorem 
ipsum 
dolor 
sit 
amet 
consecutur. 
! 
//// 
Why 
build 
a 
custom 
lorem-­‐ipsum 
extension 
when 
copy&paste 
is 
so 
cheap? 
No 
need 
to 
tire 
those 
cell 
brains. 
Oh 
look, 
beer! 
//// 
#devoxx #asciidoctor_tips @aalmiray
#6 Use conditional blocks 
• ifdef::attribute_name[] checks if attribute has a value 
• ifndef::attribute_name[] performs the opposite check 
• ifeval::[{attribute_name} > 2] evaluates the attribute 
! 
• You can surround blocks if ifdef/ifndef/ifeval & endif 
• These are great for conditionally rendering content based on 
build variables (see tip #2). 
#devoxx #asciidoctor_tips @aalmiray
#7 Callouts in paragraphs 
• Apply the following inside any paragraph 
[conum,data-value=2]_2_ 
where 2 can be any number 
! 
• Reverse engineered from 
<em class="conum">2</em> 
#devoxx #asciidoctor_tips @aalmiray
#8 Include Raw Content 
• Either use the pass:[] macro or the ++++ block 
pass:[<iframe 
src=“http://secr.et/not/a/malicious/page/honest.html”></iframe>] 
! 
++++ 
<script 
type="text/javascript"> 
var 
pageTracker 
= 
_gat._getTracker("XX-­‐123456-­‐1"); 
pageTracker._initData(); 
pageTracker._trackPageview(); 
</script> 
++++ 
#devoxx #asciidoctor_tips @aalmiray
#9 The Include Macro is Awesome 
• Include any file. 
• Apply call outs in source code. Use standard code comments 
• Change indentation; include certain lines, tags 
.src/main/java/sample/Foo.java 
[source,java,linenums,options="nowrap"] 
-­‐-­‐-­‐-­‐ 
include::{rootdir}/src/main/java/sample/Foo.java[lines=16..-­‐1] 
-­‐-­‐-­‐-­‐ 
<1> 
Define 
the 
class 
<2> 
Properties 
<3> 
Business 
methods 
#devoxx #asciidoctor_tips @aalmiray
#10 Follow Mr. HAKI’s blog 
• @mrhaki blogs periodically at 
http://mrhaki.blogspot.ch/search/label/Asciidoc 
! 
• Lots of useful tricks and exercises on brand new features 
#devoxx #asciidoctor_tips @aalmiray
10 Useful Asciidoctor Tips 
Andres Almiray 
Canoo Engineering AG 
#devoxx #asciidoctor_tips @aalmiray

Contenu connexe

Tendances

σεναριο στη νεοελληνικη λογοτεχνια
σεναριο στη νεοελληνικη λογοτεχνιασεναριο στη νεοελληνικη λογοτεχνια
σεναριο στη νεοελληνικη λογοτεχνια
guestd393f54c
 
δημοκα 2
δημοκα 2δημοκα 2
δημοκα 2
stratism
 
ερωφίλη ,σχέδιο μαθήματος
ερωφίλη  ,σχέδιο μαθήματοςερωφίλη  ,σχέδιο μαθήματος
ερωφίλη ,σχέδιο μαθήματος
artedinou
 
China’s government and some literature
China’s government and some literatureChina’s government and some literature
China’s government and some literature
Donahbelle Suarez
 
παρουσίαση γιούγκερμαν.μ.καραγάτσης
παρουσίαση γιούγκερμαν.μ.καραγάτσηςπαρουσίαση γιούγκερμαν.μ.καραγάτσης
παρουσίαση γιούγκερμαν.μ.καραγάτσης
Maria Ten
 
ΔΕΙΓΜΑΤΙΚΗ ΔΙΔΑΣΚΑΛΙΑ ΣΤΟ ΜΑΘΗΜΑ ΤΩΝ ΑΡΧΑΙΩΝ ΕΛΛΗΝΙΚΩΝ. 2011-2012
ΔΕΙΓΜΑΤΙΚΗ ΔΙΔΑΣΚΑΛΙΑ ΣΤΟ ΜΑΘΗΜΑ ΤΩΝ ΑΡΧΑΙΩΝ ΕΛΛΗΝΙΚΩΝ.  2011-2012ΔΕΙΓΜΑΤΙΚΗ ΔΙΔΑΣΚΑΛΙΑ ΣΤΟ ΜΑΘΗΜΑ ΤΩΝ ΑΡΧΑΙΩΝ ΕΛΛΗΝΙΚΩΝ.  2011-2012
ΔΕΙΓΜΑΤΙΚΗ ΔΙΔΑΣΚΑΛΙΑ ΣΤΟ ΜΑΘΗΜΑ ΤΩΝ ΑΡΧΑΙΩΝ ΕΛΛΗΝΙΚΩΝ. 2011-2012
Εύα Ζαρκογιάννη
 
Ο Γόρδιος δεσμός. Διδακτικό σενάριο_Ζήση Θ.-Ξάνθη Γ.-Παλιούρα Μ.
Ο Γόρδιος δεσμός. Διδακτικό σενάριο_Ζήση Θ.-Ξάνθη Γ.-Παλιούρα Μ.Ο Γόρδιος δεσμός. Διδακτικό σενάριο_Ζήση Θ.-Ξάνθη Γ.-Παλιούρα Μ.
Ο Γόρδιος δεσμός. Διδακτικό σενάριο_Ζήση Θ.-Ξάνθη Γ.-Παλιούρα Μ.
Μεταξούλα Μανικάρου
 
"ΤΑΞΙΔΙ ΣΤΗ ΣΕΛΗΝΗ: Από το Λουκιανό, τον Ιούλιο Βερν μέχρι σήμερα: Επιστημονι...
"ΤΑΞΙΔΙ ΣΤΗ ΣΕΛΗΝΗ: Από το Λουκιανό, τον Ιούλιο Βερν μέχρι σήμερα: Επιστημονι..."ΤΑΞΙΔΙ ΣΤΗ ΣΕΛΗΝΗ: Από το Λουκιανό, τον Ιούλιο Βερν μέχρι σήμερα: Επιστημονι...
"ΤΑΞΙΔΙ ΣΤΗ ΣΕΛΗΝΗ: Από το Λουκιανό, τον Ιούλιο Βερν μέχρι σήμερα: Επιστημονι...
Georgia Pantidou
 
Ειρήνη- πόλεμος
Ειρήνη- πόλεμοςΕιρήνη- πόλεμος
Ειρήνη- πόλεμος
sofiaspy
 

Tendances (17)

σεναριο στη νεοελληνικη λογοτεχνια
σεναριο στη νεοελληνικη λογοτεχνιασεναριο στη νεοελληνικη λογοτεχνια
σεναριο στη νεοελληνικη λογοτεχνια
 
δημοκα 2
δημοκα 2δημοκα 2
δημοκα 2
 
ερωφίλη ,σχέδιο μαθήματος
ερωφίλη  ,σχέδιο μαθήματοςερωφίλη  ,σχέδιο μαθήματος
ερωφίλη ,σχέδιο μαθήματος
 
ΣΥΛΛΟΓΙΣΤΙΚΗ ΠΟΡΕΙΑ ΠΑΡΑΓΡΑΦΟΥ ΚΑΙ ΑΝΑΠΤΥΞΗ ΦΡΑΣΗΣ ΣΕ ΠΑΡΑΓΡΑΦΟ
ΣΥΛΛΟΓΙΣΤΙΚΗ ΠΟΡΕΙΑ ΠΑΡΑΓΡΑΦΟΥ ΚΑΙ ΑΝΑΠΤΥΞΗ ΦΡΑΣΗΣ ΣΕ ΠΑΡΑΓΡΑΦΟΣΥΛΛΟΓΙΣΤΙΚΗ ΠΟΡΕΙΑ ΠΑΡΑΓΡΑΦΟΥ ΚΑΙ ΑΝΑΠΤΥΞΗ ΦΡΑΣΗΣ ΣΕ ΠΑΡΑΓΡΑΦΟ
ΣΥΛΛΟΓΙΣΤΙΚΗ ΠΟΡΕΙΑ ΠΑΡΑΓΡΑΦΟΥ ΚΑΙ ΑΝΑΠΤΥΞΗ ΦΡΑΣΗΣ ΣΕ ΠΑΡΑΓΡΑΦΟ
 
China’s government and some literature
China’s government and some literatureChina’s government and some literature
China’s government and some literature
 
Senario υπερρεαλισμος
Senario υπερρεαλισμοςSenario υπερρεαλισμος
Senario υπερρεαλισμος
 
παρουσίαση γιούγκερμαν.μ.καραγάτσης
παρουσίαση γιούγκερμαν.μ.καραγάτσηςπαρουσίαση γιούγκερμαν.μ.καραγάτσης
παρουσίαση γιούγκερμαν.μ.καραγάτσης
 
Λογοτεχνία Α' Λυκείου
Λογοτεχνία Α' ΛυκείουΛογοτεχνία Α' Λυκείου
Λογοτεχνία Α' Λυκείου
 
Στέλλα Βιολάντη
Στέλλα ΒιολάντηΣτέλλα Βιολάντη
Στέλλα Βιολάντη
 
ΔΕΙΓΜΑΤΙΚΗ ΔΙΔΑΣΚΑΛΙΑ ΣΤΟ ΜΑΘΗΜΑ ΤΩΝ ΑΡΧΑΙΩΝ ΕΛΛΗΝΙΚΩΝ. 2011-2012
ΔΕΙΓΜΑΤΙΚΗ ΔΙΔΑΣΚΑΛΙΑ ΣΤΟ ΜΑΘΗΜΑ ΤΩΝ ΑΡΧΑΙΩΝ ΕΛΛΗΝΙΚΩΝ.  2011-2012ΔΕΙΓΜΑΤΙΚΗ ΔΙΔΑΣΚΑΛΙΑ ΣΤΟ ΜΑΘΗΜΑ ΤΩΝ ΑΡΧΑΙΩΝ ΕΛΛΗΝΙΚΩΝ.  2011-2012
ΔΕΙΓΜΑΤΙΚΗ ΔΙΔΑΣΚΑΛΙΑ ΣΤΟ ΜΑΘΗΜΑ ΤΩΝ ΑΡΧΑΙΩΝ ΕΛΛΗΝΙΚΩΝ. 2011-2012
 
Ο Γόρδιος δεσμός. Διδακτικό σενάριο_Ζήση Θ.-Ξάνθη Γ.-Παλιούρα Μ.
Ο Γόρδιος δεσμός. Διδακτικό σενάριο_Ζήση Θ.-Ξάνθη Γ.-Παλιούρα Μ.Ο Γόρδιος δεσμός. Διδακτικό σενάριο_Ζήση Θ.-Ξάνθη Γ.-Παλιούρα Μ.
Ο Γόρδιος δεσμός. Διδακτικό σενάριο_Ζήση Θ.-Ξάνθη Γ.-Παλιούρα Μ.
 
"ΤΑΞΙΔΙ ΣΤΗ ΣΕΛΗΝΗ: Από το Λουκιανό, τον Ιούλιο Βερν μέχρι σήμερα: Επιστημονι...
"ΤΑΞΙΔΙ ΣΤΗ ΣΕΛΗΝΗ: Από το Λουκιανό, τον Ιούλιο Βερν μέχρι σήμερα: Επιστημονι..."ΤΑΞΙΔΙ ΣΤΗ ΣΕΛΗΝΗ: Από το Λουκιανό, τον Ιούλιο Βερν μέχρι σήμερα: Επιστημονι...
"ΤΑΞΙΔΙ ΣΤΗ ΣΕΛΗΝΗ: Από το Λουκιανό, τον Ιούλιο Βερν μέχρι σήμερα: Επιστημονι...
 
αφηγηση
αφηγησηαφηγηση
αφηγηση
 
Θεματογραφία Β' Λυκείου, Λυσία, Υπέρ αδυνάτου, 1 3
Θεματογραφία Β' Λυκείου, Λυσία, Υπέρ αδυνάτου, 1   3Θεματογραφία Β' Λυκείου, Λυσία, Υπέρ αδυνάτου, 1   3
Θεματογραφία Β' Λυκείου, Λυσία, Υπέρ αδυνάτου, 1 3
 
Θερμοπύλες (2015) Γ΄4
Θερμοπύλες (2015) Γ΄4Θερμοπύλες (2015) Γ΄4
Θερμοπύλες (2015) Γ΄4
 
Ειρήνη- πόλεμος
Ειρήνη- πόλεμοςΕιρήνη- πόλεμος
Ειρήνη- πόλεμος
 
Συντακτικό αρχαίων ελληνικών - Κατηγορούμενο
Συντακτικό αρχαίων ελληνικών - ΚατηγορούμενοΣυντακτικό αρχαίων ελληνικών - Κατηγορούμενο
Συντακτικό αρχαίων ελληνικών - Κατηγορούμενο
 

En vedette

Дизайн REST API для высокопроизводительных систем / Александр Лебедев (Новые ...
Дизайн REST API для высокопроизводительных систем / Александр Лебедев (Новые ...Дизайн REST API для высокопроизводительных систем / Александр Лебедев (Новые ...
Дизайн REST API для высокопроизводительных систем / Александр Лебедев (Новые ...
Ontico
 

En vedette (20)

Asciidoctor, because documentation does not have to suck
Asciidoctor, because documentation does not have to suckAsciidoctor, because documentation does not have to suck
Asciidoctor, because documentation does not have to suck
 
Document like the Spring team using Asciidoctor
Document like the Spring  team using AsciidoctorDocument like the Spring  team using Asciidoctor
Document like the Spring team using Asciidoctor
 
Documentation brought to life: Asciidoctor & Gradle (Greach 2015)
Documentation brought to life: Asciidoctor & Gradle (Greach 2015)Documentation brought to life: Asciidoctor & Gradle (Greach 2015)
Documentation brought to life: Asciidoctor & Gradle (Greach 2015)
 
Zurich 2016 eclipse demo camp - asciidoc and docker
Zurich 2016 eclipse demo camp - asciidoc and dockerZurich 2016 eclipse demo camp - asciidoc and docker
Zurich 2016 eclipse demo camp - asciidoc and docker
 
Mule scopes async_scope
Mule scopes async_scopeMule scopes async_scope
Mule scopes async_scope
 
Mule mel 3
Mule mel 3Mule mel 3
Mule mel 3
 
Variables in dataweave
Variables in dataweaveVariables in dataweave
Variables in dataweave
 
Mule data weave_10
Mule data weave_10Mule data weave_10
Mule data weave_10
 
Mule data weave_7
Mule data weave_7Mule data weave_7
Mule data weave_7
 
Des principes de la démarche DevOps à sa mise en oeuvre
Des principes de la démarche DevOps à sa mise en oeuvreDes principes de la démarche DevOps à sa mise en oeuvre
Des principes de la démarche DevOps à sa mise en oeuvre
 
Mule soft mel_session_3
Mule soft mel_session_3Mule soft mel_session_3
Mule soft mel_session_3
 
Packaging et déploiement d'une application avec Docker et Ansible @DevoxxFR 2015
Packaging et déploiement d'une application avec Docker et Ansible @DevoxxFR 2015Packaging et déploiement d'une application avec Docker et Ansible @DevoxxFR 2015
Packaging et déploiement d'une application avec Docker et Ansible @DevoxxFR 2015
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
DevOps avec Ansible et Docker
DevOps avec Ansible et DockerDevOps avec Ansible et Docker
DevOps avec Ansible et Docker
 
Ansible 2.0 のサマライズとこれから
Ansible 2.0 のサマライズとこれからAnsible 2.0 のサマライズとこれから
Ansible 2.0 のサマライズとこれから
 
Better documentation with asciidoc and asciidoctor
Better documentation with asciidoc and asciidoctorBetter documentation with asciidoc and asciidoctor
Better documentation with asciidoc and asciidoctor
 
Дизайн REST API для высокопроизводительных систем / Александр Лебедев (Новые ...
Дизайн REST API для высокопроизводительных систем / Александр Лебедев (Новые ...Дизайн REST API для высокопроизводительных систем / Александр Лебедев (Новые ...
Дизайн REST API для высокопроизводительных систем / Александр Лебедев (Новые ...
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
reveal.js 3.0.0
reveal.js 3.0.0reveal.js 3.0.0
reveal.js 3.0.0
 
Jumelage de l'ochv et la roue libre
Jumelage de l'ochv et la roue libreJumelage de l'ochv et la roue libre
Jumelage de l'ochv et la roue libre
 

Similaire à 10 Useful Asciidoctor Tips

Front End Good Practices
Front End Good PracticesFront End Good Practices
Front End Good Practices
Hernan Mammana
 

Similaire à 10 Useful Asciidoctor Tips (20)

BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best Practices
 
Ci2
Ci2Ci2
Ci2
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
 
Front End Development for Back End Developers - Devoxx UK 2017
 Front End Development for Back End Developers - Devoxx UK 2017 Front End Development for Back End Developers - Devoxx UK 2017
Front End Development for Back End Developers - Devoxx UK 2017
 
Kohana 3.2 documentation
Kohana 3.2 documentationKohana 3.2 documentation
Kohana 3.2 documentation
 
Web components the future is here
Web components   the future is hereWeb components   the future is here
Web components the future is here
 
OWASP SF - Reviewing Modern JavaScript Applications
OWASP SF - Reviewing Modern JavaScript ApplicationsOWASP SF - Reviewing Modern JavaScript Applications
OWASP SF - Reviewing Modern JavaScript Applications
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
How to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHPHow to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHP
 
Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 
Getting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalGetting Started With Jenkins And Drupal
Getting Started With Jenkins And Drupal
 
PLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in GrailsPLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in Grails
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017
 
Intro to html5 Boilerplate
Intro to html5 BoilerplateIntro to html5 Boilerplate
Intro to html5 Boilerplate
 
Front End Good Practices
Front End Good PracticesFront End Good Practices
Front End Good Practices
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web Performance
 
Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010
 
Developing Liferay Plugins with Maven
Developing Liferay Plugins with MavenDeveloping Liferay Plugins with Maven
Developing Liferay Plugins with Maven
 

Plus de Andres Almiray

Plus de Andres Almiray (20)

Creando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abiertoCreando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abierto
 
Liberando a produccion con confianza
Liberando a produccion con confianzaLiberando a produccion con confianza
Liberando a produccion con confianza
 
Liberando a produccion con confidencia
Liberando a produccion con confidenciaLiberando a produccion con confidencia
Liberando a produccion con confidencia
 
OracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java DevelopersOracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java Developers
 
Softcon.ph - Maven Puzzlers
Softcon.ph - Maven PuzzlersSoftcon.ph - Maven Puzzlers
Softcon.ph - Maven Puzzlers
 
Maven Puzzlers
Maven PuzzlersMaven Puzzlers
Maven Puzzlers
 
Oracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java DevelopersOracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java Developers
 
JReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of lightJReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of light
 
Building modular applications with the Java Platform Module System and Layrry
Building modular applications with the Java Platform Module System and LayrryBuilding modular applications with the Java Platform Module System and Layrry
Building modular applications with the Java Platform Module System and Layrry
 
Going Reactive with g rpc
Going Reactive with g rpcGoing Reactive with g rpc
Going Reactive with g rpc
 
Building modular applications with JPMS and Layrry
Building modular applications with JPMS and LayrryBuilding modular applications with JPMS and Layrry
Building modular applications with JPMS and Layrry
 
Taking Micronaut out for a spin
Taking Micronaut out for a spinTaking Micronaut out for a spin
Taking Micronaut out for a spin
 
Apache Groovy's Metaprogramming Options and You
Apache Groovy's Metaprogramming Options and YouApache Groovy's Metaprogramming Options and You
Apache Groovy's Metaprogramming Options and You
 
What I wish I knew about Maven years ago
What I wish I knew about Maven years agoWhat I wish I knew about Maven years ago
What I wish I knew about Maven years ago
 
What I wish I knew about maven years ago
What I wish I knew about maven years agoWhat I wish I knew about maven years ago
What I wish I knew about maven years ago
 
The impact of sci fi in tech
The impact of sci fi in techThe impact of sci fi in tech
The impact of sci fi in tech
 
Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019
 
Creating Better Builds with Gradle
Creating Better Builds with GradleCreating Better Builds with Gradle
Creating Better Builds with Gradle
 
Interacting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with GradleInteracting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with Gradle
 
Gradle ex-machina
Gradle ex-machinaGradle ex-machina
Gradle ex-machina
 

10 Useful Asciidoctor Tips

  • 1. 10 Useful Asciidoctor Tips Andres Almiray Canoo Engineering AG #devoxx #asciidoctor_tips @aalmiray
  • 3. #1 Live Reload + Browser Extension • http://livereload.com/ ! • https://github.com/asciidoctor/asciidoctor-chrome-extension ! • https://github.com/asciidoctor/asciidoctor-firefox-addon #devoxx #asciidoctor_tips @aalmiray
  • 4. #2 Build Tool integration • https://github.com/asciidoctor/asciidoctor-maven-plugin ! • https://github.com/asciidoctor/asciidoctor-gradle-plugin ! • https://github.com/aalmiray/livereload-gradle-plugin #devoxx #asciidoctor_tips @aalmiray
  • 5. #3 Provide a _links.adoc file • Use an attribute per link • Include the _links.adoc file at the beginning of your index file // _links.adoc :link_gradle: http://www.gradle.org/[Gradle, window="_blank"] :link_maven: http://maven.apache.org/[Maven, window="_blank"] // index.adoc include::_links.adoc[] ! Asciidoctor has great integration with {link_gradle} and {link_maven}. #devoxx #asciidoctor_tips @aalmiray
  • 6. #4 Blank lines at top and bottom • Simplifies including files into others // without blank lines // with blank lines // index.adoc // index.adoc ! ! include::chapter1.adoc[] include::chapter1.adoc[] ! include::chapter2.adoc[] include::chapter2.adoc[] include::chapter3.adoc[] ! include::chapter3.adoc[] #devoxx #asciidoctor_tips @aalmiray
  • 7. #5 Comment your documentation! • Yes, comments on documentation ;-) = Chapter Title The following chapter discusses lorem ipsum dolor sit amet consecutur ad nauseam. // IDEA: insert a lorem ipsum generator here? ! Lorem ipsum dolor sit amet consecutur. Lorem ipsum dolor sit amet consecutur. Lorem ipsum dolor sit amet consecutur. Lorem ipsum dolor sit amet consecutur. ! //// Why build a custom lorem-­‐ipsum extension when copy&paste is so cheap? No need to tire those cell brains. Oh look, beer! //// #devoxx #asciidoctor_tips @aalmiray
  • 8. #6 Use conditional blocks • ifdef::attribute_name[] checks if attribute has a value • ifndef::attribute_name[] performs the opposite check • ifeval::[{attribute_name} > 2] evaluates the attribute ! • You can surround blocks if ifdef/ifndef/ifeval & endif • These are great for conditionally rendering content based on build variables (see tip #2). #devoxx #asciidoctor_tips @aalmiray
  • 9. #7 Callouts in paragraphs • Apply the following inside any paragraph [conum,data-value=2]_2_ where 2 can be any number ! • Reverse engineered from <em class="conum">2</em> #devoxx #asciidoctor_tips @aalmiray
  • 10. #8 Include Raw Content • Either use the pass:[] macro or the ++++ block pass:[<iframe src=“http://secr.et/not/a/malicious/page/honest.html”></iframe>] ! ++++ <script type="text/javascript"> var pageTracker = _gat._getTracker("XX-­‐123456-­‐1"); pageTracker._initData(); pageTracker._trackPageview(); </script> ++++ #devoxx #asciidoctor_tips @aalmiray
  • 11. #9 The Include Macro is Awesome • Include any file. • Apply call outs in source code. Use standard code comments • Change indentation; include certain lines, tags .src/main/java/sample/Foo.java [source,java,linenums,options="nowrap"] -­‐-­‐-­‐-­‐ include::{rootdir}/src/main/java/sample/Foo.java[lines=16..-­‐1] -­‐-­‐-­‐-­‐ <1> Define the class <2> Properties <3> Business methods #devoxx #asciidoctor_tips @aalmiray
  • 12. #10 Follow Mr. HAKI’s blog • @mrhaki blogs periodically at http://mrhaki.blogspot.ch/search/label/Asciidoc ! • Lots of useful tricks and exercises on brand new features #devoxx #asciidoctor_tips @aalmiray
  • 13. 10 Useful Asciidoctor Tips Andres Almiray Canoo Engineering AG #devoxx #asciidoctor_tips @aalmiray