in reply to Help translating into HTML

Starting to get a bit clearer now!
Could you give an example of input and output for blocks that have lines begining with M, S, T and #.
You mention them so I want to be clear.

Loading the input into a hash may be the way to go.

Replies are listed 'Best First'.
Re^2: Help translating into HTML
by mrxg4 (Initiate) on Jul 17, 2004 at 20:23 UTC
    Ok,
    Lines with M are *completely* ignored.

    Lines that begin with a # can be found pretty much anywhere, be it at the beginning, middle or end of a block. But they should be enclosed in <!-- -->. Think of these as individual lines, that don't have any effect in the block structure itself.

    There are no T's, I confused them with the F's. Sorry about that.
    Now, as for the S and F's, here are some examples:
    1) Input:
    K One
    K Two
    S Alright
    R Whatever?
    R Blablabla
    R And even more
    1) Output:
    <c>
    <t>
    <set name="temant>Alright</set>
    <r>
    <li>Whatever?</li>
    <li>Blablabla</li>
    <li>And even more</li>
    </r>
    </t>
    </c>

    2) Input:
    K Perl
    K Monks
    S Theme
    F 1234
    R Examples
    R More
    R Yes
    2) Output:
    <c>
    <p>%Perl,%Monks</p>
    <t>
    <set name="temant">Theme</set>
    <setflag param="1234"/>
    <r>
    <li>Examples</li>
    <li>More</li>
    <li>Yes</li>
    </r>
    </t>
    </c>

    On a seperate note, there may be special blocks that don't have either an S or an F. Example:
    K Special
    K Case
    R One
    R Two
    R Three
    Here, it translates to:
    <c>
    <p>%Special,%Case</p>
    <t>
    <r>
    <li>One</li>
    <li>Two</li>
    <li>Three</li>
    </r>
    </t>
    </c>

    Hopefully this should clear things up. If you have any other questions, don't hesitate to ask, thanks.

    Kind Regards,
    Marcos