Clarification:

I'm writing content for a website in mostly-plaintext files. The first paragraph is headers (think email), containing metadata. The rest is content. Right now, all of the content goes through HTML::FromText to turn it into nice pretty web-friendly markup. Unfortunately, it's difficult to do things like post Perl code sippets with this method, because they end up getting parsed like they're plain text by HTML::FromText. (Yes, there's a document-wide switch to text2html to treat indented paragraphs as code; 95% of the time, I don't want that.)

What I want is a nice way to say "this chunk of text is plaintext, and should be marked up by HTML::FromText; this chunk is Perl, and should be marked up by perltidy; this chunk is C, and should be marked up by <foo>", and so on. I want to do this in as transparent a manner as possible; if I wanted to write my content in some heavyweight markup language, I'd use HTML and skip the middleman.

I'm thinking that POD might be a useful way of doing this: I could use one of the many POD modules to chunk my input, and POD has a nice, minimal syntax.

Update: Looks like POD's the way to go. Thanks Aristotle and domm!

--
The hell with paco, vote for Erudil!
:wq


In reply to Re: Segmented text processing (with POD?) by FoxtrotUniform
in thread Segmented text processing (with POD?) by FoxtrotUniform

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.