in reply to perlmonks downloadable code blocks
Look for a code block and copy it as a reference into some database table that holds code blocks? Is it available as some module already on CPAN?
No. No.
As you (presumably) know, code blocks are supposed to be enclosed in <code>...</code> tags by the author of the post. The content of the post is stored in the database exactly as submitted by the author. Given that, it is trivial for the PerlMonks engine to find and extract code blocks. When the node is rendered, <code> tags are transformed into appropriate HTML, download links are created for the code block(s), etc.
|
|---|