Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Suggestion: Optional Line Numbering Tag for CODE

by knobunc (Pilgrim)
on Apr 25, 2001 at 19:07 UTC ( [id://75483]=note: print w/replies, xml ) Need Help??


in reply to Suggestion: Optional Line Numbering Tag for CODE

Yery cool idea. It would also be nice to be able to have code numbering continue from one block to the next (obviously under some user control). For example:

1 # This is the start of the code where we set up stuff 2 my $frob = 'gibber'; 3 my $handle = 'hum';

Then some descriptive narrative explaining what is going on. And I pick up from where I left off:

4 # Start doing the real work 5 do_the_real_work($frob, $handle);

Of course sometimes you want the first block and the second to be numbered separately, and you may want to interweave one set of numbers with another. So I would propose amending the syntax to be:

<NCODE section="some_name" start_line="1" order="1"> insert code here </NCODE>

All three attributes are optional. Each named section would have a running counter. The start_line attribute allows you to specify the starting line number of the section. Finally, the order attribute governs the order of the section in the resulting code. The order attribute allows you to talk about a chunk of code that is deep in the body then talk about the stuff that appears before it and have the line numbers make sense. Of course this is all becoming very similar to the Literate Programming stuff, since the "download code" link should reconstruct the code blocks into the right sections and into the right order (possibly with # line statements if lines were skipped).

Of course this is all very complex and tangled and vroom is probably way to busy to do something so frivolous. So how can I help? Is there a cadre of hand picked workers who help maintain the Monastery? Can I get my hands on the current source code through some CVS share and hack it in and submit patches?

-ben

Log In?
Username:
Password:

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

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

    No recent polls found