Page 1 of 1

Convert to HTML Macro for Writers

Posted: 2013-10-20 15:55:22
by loulesko
Hi there,

This post was updated to a newer version of this macro on 2/25/2017

This is a refined version of a macro I started a while back. It converts your Nisus document text to HTML (including links), headers 1-6, tables, numbered and bullet lists all get converted.

It also does some nice things for writers like converting opening and closing quotes to their proper HTML entities, it also does the same for ampersands, EM dashes and EN dashes. It also puts in paragraph tags and double carriage returns between paragraphs for cleaner text that you can easily read after pasting.

This macro requires that you have your styles for headings listed as "Heading 1", "Heading 2". "Heading 3" etc, "Blockquote", "Bullet List", "Number List" in your style sheet - these are all the default names, so you probably won't have to do a thing.

This latest version uploaded 2/25/17 fixes a few annoyances like if a list was that the end of a document and didn't have a following carriage return, the last list item tag would get swapped with the OL or UL tag, that is now not problem.


Re: Convert to HTML Macro for Writers

Posted: 2013-10-30 14:28:46
by martin
Thanks for sharing this Lou! Even though NWP does have a built-in HTML export, it tends to be rather overwrought in terms of CSS/HTML tags because it's produced by Apple's WebKit, intended to be shown/interpreted by web browsers. It's not the kind of thing that's very pleasant to hand edit. Your macro does a much better job of producing simple hand-editable HTML.

Re: Convert to HTML Macro for Writers

Posted: 2014-05-17 07:31:56
by ptram
Lou, thank you very much. Very useful!


Re: Convert to HTML Macro for Writers

Posted: 2014-05-28 17:38:35
by loulesko
My pleasure Paolo, I 'm thrilled you find it useful.