1 Reply Latest reply on Jan 11, 2007 11:03 AM by Peter Grainge

    Tweaking a compilation

    bmannino
      Hi,

      I have recently used RoboHelp to convert an existing WinHelp project to HTML Help with very good results.
      Upon review by some of our developers, several noted that the code examples generated may look OK, but there are a few quirks when copy and pasting this text into a code editor.

      The best bet would be to look at a specfic example. Here is a link to the online help generated by the RoboHelp Compiler:
      http://www.dbase.com/help/Plus-en.htm

      - Click on Index and search for FINDINSTANCE()
      - Select it and click on the Example link at the top of the topic

      This produces a code sample for this function. If you copy and paste this text into the code editor, there are blank lines between each line of code and the indentation is lost. Originally, I was thinking this was no big deal for an online help system. However, this HTML Help system will eventually be included with the software, so the ability to copy and paste code from examples into the code editor is fairly important.

      I am trying to figure out my options for resolving this issue. I looked at the generated HTML and it looked like this:
      ========================================================================================== ======
      <P class="Banner-Base" >FINDINSTANCE( ) example</P> <P class="Base" >The first example checks if there is already an instance of the EditToolbar class. If not, one is created.</P> <P class="Code1" >function attachEditToolbar(formObj)</P> <P class="CodeNext" style="margin-top:0;margin-bottom:0"> local t </P> <P class="CodeNext" style="margin-top:0;margin-bottom:0"> t = findinstance(&quot;EditToolbar&quot;) </P>
      <P class="CodeNext" style="margin-top:0;margin-bottom:0"> if empty(t) // If null, no instance exists, so </P>
      <P class="CodeNext" style="margin-top:0;margin-bottom:0"> t = new EditToolbar() // Create one (defined in this file) </P>
      <P class="CodeNext" style="margin-top:0;margin-bottom:0"> set procedure to program(1) additive // Load this file as procedure file </P>
      <P class="CodeNext" style="margin-top:0;margin-bottom:0"> endif </P> <P class="CodeNext" style="margin-top:0;margin-bottom:0"> t.attach(formObj) </P>
      ========================================================================================= ========

      I see how each line is embedded in a <P> tag with two associated styles "Code1" and "CodeNext". The font is OK, and the only difference aI could find was that lines marked with "CodeNext" were indented further than the first line ("Code1").

      I'm guessing that the <P> tags are whats causing the spaces between lines of code when pasted into the editor.

      I am trying to figure out the best way to "fix" this. This is a very large Help file, so manual tweaking would take forever.

      Should I:

      - Do a global search/replace for a common formatting string within the original help document before running the compiler
      - Alter settings on the HTML Help compiler to produce the desired result
      - Attempt to search/replace text across the compiled HTML output

      I would be open to any ideas on how to tackle this issue.

      Thanks in advance,

      -Ben