• 7
    • 2
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      Feature Summary

      Support Asciidoctor-backed AsciiDoc in:

      The unicorns and rainbows solution I'm looking for here is to:

      • Write my docs in AsciiDoc
      • Version Control docs files in Stash
      • Push directly to a confluence node using a "Publish" button. (OH YEAH)

      But I'd honestly just settle for native AsciiDoc (Asciidoctor tooling) support in Stash and the API so I can push easily.

      Challenge

      For me, the way I"m using the Atlassian solution suite is using Stash and AsciiDoc together with Confluence to achieve that elusive writing Zen. That, and I want to single-source my content as much as possible for reuse among the documents I'm writing, and then push the end result to Confluence as a static page.

      The problem is my Zen is being interrupted when I try to push AsciiDoc into Confluence.

      In short: I can't.

      Attempted Workarounds

      As there is no support natively at the moment, I need to use 3rd party Ruby tools to attempt to push content in, but these tools are not really working out (due to enhancements required to these tools - bugs raised).

      When that fails, I need to transform my AsciiDoc files using Asciidoctor and then try to push the HTML directly into the code view of the Editing Window. The problem with that is due to the admonition macros and other rich content stuff Confluence uses, the beautiful Foundation styles and eye-pleasing Admonition blocks are changed to the Confluence style, and look amateurish. Which makes me look amateurish as a Technical Writer.

      One of my DevOps guys has offered to create a buildbox that houses all the Ruby stuff I need to push static HTML into Confluence and listens on Stash Commit Hooks, but that seems overly complex when it would be better to just support AsciiDoc alongside Markdown.

      Final Summary

      Most professional TechComms professionals will tell you that separating content from presentation is the way to writing Zen. Probe Technical Writers further and they'll probably start talking about ways they use a VCS to control their documentation and manage content reuse.

      AsciiDoc is the type of language that Tech Writers use when they are faced with creating complex douments. Many Markdown syntax items (such as admonitions) are a kludge-fest to get working compared to AsciiDoc, and having to do this make Tech Writers stabby and makes their teeth itch.

      Please, help Tech Writers work efficiently and effectively using the Atlassian stack of products in a writing language that supports their advanced writing needs.

            [CONFSERVER-38863] Enable AsciiDoc Support In Confluence and through API

            A tried and test approach is to write docs in Asciidoc, version control them in Bitbucket (or other version control system), and publish the pages to Confluence via Confluence Publisher.

            https://confluence-publisher.atlassian.net/wiki/spaces/CPD/overview?homepageId=315719687

            This approach works amazing well (for me and others).

            Werner Fouché added a comment - A tried and test approach is to write docs in Asciidoc, version control them in Bitbucket (or other version control system), and publish the pages to Confluence via Confluence Publisher. https://confluence-publisher.atlassian.net/wiki/spaces/CPD/overview?homepageId=315719687 This approach works amazing well (for me and others).

            You might want to give our commercial app Include Bitbucket for Confluence a try.

            It provides a Confluence macro to render AsciiDoc files stored in Bitbucket within Confluence pages.

            With that, you have a version-controlled single source of truth, while still being able to render technical documentation with AsciiDoc in Confluence.

            In case you decide to try the app and are missing a feature, please let us know in our Jira.

             

            Michael Rüegg [Mibex Software] added a comment - You might want to give our commercial app Include Bitbucket for Confluence a try. It provides a Confluence macro to render AsciiDoc files stored in Bitbucket within Confluence pages. With that, you have a version-controlled single source of truth, while still being able to render technical documentation with AsciiDoc in Confluence. In case you decide to try the app and are missing a feature, please let us know in our Jira .  

            It would be great make use of the attributes in asciidoc to supply the metadata required for Confluence.

            Martin Sarosi added a comment - It would be great make use of the attributes in asciidoc to supply the metadata required for Confluence.

            +1

            Thomas Hucke added a comment - +1

            Harald Dunkel added a comment - - edited

            metoo

            This ticket is still stuck in Gathering Interest. How many votes does it need?

            Harald Dunkel added a comment - - edited metoo This ticket is still stuck in Gathering Interest. How many votes does it need?

            Bougy Man added a comment -

            A great first step (For us) would be to have asciidoc as an export format. This would give us the ability to maintain our wiki documentation as code without losing comments/talk/etc. As we do when we use tooling like confluence-publisher. We have now started using WebDAV with a small toolkit (https://github.com/bougyman/confluential) To bridge the gap, But none of the XML/XHTML to asciidoc converters we've seen allow us to preserve <ac:structure-macro ... /> blocks at this time, so we have to do some juggling to keep that content in sync. Ideally, we'd have a system which allowed authors who wish to use the web editor the ability to do that, as well as use the talk/discussion/comment links, while authors who prefer to use asciidoc, or for developers to publish their asciidoc code documentation, directly to the wiki without clobbering those things. If confluence had an 'export to asciidoc' functionality, we could achieve this nirvana with our current tooling plus a small bit of extra glue. 

            Bougy Man added a comment - A great first step (For us) would be to have asciidoc as an export format. This would give us the ability to maintain our wiki documentation as code without losing comments/talk/etc. As we do when we use tooling like confluence-publisher. We have now started using WebDAV with a small toolkit ( https://github.com/bougyman/confluential)  To bridge the gap, But none of the XML/XHTML to asciidoc converters we've seen allow us to preserve <ac:structure-macro ... /> blocks at this time, so we have to do some juggling to keep that content in sync. Ideally, we'd have a system which allowed authors who wish to use the web editor the ability to do that, as well as use the talk/discussion/comment links, while authors who prefer to use asciidoc, or for developers to publish their asciidoc code documentation, directly to the wiki without clobbering those things. If confluence had an 'export to asciidoc' functionality, we could achieve this nirvana with our current tooling plus a small bit of extra glue. 

            Agreed. Our use case is to write documentation using ASCIIDOC next to the source code which is under version control in Bitbucket (git) - for architectural or library user documentation.

            Our maven build will generate the documentation on each build.

            Confluence should include the documentation (when rendered to HTML) based on the release branch (usually master).

            Idea is to easily create sites with links to develop docs or even feature docs.

            So it isn't actually the support of asciidoc in confluence per se, as this still wouldn't offer source control (compared to the meaningless site history) but to be able to include external documentation.

            The initial suggestion with having full integration of an external cvs for asciidoc documentation for several projects looks sexy but we would want to have documentation next to the actual source code.

            I hope that makes sense. If not, I'm happy to clarify.

            Müller, Stephan added a comment - Agreed. Our use case is to write documentation using ASCIIDOC next to the source code which is under version control in Bitbucket (git) - for architectural or library user documentation. Our maven build will generate the documentation on each build. Confluence should include the documentation (when rendered to HTML) based on the release branch (usually master). Idea is to easily create sites with links to develop docs or even feature docs. So it isn't actually the support of asciidoc in confluence per se, as this still wouldn't offer source control (compared to the meaningless site history) but to be able to include external documentation. The initial suggestion with having full integration of an external cvs for asciidoc documentation for several projects looks sexy but we would want to have documentation next to the actual source code. I hope that makes sense. If not, I'm happy to clarify.

            Stefan Eidelloth added a comment - - edited

            Here is an adapted user macro (originally from Jared Morgan, see above) that works for me. Replace http://*myserver* with your server / location of asciidoctor javascript and css fies.

             

            ## Macro name: adoc
            ## Macro title: AsciiDoc Markup with Asciidoctor
            ## Categories: Formatting
            ## Description: Display content in AsciiDoc format using the asciidoctor.js engine.
            ## Visibility: to all users
            ## Icon URL: https://raw.githubusercontent.com/norganna/adoc-usermacro/master/adoc.png
            ## Documentation URL: http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/
            ## Macro has a body: Y
            ## Body processing: Unrendered
            ## Generates: HTML
            ##
            ## @noparams
            ##
            ## Developed by: Ken Allan (https://github.com/norganna)
            ## Date created: 2015-09-02
            ## Modified by Stefan Eidelloth
            
            ## You can select whether to use the Foundation AsciiDoctor style, which will make articles look different to standard confluence styles, or leave it as is if
            ##you want to achieve something closer to the standard Confluence styling by setting the following to either "confluence"  or "foundation":
            #set($style="confluence")
            
            ## A handy macro to generate a new random ID between 0 and maxint each time you call it:
            #set ($randomId="")
            
            #macro(getRandomId)
            #set ($string="")
            #set ($rand=$string.class.forName("java.util.Random").getConstructor().newInstance())
            #set ($randomId=$rand.nextInt(2147483647).toString())
            #end
            
            #getRandomId()
            <div id="adoc-content-$randomId" class="adoc-content">
            </div>
            
            #if($style == "confluence")
            <link type="text/css" rel="stylesheet" href="http://**myserver**/adoc-confluence.css" media="all">
            #else
            ##<link type="text/css" rel="stylesheet" href="http://**myserver**/adoc-foundation.css" media="all">
            #end
            
            ## This CSS is the FontAwesome font which enables the admonition icons.
            <link type="text/css" rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" media="all">
            
            ##reference to asciidoctor.js
            <script src="http://**myserver**/asciidoctor.min.js">
            </script>
            
            ##reference to mathjax.js
            <script type="text/x-mathjax-config">
            	  MathJax.Hub.Config(\{
            		extensions: ["tex2jax.js"],
            		jax: ["input/TeX", "output/HTML-CSS"],
            		tex2jax: {
            		  inlineMath: [ ['$','$'], ["\\(","\\)"] ],
            		  displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
            		  processEscapes: true
            		},
            		"HTML-CSS": \{ fonts: ["TeX"] }
            	  });
            	</script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js">
            
            <script>
            jQuery(function() \{
            
                var asciidocContent= $jsonator.convert($body).serialize();
            
                var asciidoctor = Asciidoctor();
               
                var asciidoctorOptions = {          
                        safe: 'safe'           
                 };      
            
                var renderedHtmlOutput = asciidoctor.convert(asciidocContent, asciidoctorOptions);
            
                jQuery('#adoc-content-$randomId').html(renderedHtmlOutput);
            
            });
            </script>
            

            Stefan Eidelloth added a comment - - edited Here is an adapted user macro (originally from Jared Morgan, see above) that works for me. Replace http://*myserver* with your server / location of asciidoctor javascript and css fies.   ## Macro name: adoc ## Macro title: AsciiDoc Markup with Asciidoctor ## Categories: Formatting ## Description: Display content in AsciiDoc format using the asciidoctor.js engine. ## Visibility: to all users ## Icon URL: https: //raw.githubusercontent.com/norganna/adoc-usermacro/master/adoc.png ## Documentation URL: http: //asciidoctor.org/docs/asciidoc-syntax-quick-reference/ ## Macro has a body: Y ## Body processing: Unrendered ## Generates: HTML ## ## @noparams ## ## Developed by: Ken Allan (https: //github.com/norganna) ## Date created: 2015-09-02 ## Modified by Stefan Eidelloth ## You can select whether to use the Foundation AsciiDoctor style, which will make articles look different to standard confluence styles, or leave it as is if ##you want to achieve something closer to the standard Confluence styling by setting the following to either "confluence" or "foundation" : #set($style= "confluence" ) ## A handy macro to generate a new random ID between 0 and maxint each time you call it: #set ($randomId="") #macro(getRandomId) #set ($string="") #set ($rand=$string. class. forName( "java.util.Random" ).getConstructor().newInstance()) #set ($randomId=$rand.nextInt(2147483647).toString()) #end #getRandomId() <div id= "adoc-content-$randomId" class= "adoc-content" > </div> # if ($style == "confluence" ) <link type= "text/css" rel= "stylesheet" href= "http: / /**myserver**/ adoc-confluence.css" media= "all" > # else ##<link type= "text/css" rel= "stylesheet" href= "http: / /**myserver**/ adoc-foundation.css" media= "all" > #end ## This CSS is the FontAwesome font which enables the admonition icons. <link type= "text/css" rel= "stylesheet" href= "http: //maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" media= "all" > ##reference to asciidoctor.js <script src= "http: / /**myserver**/ asciidoctor.min.js" > </script> ##reference to mathjax.js <script type= "text/x-mathjax-config" > MathJax.Hub.Config(\{ extensions: [ "tex2jax.js" ], jax: [ "input/TeX" , "output/HTML-CSS" ], tex2jax: { inlineMath: [ [ '$' , '$' ], [ "\\(" , "\\)" ] ], displayMath: [ [ '$$' , '$$' ], [ "\\[" , "\\]" ] ], processEscapes: true }, "HTML-CSS" : \{ fonts: [ "TeX" ] } }); </script> <script src= "https: //cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" > <script> jQuery(function() \{ var asciidocContent= $jsonator.convert($body).serialize(); var asciidoctor = Asciidoctor(); var asciidoctorOptions = { safe: 'safe' }; var renderedHtmlOutput = asciidoctor.convert(asciidocContent, asciidoctorOptions); jQuery( '#adoc-content-$randomId' ).html(renderedHtmlOutput); }); </script>

            This is the sole reason my documentation has not made it into confluence. Such a pain to wait for the admins to get around to maybe installing or enabling a plugin.

            Please add support for Markdown and Asciidoc, natively. Confluence is going to be a second, third, or fourth class doc platform without support for the de facto doc languages –
            provided out-of-the-box by most every other tool in the industry.

            Kyle_Matheny_sandc added a comment - This is the sole reason my documentation has not made it into confluence. Such a pain to wait for the admins to get around to maybe installing or enabling a plugin. Please add support for Markdown and Asciidoc, natively. Confluence is going to be a second, third, or fourth class doc platform without support for the de facto doc languages – provided out-of-the-box by most every other tool in the industry.

            Or try https://github.com/norganna/adoc-usermacro to use AsciiDoc directly on a confluence page.

            I'm experimenting with safe mode to allow content to be sucked into the page from raw GitHub or Stash repos.

            It's free and open source

            Jared Morgan (jaredmorgs) added a comment - Or try https://github.com/norganna/adoc-usermacro to use AsciiDoc directly on a confluence page. I'm experimenting with safe mode to allow content to be sucked into the page from raw GitHub or Stash repos. It's free and open source

              Unassigned Unassigned
              2c2cc35bb48c Jared Morgan (jaredmorgs)
              Votes:
              219 Vote for this issue
              Watchers:
              94 Start watching this issue

                Created:
                Updated: