EFFECTIVE ASCIIDOC: BEST PRACTICES for WRITING DOCS Dan Allen - @Mojavelinux

EFFECTIVE ASCIIDOC: BEST PRACTICES for WRITING DOCS Dan Allen - @Mojavelinux

EFFECTIVE ASCIIDOC: BEST PRACTICES FOR WRITING DOCS Dan Allen - @mojavelinux | “Writing is a #$%@! ordeal.” — Martijn Dashorst, author of Wicket in Action Q: POURQUOI ? A: STRUCTURE Why Gradle? Broad Platform Support Java & JVM languages Android’s build system …​ Robust Dependency Management Straightforward dependencies …​ Powerful Yet Concise Logic …​ IT’S COMPLEX But it doesn’t have to be. 1. 2. 1000x 4x 1x 4x 7,450x 1x 1x 3. 4. ✗ Bad <class accessibility="public" name="HelloWorld"> <annonymousBlock> <method type="static" accessibility="public" inheritability="final" name="main"> <arguments> <variableArguments name="args" type="java.lang.String"/> </arguments> <annonymousBlock> <methodCall method="println" object="java.lang.System.out"> <argument value="Hello World!" type="java.lang.String"/> ✓ Good ASCIIDOC, C’EST BON ! = Getting Started with Java Author Name <[email protected]> Here's your first Java application. .HelloWorld.java [source,java] ­­­­ public class HelloWorld { public static void main(String args[]) { System.out.println("Hello, world!"); <1> } } ­­­­ <1> Prints "Hello, world!" to the console. Compile this source to a class file using `javac`. Finally, run the compiled class file using `java`. DOCS ≠ CODE ? DOCS = CODE ! ASCIIDOC ASCIIDOCTOR syntax parser + tools edit read version share convert SYNTAX TOUR PARAGRAPHS No special markup is required. A paragraph is just consecutive lines of text. To start a paragraph, offset it by a blank line. HEADINGS = Document Title == Section Level 1 === Section Level 2 ==== Section Level 3 ===== Section Level 4 ====== Section Level 5 = Section Level 0 (book doctype only) LISTS Unordered Ordered * item 1 . item 1 ** sub­item .. sub­item * item 2 . item 2 * item 3 . item 3 INLINE FORMATTING *bold* bold _italic_ italic `<code>` <code> [delete]#custom# custom LINKS http://google.com http://google.com http://google.com[Google] Google See <<syntax­tour>> See Syntax tour <<syntax­tour,Take tour>> Take tour “FENCED” BLOCKS -- open ----, ```, .... listing, source, literal ==== example, admonition **** sidebar ____, "" quote //// comment SOURCE CODE :source­highlighter: coderay [source,java] ­­­­ public class HelloWorld { public static void main(String args[]) { System.out.println("Hello, world!"); <1> } } ­­­­ <1> Prints "Hello, world!" to the console. NOTES NOTE: For your info. WARNING: I wouldn't do that. IMPORTANT: Don't forget! MULTIMEDIA Image image::tux.png[Tux,265,314] Icon icon:heart[2x] Video video::SCZF6I­Rc4I[youtube,853,480] MACROS Inline <name>:<target>[<attributes>] Block <name>::<target>[<attributes>] Concise Consistent Semantic EXTEND IT! Custom syntax (issue:<id>[]) Custom converters (PDF, reveal.js, …​ ) AST transforms EXTENSION EXAMPLE issue:<id>[] asciidoctor { extensions { inlinemacro (name: 'issue') { parent, target, attrs ­> options = [ type: ':link', target: "http://issues/browse/${target}".toString() ] createInline(parent, 'anchor', target, attrs, options).render() } } } TOOLS AsciiDoc GitHub WRITING & EDITING AUTOMATE PUBLISHING Plug into Gradle buildscript { repositories { jcenter() } dependencies { classpath 'org.asciidoctor:asciidoctor­gradle­plugin:1.5.2' } } apply plugin: 'org.asciidoctor.convert' asciidoctor { attributes toc: 'left', icons: 'font' } ZEN WRITING TECHNIQUES #1: SENTENCE PER LINE ⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃. ⁃⁃⁃⁃⁃⁃. ⁃⁃⁃⁃⁃⁃⁃⁃⁃. #2: USE COMMENTS // ignore this line //// drop this whole section //// #3: COUCH READ #4: D.R.Y. ATTRIBUTES :uri­project: http://example.org Find out more about {uri­project}[project name]. AND INCLUDES Shared content include::{uri­macros}/how_to_complete_this_guide.adoc[] Testable source code [source,groovy] ­­­­ include::build.gradle[tag=repositories] ­­­­ #5: ANSWER A QUESTION AUTHORS ASCIIDOCTOR “I can do truly amazing things with my AsciiDoc source…​” “…this​ has very serious and interesting implications for the publishing industry as a whole.” — Scott Chacon, author of Pro Git ILLUSTRATION CRED Sarah White (@carbonfray).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    57 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us