Feature Request External label resolution
Sherwood Botsford
sgbotsford at gmail.com
Sun Apr 20 02:11:00 EDT 2008
Allan Odgaard wrote:
> On 20 Apr 2008, at 00:28, Sherwood Botsford wrote:
>
>> [...]
>> Suppose that markdown was clever enough to reference an external
>> file (in .markdownrc of course) for the resolution of LABEL.
>
> Here’s a simple shell script to convert all markdown to HTML and using a
> shared references file:
>
> cd ~/MySite/pages
>
> for f in *.mdown; do
> cat "$f" references|Markdown.pl > "../html/${f%.mdown}.html"
> done
>
> I use something like that myself where I also have a command to update
> my references list, that is, grep through the pages for undefined
> references and add these to the references file (where I will then need
> to add the URI).
>
Hmm. Ok, I think I could to it this way in Template Toolkit:
[% INCLUDE Header.inc %]
]% USE Markdown %]
[% FILTER Markdown %]
<div class=content>
blah blah blah
</div>
[% INSERT References.inc %]
[% END %]
[% INCLUDE Footer.inc %]
Downside is then that Markdown has to process every reference
which if you have a few thousand will be time consuming.
(I have an INSERT text at one point that jsut in template toolkit
takes 10-12 seconds to do. It's only a thousand lines, but there
is zero processing to do, it just stuffs it into the file.
More information about the Markdown-Discuss
mailing list