Skip to main content
STLRGA
Inspiring
January 21, 2022
Question

Getting Content Generated from Asciidoctor in RoboHelp

  • January 21, 2022
  • 2 replies
  • 252 views

Has anyone had an experience or luck with importing files into RoboHelp generated from Asciidoctor? I have a pretty massive amount of content from Asciidoctor I need to pull into RoboHelp Classic 2019 and formatted to my specific Master Page and Style Sheet.
I can get outputs from Asciidoctor as PDF or HTML and I already have tried importing them, but it just created a mess (primarily having to do with css). When I had to deal with this before, the only method that really worked was a completely manual copy and paste process which is extremely time consuming. If anyone can provide any advise, tips, tricks or or things I can try to get this Asciidoctor content into RoboHelp, it is greatly appreciated.

    This topic has been closed for replies.

    2 replies

    Community Expert
    January 23, 2022

    I can't give you a definitive answer, as I haven't used  the tools you have, but from looking at the asciidoctor online help I think either of two methods would work as described in my previous post. The short versions are:

    1. Generate different html from asciidoctor which meets RH requirements. (probably requires developer help)

    2. Add the asciidoctor styles in the correct place in your stylesheet. (requires intermediate-advanced css and html knowledge)

     

    You could try importing the asciidoc (.adoc) files using the Import Markdown option. RH might only support vanilla Markdown though, not the asciidoc dialect, so possibly some things might not import correct. I think it would be worth trying though. Let us know how it goes. 🙂

     

    Community Expert
    January 21, 2022

    I haven't used Asciidoc or Asciidoctor, but perhaps the following thoughts will help.

     

    1. If I understand the documentation, you could create a custom converter to transform the asciidoc into RH compatible html. If the asciidoctor documentation uses the default converter, it uses heaps of nested divs whereas RH uses mostly p. so instead of converting to something like

     

     

    <div class="content">
        <h1 class="page">First Heading</h1>
        <div class="section">
            <div class="sectionbody">
                <div class="paragraph">
                    <p>This is my first paragraph</p>
                </div>
            </div>
        </div>
    </div>

     

     

    You'd define a converter that converts to something like this:

     

     

    <body>
        <h1>First Heading</h1>
        <p>This is my first paragraph</p>
    </body>

     

     

      Obviously I don't know either your asciidoctor output or your RH project setup, so this is a very generic just to illustrate that the output of the custom converter would be different.

     

    If this will be an ongoing task you need to perform it may well be worth going this route.

     

    2. You could add the asciidoctor styles into your existing stylesheet at the appropriate spots. You'd need to do this using the code editor, because the RH Classic stylesheet editor really doesn't cope with complex css. I pretty much stopped using the built in editor about 15 years ago. 😛

     

    So for example, using the first code snippet as an example, you want to make sure the paragraph uses your RH normal paragraph style. So in your RH stylesheet you would find the p style.  It might look like this:

     

     

    p {
        font-family: Arial;
        font-size: 10pt;
    }

     

     

    You would add in your asciidoctor "paragraph" class like so:

     

     

    p, .paragraph {
        font-family: Arial;
        font-size: 10pt;
    }

     

     

     You would have to figure out every "style" you needed to map and add it in the appropriate place. 

     

    3. RH Classic doesn't support a lot of modern HTML5 or CSS3, so depending on how the asciidoc is converted, the editor might have a bit of a fit, or just refuse to display things correctly. However, some of the stuff will generate correctly and look fine in the output. So always generate to see what the actual output looks like. 

     

     

    STLRGA
    STLRGAAuthor
    Inspiring
    January 23, 2022

    Thank you for providing this feedback, it is very helpful. From what you are saying, it seems like I need to manipulate the HTML code before importing to RoboHelp?

    Also for consideration, I have found that the native file used by Asciidoctor to generate HTML/PDF is basically a text only markdown file (extension .adoc). I am not familiar with markdown, but would it be worth looking into working/modifying the native file and somehow importing that or pasting the code into RoboHelp?