lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Yuri Takhteyev wrote:
Will there be any support for exporting to other document format?
Being able to save the documents in a format like ODT, xhtml or
markdown would increase the usefulness by a few orders of magnitude!

Yes, it already imports/exports HTML. (Using a very simple tag soup parser, rather than anything complex with XML.) I've tested it on some Russian Wikipedia pages and it appears to work fine.

(The exporter is 93 lines of code, but could be plausibly refactored to make it smaller. The importer is 99, not including the vast HTML entity table.)

Aside: the importer defines a function that iterates through all the tokens in the HTML file. Tokens are found using string:find(). Not having alternation (|) in the regex syntax does actually cause some problems --- I have to try each regex in succession until one matches. I don't know how Lua's pattern support works internally, I suspect I may be spending more time compiling regexes than actually doing work, during imports.

Otherwise this looks great.  I just installed it on Ubuntu without any
hiccups.

I'm extremely glad to hear that... that's where I did the development.

--
David Given
dg@cowlark.com