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

(jeffa) Re: Enhancement: "hidden" code tag

by jeffa (Bishop)
on Mar 12, 2003 at 00:25 UTC ( [id://242219]=note: print w/replies, xml ) Need Help??


in reply to Enhancement: "hidden" code tag

I think it is a splendid idea. I currently circumvent this problem by using <pre><tt> ... </tt></pre>, but this has some obvious disadvantages, namely code wrapping.

So, this will get "picked up" by the d/l code link:

perl -le 'print "Hello World"'
but this won't

python -c 'print "put me out of misery"'

UPDATE

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: Enhancement: "hidden" code tag
by jasonk (Parson) on Mar 12, 2003 at 00:30 UTC

    Actually I was thinking the other way, code that WOULD show up in d/l code, but does not show up in the node. So that the node itself only contains the chunks of code that are actually relevant to the conversation, but if you hit d/l code, you get a complete, working program, that includes the parts that were hidden from the conversation. Although the idea to have code that doesn't show up in d/l code would be useful as well, now that I think about it.

      Is there some reason why you couldn't do this using the already existing <readmore>?
      # I think the fake code problem is here: some_sub('blah blah blah'); sub some_sub { do_something(); &nbsl;do_something_else(); }

          --k.


        The distinction is that stuff you "hide" in a readmore will show up if anyone looks at your node directly, where as the poster is suggesting a new tag which would never show up when viewing the node (either in a list, or directly) and would only be included as part of the "d/l code" content.

        The advantage of readmore tag is being able to shorten the node if you just want an overview.

        The advantage of a "hidden_code" tag would be that you could allways make "d/l code" provide a complete program, with all neccessary use statements and helper functions, but reading the node would only include the specific code you have a question about.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-18 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found