[pmwiki-users] Importing text files
radu at monicsoft.net
Wed Aug 17 06:24:28 CDT 2005
It's not obvious, but it's easy.
You'd have to convert those text files to the
wiki format. You could either use perl, some
other scripting language or just using a text
editor (e.g. notetab.com), that allows me to
build macros... and then batch process the text files. Here's what I do:
replace all [cr][lf] (or [\r][\n]) with ² (or
some other string that doesn't appear in the text),
during that pass, I isolate all terms that I want
to become wikilinks (for the targets variable), then
bundle the result in a text template like:
text=here comes the text with all line breaks
converted to the newline declared above
Maybe this should go into the docs or in a recipe?
At 04:53 PM 8/16/2005, Geraldine wrote:
>I would like to import a load of plain text files into my pmwiki.
>(There's almost no markup on them so they don't need converting, and
>there's no history.)
>I tried putting one of these files into the wiki.d folder and renaming
>it as Test.TestPage; the name was recognised but when I clicked on it
>the page was blank.
>So I am wondering if I can append something to these files or format
>them in some way to do this import.
>I really don't want to copy and paste all these small text files if I
>can help it. I'd be really grateful for some help with this.
More information about the pmwiki-users