{"id":3386,"date":"2018-01-24T17:18:57","date_gmt":"2018-01-24T15:18:57","guid":{"rendered":"https:\/\/www.systemcodegeeks.com\/?p=3386"},"modified":"2018-01-24T10:23:22","modified_gmt":"2018-01-24T08:23:22","slug":"asciidoc-asciidoc-exploding-includes","status":"publish","type":"post","link":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/","title":{"rendered":"Asciidoc to Asciidoc: Exploding includes"},"content":{"rendered":"<p>One of my favourite features in <a href=\"http:\/\/asciidoctor.org\/docs\/asciidoc-syntax-quick-reference\/#include-files\">AsciiDoc<\/a> is the ability to include other files, but when using lots of includes is that it becomes difficult to read the whole document unless you convert it to one of the supported backends.<\/p>\n<pre class=\"brush:bash\">$ asciidoctor --help\r\nUsage: asciidoctor [OPTION]... FILE...\r\nTranslate the AsciiDoc source FILE or FILE(s) into the backend output format (e.g., HTML 5, DocBook 4.5, etc.)\r\nBy default, the output is written to a file with the basename of the source file and the appropriate extension.\r\nExample: asciidoctor -b html5 source.asciidoc\r\n\u00a0\r\n    -b, --backend BACKEND            set output format backend: [html5, xhtml5, docbook5, docbook45, manpage] (default: html5)\r\n                                     additional backends are supported via extensions (e.g., pdf, latex)<\/pre>\n<p>I don\u2019t want to have to convert my code to one of these formats each time \u2013 I want to convert asciidoc to asciidoc!<\/p>\n<p>For example, given the following files:<\/p>\n<p><cite>mydoc.adoc<\/cite><\/p>\n<pre class=\"brush:text\">= My Blog example\r\n\u00a0\r\n== Heading 1\r\n\u00a0\r\nSome awesome text\r\n\u00a0\r\n== Heading 2\r\n\u00a0\r\ninclude::blog_include.adoc[]<\/pre>\n<pre class=\"brush:text\">Some included text<\/pre>\n<p>I want to generate another asciidoc file where the contents of the include file are exploded and displayed inline.<\/p>\n<p>After a lot of searching I came across <a>an excellent script<\/a> written by Dan Allen and put it in a file called <cite>adoc.rb<\/cite>. We can then call it like this:<\/p>\n<pre class=\"brush:bash\">$ ruby adoc.rb mydoc.adoc\r\n= My Blog example\r\n\u00a0\r\n== Heading 1\r\n\u00a0\r\nSome awesome text\r\n\u00a0\r\n== Heading 2\r\n\u00a0\r\nSome included text<\/pre>\n<p>Problem solved!<\/p>\n<p>In my case I actually wanted to explode HTTP includes so I needed to pass the <cite>-a allow-uri-read<\/cite> flag to the script:<\/p>\n<pre class=\"brush:bash\">$ ruby adoc.rb mydoc.adoc -a allow-uri-read<\/pre>\n<p>And now I can generate asciidoc files until my heart\u2019s content.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>Published on System Code Geeks with permission by Mark Needham, partner at our <a href=\"http:\/\/www.systemcodegeeks.com\/join-us\/scg\/\" target=\"_blank\" rel=\"noopener\">SCG program<\/a>. See the original article here: <a href=\"http:\/\/www.markhneedham.com\/blog\/2018\/01\/23\/asciidoc-asciidoc-exploding-includes\/\" target=\"_blank\" rel=\"noopener\">Asciidoc to Asciidoc: Exploding includes<\/a><\/p>\n<p>Opinions expressed by System Code Geeks contributors are their own.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>One of my favourite features in AsciiDoc is the ability to include other files, but when using lots of includes is that it becomes difficult to read the whole document unless you convert it to one of the supported backends. $ asciidoctor &#8211;help Usage: asciidoctor [OPTION]&#8230; FILE&#8230; Translate the AsciiDoc source FILE or FILE(s) into &hellip;<\/p>\n","protected":false},"author":29,"featured_media":185,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-3386","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shell-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Asciidoc to Asciidoc: Exploding includes - System Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"One of my favourite features in AsciiDoc is the ability to include other files, but when using lots of includes is that it becomes difficult to read the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Asciidoc to Asciidoc: Exploding includes - System Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"One of my favourite features in AsciiDoc is the ability to include other files, but when using lots of includes is that it becomes difficult to read the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/\" \/>\n<meta property=\"og:site_name\" content=\"System Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/systemcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-24T15:18:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Mark Needham\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@systemcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@systemcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mark Needham\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/\"},\"author\":{\"name\":\"Mark Needham\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/ae1c58c8f59ab2d33fc598b0ad933eb4\"},\"headline\":\"Asciidoc to Asciidoc: Exploding includes\",\"datePublished\":\"2018-01-24T15:18:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/\"},\"wordCount\":198,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"articleSection\":[\"Shell Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/\",\"name\":\"Asciidoc to Asciidoc: Exploding includes - System Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"datePublished\":\"2018-01-24T15:18:57+00:00\",\"description\":\"One of my favourite features in AsciiDoc is the ability to include other files, but when using lots of includes is that it becomes difficult to read the\",\"breadcrumb\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#primaryimage\",\"url\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"contentUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.systemcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Shell Scripting\",\"item\":\"https:\/\/www.systemcodegeeks.com\/category\/shell-scripting\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Asciidoc to Asciidoc: Exploding includes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\",\"url\":\"https:\/\/www.systemcodegeeks.com\/\",\"name\":\"System Code Geeks\",\"description\":\"Operating System Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.systemcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.systemcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/systemcodegeeks\",\"https:\/\/x.com\/systemcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/ae1c58c8f59ab2d33fc598b0ad933eb4\",\"name\":\"Mark Needham\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5489baed26ce2d932bf951ecfb47afe80bec45d3648c23521d87c83b8f1c3ea9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5489baed26ce2d932bf951ecfb47afe80bec45d3648c23521d87c83b8f1c3ea9?s=96&d=mm&r=g\",\"caption\":\"Mark Needham\"},\"sameAs\":[\"http:\/\/www.markhneedham.com\/blog\/\"],\"url\":\"https:\/\/www.systemcodegeeks.com\/author\/mark-needham\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Asciidoc to Asciidoc: Exploding includes - System Code Geeks - 2026","description":"One of my favourite features in AsciiDoc is the ability to include other files, but when using lots of includes is that it becomes difficult to read the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/","og_locale":"en_US","og_type":"article","og_title":"Asciidoc to Asciidoc: Exploding includes - System Code Geeks - 2026","og_description":"One of my favourite features in AsciiDoc is the ability to include other files, but when using lots of includes is that it becomes difficult to read the","og_url":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/","og_site_name":"System Code Geeks","article_publisher":"https:\/\/www.facebook.com\/systemcodegeeks","article_published_time":"2018-01-24T15:18:57+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","type":"image\/jpeg"}],"author":"Mark Needham","twitter_card":"summary_large_image","twitter_creator":"@systemcodegeeks","twitter_site":"@systemcodegeeks","twitter_misc":{"Written by":"Mark Needham","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#article","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/"},"author":{"name":"Mark Needham","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/ae1c58c8f59ab2d33fc598b0ad933eb4"},"headline":"Asciidoc to Asciidoc: Exploding includes","datePublished":"2018-01-24T15:18:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/"},"wordCount":198,"commentCount":0,"publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","articleSection":["Shell Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/","url":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/","name":"Asciidoc to Asciidoc: Exploding includes - System Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#primaryimage"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","datePublished":"2018-01-24T15:18:57+00:00","description":"One of my favourite features in AsciiDoc is the ability to include other files, but when using lots of includes is that it becomes difficult to read the","breadcrumb":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#primaryimage","url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","contentUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/asciidoc-asciidoc-exploding-includes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.systemcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Shell Scripting","item":"https:\/\/www.systemcodegeeks.com\/category\/shell-scripting\/"},{"@type":"ListItem","position":3,"name":"Asciidoc to Asciidoc: Exploding includes"}]},{"@type":"WebSite","@id":"https:\/\/www.systemcodegeeks.com\/#website","url":"https:\/\/www.systemcodegeeks.com\/","name":"System Code Geeks","description":"Operating System Developers Resource Center","publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.systemcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.systemcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.systemcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/systemcodegeeks","https:\/\/x.com\/systemcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/ae1c58c8f59ab2d33fc598b0ad933eb4","name":"Mark Needham","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5489baed26ce2d932bf951ecfb47afe80bec45d3648c23521d87c83b8f1c3ea9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5489baed26ce2d932bf951ecfb47afe80bec45d3648c23521d87c83b8f1c3ea9?s=96&d=mm&r=g","caption":"Mark Needham"},"sameAs":["http:\/\/www.markhneedham.com\/blog\/"],"url":"https:\/\/www.systemcodegeeks.com\/author\/mark-needham\/"}]}},"_links":{"self":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/3386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/comments?post=3386"}],"version-history":[{"count":0,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/3386\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/media\/185"}],"wp:attachment":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/media?parent=3386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/categories?post=3386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/tags?post=3386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}