Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I personally believe that this morning I must be even more dumb than usual, because I seem to be completely unable to find a supposedly simple but not entirely trivial module suitable for my needs and that IMHO should be out there...

Specifically, I have some pure text chunks: code, preformatted text, ASCII art and so on. Now, for visualization purposes, I'd like not to print them to a terminal but into an HTML file, presumably within <pre> tags, but also possibly further embedded in a <div> complete with a caption, like as if it were a figure, and so on.

To put it briefly, something akin to what PM's code tags themselves do, except that I do not need the automatic wrap on long lines, which would even be annoying in my case, but that's just a detail... Of course and to put it briefly, there's nothing in this that I could not concoct up myself, but as a matter of principle it seems strange to me that there's not a module that would simply allow me to do something like:

print $t2h->add(text => $font->figify(-A => 'Hello, World!'), caption => "Text::FIGlet example, with font '$fontname +'");

I noticed I could find stuff just as complex as HTML::FromANSI which in turn looks like an overkill for what I'm really after. Thus the actual questions are:

  • do such modules exist?
  • Which one would you recommend?
  • Which cpan search would you suggest to locate them, since I appearently couldn't find a very good one?
--
If you can't understand the incipit, then please check the IPB Campaign.

In reply to [ASCII 2 HTML] Appearently unable to find simple module! by blazar

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-03-28 22:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found