Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

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

Ugh. I like this in concept but I think the HTML for it is poor:

<p><tt class="code"><font size="-1">my $message=&quot;Hello world\n&qu +ot;;<br /> print $message;<br /> </font></tt></p><div class='embed_code_dl'><a href="?part=1;abspart=1; +displaytype=displaycode;node_id=487248">(d/l)</a></div>

The code is wrapped in <p> tags. The d/l link is wrapped in a <div>. And nothing wraps the two of them to keep them together. If I style my CSS to put a border, some indent, and some margin around my code, the d/l link is on the outside of that. I'd rather see something more like this (indents for clarity of explanation only):

<div class="codeblock"> <div class="codebody"> <tt class="code"> [actual code] </tt> </div> <div class='embed_code_dl'> [the link] </div> </div>

That way, styles that should apply to both can be applied to the "codeblock", and the other styles can be individually set, too.

I also removed the <font> tags in my example -- I think those should be removed from pm wherever they appear as they make custom CSS a real pain. (I just set the font-size style for font tags to be 100% and that seems to defuse them.) If they are deemed "necessary", they should be replaced by a <span> with an appropriate class and the font-size set in CSS. (I'm not saying someone really needs to hunt them down, but when tweaking the HTML output for a section, that's a great time to remove them.

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.


In reply to Re: More ways to download code... by xdg
in thread More ways to download code... by demerphq

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 taking refuge in the Monastery: (7)
As of 2024-04-23 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found