Skip to main content
May 12, 2011
Question

Need to Insert Code "Snippets"

  • May 12, 2011
  • 3 replies
  • 1034 views

I thought using RoboHelp Snippets would be what I need, but RH uses them as variables.  I need the ability to quickly insert code.  Styles would work to some extent, but I need more than that.  For example, sometimes I want to include comments (<!-- -->) with some tags, to assist the writers.  I searched the help, but couldn't find what I needed.  Is there a way, in RH9, to add code chunks?

    This topic has been closed for replies.

    3 replies

    Willam van Weelden
    Inspiring
    May 12, 2011

    Hi Jeff, welcome to the community.

    Could you explain what you mean by "code chunks"? Do you want to add comments to aid writers? Do you want to quickly insert a default set of text to help writers get started on a topic? Or perhaps you want to do something completely different.

    Greet,

    Willam

    Willam van Weelden
    Inspiring
    May 12, 2011

    Mmmh, crowded... Everyone seems to be very active today. I would lay off the coffee for a while Rick and Jeff .

    Jeff_Coatsworth
    Community Expert
    Community Expert
    May 12, 2011

    Or are you looking to just display samples of code? You could capture them as images and insert the image into the RH topic.

    Captiv8r
    Legend
    May 12, 2011

    Welcome to our community Jeff

    I'm a bit confused. Are you wanting to insert snippets that readers of your help systems may copy or view?

    Or are these instead, snippets that other RoboHelp users will use as they make edits to your project?

    As you mention comments, those may be inserted easily by clicking Insert > HTML > Comment. You might also add this to a toolbar or assign your own keyboard shortcut to it for simpler access.

    Cheers... Rick

    Helpful and Handy Links

    RoboHelp Wish Form/Bug Reporting Form

    Begin learning RoboHelp HTML 7, 8 or 9 within the day!

    Adobe Certified RoboHelp HTML Training

    SorcerStone Blog

    RoboHelp eBooks

    May 12, 2011

    I'm talking about HTML code, so yeah, this would be an internal audience.  In our current system, inserting code blocks makes things efficient because, instead of typing each tag in a table, for example, you just drop the code "snippet" into the document, then the writer fills it in with descriptive text.  I think styles will get me most of where I want to go, but all they'll do, if I'm understanding them right, is attach a CSS style to selected text, not add comments.  For example, I might want to have the following code chunk:

    <table>

    <thead>
    <th></th><!--Column header 1-->

    <th></th><!--Column header 2-->

    <th></th><!--Column header 3-->

    </thead>

    <tfoot></tfoot><!--usually not used, but just in case-->

    <tr><!--use rowspan="x" if a cell needs to take up multiple rows-->

    <td></td><!--use colspan="x" if a cell takes up multiple columns-->

    <td></td>

    <td></td>

    </tr>

    This is an extreme example, but I want the writers to be able to plop that chunk of code into their document, then fill in the blanks.

    Message was edited by: Jeff at Infor

    RoboColum_n_
    Legend
    May 12, 2011

    Hi Jeff.

    I'd say you'd be better off using a macro record tool such as Macro Express for this sort of thing. You just setup your macro with the code, then open up the HTML of the topic and insert.


      The RoboColum(n)   @robocolumn   Colum McAndrew