To prepare a typical PerlMonks page for a Palm PDA, I'd like to remove all references to ads & all the nodelets such as the chatterbox etc.
I need to strip one line and a range of lines between two tags.
I'm not sure on the best way to do this so would appreciate advice from fellow Monks. My initial attempts were miserable convoluted failures.
As an example, save the source HTML for this page onto HD as example.htm.
Given a filename which is a saved PerlMonk page (e.g. example.htm),
Strip out:
Entire <layer src="http://adfu.blockstackers.com/servfu.pl....."line.
(the line above appears after <BODY text="#000000" bgcolor="#FFFFFF" link="#000066" vlink="#333399">)
From <!-- nodelets start here --> to last </CENTER>(before </BODY>)
Save the rest under a different filename.
Perhaps this should be a feature of the PerlMonks site like those websites which offer a button "Prepare this page for printing/emailing" etc alongside all articles etc. What do you think?
dmtelf
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.