Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Only showing part of POD when not rendered as HTML

by Anonymous Monk
on Jun 27, 2016 at 07:34 UTC ( [id://1166625]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Only showing part of POD when not rendered as HTML
in thread Only showing part of POD when not rendered as HTML

Yup, this is basically a variation of #1, where you need to know the DOM of the final HTML document.

There are less than ten (like 2-6) pod to ?html things with anything resembling a user base, and only 2 are "popular"...

So there is not a whole lot to know, you make the text, so make it easy, resulting DOM is either one target node <div>##tablestart ... ##tableend</div>

or a bunch of siblings <p>##tablestart...<p>##tableend

Both are easily found if you tag the table

with jquery $(':contains("##tablestart")').each...text...replace...

or xpath (jquery also has a plugin)  var iterator = document.evaluate('//*[ not(./*)  and  contains( ., "##tablestart")/ ]', document.body, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null ); ...

Perhaps there should be something like =for !HTML or =begin !HTML ... =end !HTML?

:) If you think you need that, you should generate the pod from some other template language ... if it doesn't drive you insane

Yes, you could invent a =begin :format, but then you'd have to convince all those pod module authors to accept your solution, and all the users would have to upgrade .... seems like a nonstarter , pod is already too complex :)

Replies are listed 'Best First'.
Re^4: Only showing part of POD when not rendered as HTML
by perlancar (Hermit) on Jun 28, 2016 at 13:57 UTC

    OK, I've generated the HTML tables,

    Textsprintfn.pm

    Textsprintfn.pm (source code)

    but turns out metacpan.org only allows certain HTML elements for security. script is certainly not allowed, not even thead or th. Ah well.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-25 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found