{"id":502,"date":"2020-10-22T16:16:41","date_gmt":"2020-10-22T14:16:41","guid":{"rendered":"https:\/\/nguenkam.com\/blog\/?p=502"},"modified":"2020-11-11T10:25:09","modified_gmt":"2020-11-11T09:25:09","slug":"asciidoc-code-documentation","status":"publish","type":"post","link":"https:\/\/nguenkam.com\/blog\/index.php\/2020\/10\/22\/asciidoc-code-documentation\/","title":{"rendered":"AsciiDoc, Code documentation"},"content":{"rendered":"\n<p>AsciiDoc is a text document format for writing notes, documentation, articles, books, ebooks, slideshows, web pages, man pages and blogs. AsciiDoc files can be translated to many formats including HTML, PDF, EPUB, man page.<\/p>\n\n\n\n<p>Any text editor can be used. Some websites, like Github, render AsciiDoc files directly into HTML.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>To get use on it, We can refer trough an IDE with the corresponding plugin, or we have to install it localy on the computer. <\/p><\/blockquote>\n\n\n\n<h4><span class=\"has-inline-color has-vivid-red-color\">IntelliJ AsciiDoc Plugin<\/span><\/h4>\n\n\n\n<p>A plugin for the IntelliJ platform (IntelliJ IDEA, RubyMine, etc.) that provides support for the&nbsp;<a href=\"http:\/\/www.asciidoc.org\/\">AsciiDoc<\/a>&nbsp;markup language. It also supports&nbsp;<a href=\"https:\/\/antora.org\/\">Antora<\/a>, the documentation CMS build with AsciiDoc.<\/p>\n\n\n\n<p>You can install the plugin (named \u201cAsciiDoc\u201d) from the plugins section inside your JetBrains IDE or download it from the&nbsp;<a href=\"https:\/\/plugins.jetbrains.com\/plugin\/7391\">JetBrains Plugin Repository<\/a>.<\/p>\n\n\n\n<h5 id=\"user-content-features\">Features<\/h5>\n\n\n\n<ul><li>Recognizes the AsciiDoc file extension (.adoc, .asciidoc, .ad)<\/li><li>Provides a two-pane AsciiDoc preview editor based on&nbsp;<a href=\"https:\/\/github.com\/asciidoctor\/asciidoctorj\">AsciidoctorJ<\/a>&nbsp;with live preview.<\/li><li>Toolbar and context menu for basic formatting and to create tables.<\/li><li>Refactor Markdown to AsciiDoc: Right click on a file, or use the Refactor menu, and the Markdown document will be replaced by the AsciiDoc equivalent. Also, supports undo if the user is not happy with the result!<\/li><\/ul>\n\n\n\n<h4><span class=\"has-inline-color has-vivid-red-color\">AsciiDoc Installation<\/span><\/h4>\n\n\n\n<p><\/p>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Installing from the GitHub repository<\/span><\/h5>\n\n\n\n<p>The AsciiDoc repository is hosted by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a>. To browse the repository go to&nbsp;<a href=\"https:\/\/github.com\/asciidoc\/asciidoc-py3\">https:\/\/github.com\/asciidoc\/asciidoc-py3<\/a>. You can install AsciiDoc from the repository if you don\u2019t have an up to date packaged version, or you want to get the latest version from the master branch:<\/p>\n\n\n\n<ul><li>Make sure you have&nbsp;<a href=\"https:\/\/git-scm.com\/\">Git<\/a>&nbsp;installed; you can check with:<code>$ git --version<\/code><\/li><li>Go to the directory you want to install AsciiDoc into and download the repository. This example gets the 9.0.3 tagged release:<code>$ cd ~\/bin $ git clone https:\/\/github.com\/asciidoc\/asciidoc-py3 asciidoc-9.0.3 $ git checkout 9.0.3<\/code><\/li><\/ul>\n\n\n\n<p>You now have two choices: you can run asciidoc locally from your repository or you can use&nbsp;<em>autoconf(1)<\/em>&nbsp;and&nbsp;<em>make(1)<\/em>&nbsp;to perform a system-wide install.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Running asciidoc from your local copy<\/span><\/h5>\n\n\n\n<p>Create a symlink to the AsciiDoc script in a search&nbsp;<code>PATH<\/code>&nbsp;directory so it\u2019s easy to execute&nbsp;<code>asciidoc<\/code>&nbsp;from the command line, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ln -s ~\/bin\/asciidoc-9.0.3\/asciidoc.py ~\/bin\/asciidoc\n$ ln -s ~\/bin\/asciidoc-9.0.3\/a2x.py ~\/bin\/a2x<\/code><\/pre>\n\n\n\n<p>Use the git&nbsp;<code>pull<\/code>&nbsp;command to update your local AsciiDoc repository.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Installing asciidoc for all users<\/span><\/h5>\n\n\n\n<p>Create&nbsp;<code>configure<\/code>&nbsp;using&nbsp;<em>autoconf(1)<\/em>; use&nbsp;<code>configure<\/code>&nbsp;to create the&nbsp;<code>Makefile<\/code>; run&nbsp;<em>make(1)<\/em>; build the man pages; install:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ autoconf\n$ .\/configure\n$ make\n$ sudo make install<\/code><\/pre>\n\n\n\n<p>To uninstall:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo make uninstall<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Prepackaged AsciiDoc installation<\/span><\/h5>\n\n\n\n<p>The following platform-specific AsciiDoc packages are available:<\/p>\n\n\n\n<p><strong><span class=\"has-inline-color has-vivid-purple-color\">Fedora Linux<\/span><\/strong><\/p>\n\n\n\n<p>AsciiDoc is included in Fedora Extras, which is available in the default Fedora installation. To install asciidoc, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ yum install asciidoc<\/code><\/pre>\n\n\n\n<p><strong><span class=\"has-inline-color has-vivid-purple-color\">Ubuntu \/ Debian<\/span><\/strong><\/p>\n\n\n\n<p>AsciiDoc is included in Ubuntu \/ Debian package manager. To install, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ apt install asciidoc<\/code><\/pre>\n\n\n\n<p><strong><span class=\"has-inline-color has-vivid-purple-color\">macOS Homebrew<\/span><\/strong><\/p>\n\n\n\n<p>AsciiDoc has been packaged in homebrew and is installable using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ brew install asciidoc<\/code><\/pre>\n\n\n\n<p>See also&nbsp;<a href=\"https:\/\/asciidoc.org\/userguide.html#X38\">Packager Notes<\/a>&nbsp;in the&nbsp;<em>AsciiDoc User Guide<\/em>.<\/p>\n\n\n\n<h4><span class=\"has-inline-color has-vivid-red-color\">Overview and Examples<\/span><\/h4>\n\n\n\n<p>You write an AsciiDoc document the same way you would write a normal text document, there are no markup tags or weird format notations. AsciiDoc files are designed to be viewed, edited and printed directly or translated to other presentation formats using the&nbsp;<code>asciidoc(1)<\/code>&nbsp;command.<\/p>\n\n\n\n<p>The&nbsp;<code>asciidoc(1)<\/code>&nbsp;command translates AsciiDoc files to HTML, XHTML and DocBook markups. DocBook can be post-processed to presentation formats such as HTML, PDF, EPUB, DVI, LaTeX, roff, and Postscript using readily available Open Source tools.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 id=\"_example_articles\"><span class=\"has-inline-color has-vivid-red-color\">Example Articles<\/span><\/h3>\n\n\n\n<ul><li>This XHTML version of the&nbsp;<a href=\"https:\/\/asciidoc.org\/asciidoc.css-embedded.html\">AsciiDoc User Guide<\/a>&nbsp;was generated by AsciiDoc from&nbsp;<a href=\"https:\/\/asciidoc.org\/asciidoc.txt\">this AsciiDoc file<\/a>.<\/li><li>Here\u2019s the&nbsp;<a href=\"https:\/\/asciidoc.org\/asciidoc.html\">same document<\/a>&nbsp;created by first generating DocBook markup using AsciiDoc and then converting the DocBook markup to HTML using&nbsp;<em>DocBook XSL Stylesheets<\/em>.<\/li><li>The User Guide again, this time a&nbsp;<a href=\"https:\/\/asciidoc.org\/chunked\/index.html\">chunked version<\/a>.<\/li><li>AsciiDoc generated this&nbsp;<a href=\"https:\/\/asciidoc.org\/article-standalone.html\">stand-alone HTML file<\/a>&nbsp;containing embedded CSS, JavaScript and images from this&nbsp;<a href=\"https:\/\/asciidoc.org\/article.txt\">AsciiDoc article template<\/a>&nbsp;with this command:<code>asciidoc -a data-uri -a icons -a toc -a max-width=55em article.txt<\/code><\/li><li>The same&nbsp;<a href=\"https:\/\/asciidoc.org\/article.txt\">AsciiDoc article template<\/a>&nbsp;generated&nbsp;<a href=\"https:\/\/asciidoc.org\/article-html5-toc2.html\">this HTML 5<\/a>&nbsp;(the&nbsp;<em>toc2<\/em>&nbsp;attribute puts a table of contents in the left margin) from this command:<code>asciidoc -b html5 -a icons -a toc2 -a theme=flask article.txt<\/code><\/li><li>The same&nbsp;<a href=\"https:\/\/asciidoc.org\/article.txt\">AsciiDoc article template<\/a>&nbsp;produced this&nbsp;<a href=\"https:\/\/asciidoc.org\/article.html\">HTML file<\/a>&nbsp;and this&nbsp;<a href=\"https:\/\/asciidoc.org\/article.pdf\">PDF file<\/a>&nbsp;via DocBook markup generated by AsciiDoc.<\/li><\/ul>\n\n\n\n<h5>Reference:<\/h5>\n\n\n\n<p><a href=\"https:\/\/github.com\/asciidoctor\">https:\/\/github.com\/asciidoctor<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/asciidoctor.org\/\">https:\/\/asciidoctor.org\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/asciidoc.org\/\">https:\/\/asciidoc.org\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AsciiDoc is a text document format for writing notes, documentation, articles, books, ebooks, slideshows, web pages, man pages and blogs. AsciiDoc files can be translated to many formats including HTML, PDF, EPUB, man page. Any text editor can be used. Some websites, like Github, render AsciiDoc files directly into HTML. To get use on it, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":685,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[121,120,122],"_links":{"self":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/502"}],"collection":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=502"}],"version-history":[{"count":15,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/502\/revisions"}],"predecessor-version":[{"id":518,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/502\/revisions\/518"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/685"}],"wp:attachment":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}