Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: More ways to download code...

by xdg (Monsignor)
on Aug 28, 2005 at 14:37 UTC ( [id://487259]=note: print w/replies, xml ) Need Help??


in reply to More ways to download code...

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.

Replies are listed 'Best First'.
Re^2: More ways to download code...
by demerphq (Chancellor) on Aug 28, 2005 at 14:49 UTC

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

    Agreed. And I like your proposed change. Off the top of my head the only reason I can think of to leave it as it is would be legacy support. A lot of people have styling for code based around the existing tags. Changing it would break that. OTOH, long term I think it would be for the better.

    BTW, you are a member of pmdev, if you felt like putting together a patch, the code involved is wrapcode.

    ---
    $world=~s/war/peace/g

      I am a member of pmdev... but I'm completely intimidated by the learning curve necessary and protocols among existing developers. Is there a useful starter tutorial that I'm missing? I know there's a Pmdev HowTo Wiki, but even that's a bit sparse on detail and mostly suggests poking around. Do I just need to plow through the Everything docs? Or should I just start hacking patches and learn on the job as more senior pmdevs slap me around for stuff that doesn't make sense?

      -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.

        Or should I just start hacking patches and learn on the job as more senior pmdevs slap me around for stuff that doesn't make sense?

        Well I'd hope that nobody would slap you around. But yeah, I'd say start hacking patches. For instance wrapcode isn't too difficult to deal with as a black box (yeah, says me ;-)

        Too be honest tho its really really hard for me to know what to say about the learning curve, and protocols here. For instance from my point of view, there aren't really any protocols here. Now, that doesn't mean that there aren't, just that its hard for me to tell what they are. I guess im too close to the trees. Likewise I'm not sure what there is to be intimidated by. The code can be a little convoluted, and sure there is a fair amount of background knowledge to aquire, but ultimately its not that complex. Most htmlcode nodes are just like subroutines and can be treated as such, ie a black box with expected inputs and outputs.

        Anyway, when i started pmdev'ing my strategy was generally to find something I didn't like, or that I thought could be different/better, and figure out how to make it happen. So when I hear people asking questions like yours I don't know what to answer as I never really felt the need to ask those questions.

        The point of all these comments is that you aren't the first to ask questions like these, and I still dont know what to answer. I'd really like to be able to, but I'm not like some of the other monks on this site who can really explain something properly. I created the how-to wiki to try to provide somewhere that this stuff could accumulate, but I dont know what to put in it or where to go with it. I need help.

        So frankly if you are a pmdevil and you aren't contributing because of the learning curve then please help me understand what you feel unsure about, preferably via the how-to wiki, and then we can address that need. I really dont know what kind of things are holding people back. If I knew what they were then id do my best to address them.

        ---
        $world=~s/war/peace/g

Re^2: More ways to download code...
by demerphq (Chancellor) on Aug 30, 2005 at 07:59 UTC

    The html has been restructured somewhat, not quite as you describe, but there is now an outer wrapper over both tags. There are a bunch of reasons why going to the div representation you suggest can just happen, but IMO it could be an optional way to present it. Anyway, patches welcome. ;-)

    ---
    $world=~s/war/peace/g

Log In?
Username:
Password:

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

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

    No recent polls found