Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^5: Newlines in HTML::LoL

by BernieC (Pilgrim)
on Feb 01, 2021 at 23:15 UTC ( [id://11127772]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Newlines in HTML::LoL
in thread Newlines in HTML::LoL

how annoying. This is the example in the POD:
&hl(sub { print shift }, [table => {border => 2, width => '80%'}, [tr => [td => {nowrap => &hl_bool(1)}, 'This & that'], [td => {nowrap => &hl_bool(0)}, '<b>This is not bold</b>'], [td => [b => 'But this is']], [td => &hl_noquote('<b>And so is this</b>')]]]);
and it produces:
<table border="2" width="80%"> <tr> <td nowrap>This &amp; that</td> <td>&lt;b&gt;This is not bold&lt;/b&gt;</td> <td><b>But this is</b></td> <td><b>And so is this</b></td> </tr> </table>
I can't figure out what's right with their example and what's wrong with my usage.. and it doens't look like there's another module for generating HTML structurally ... sigh

Replies are listed 'Best First'.
Re^6: Newlines in HTML::LoL (update x 2)
by LanX (Saint) on Feb 01, 2021 at 23:23 UTC
    > and it doens't look like there's another module for generating HTML structurally

    Sure CGI does, it's just now only documented in CGI::HTML::Functions

    And though it's not officially maintained anymore it's for sure a better bet than "19 year-old abandonware" (quoting Your Mother here)

    edit

    and after further reading there is also HTML::Tiny

    update

    And there is DSL::HTML which "takes the alternative approach, but does it in a significantly more elegent way."

    I intentionally left the typo in the quote ... you'll notice it has an "early version warning" and no changes since 2013

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      Thanks for the pointers. I already have the CGI module, I didn't know it was the html-generation stuff broken out. I also found another module that is fascinating me: HTML::TagTree. Everything is objects and the HTML tags are methods. whtn you create a table, your $table is a TagTree object {it says that every HMTL tag is a method} and it seems to produce nice-looking code. More to play with :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127772]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-19 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found