Exporting to HTML without stylesheet info

Everything related to our flagship word processor.
Post Reply
David Sharp
Posts: 48
Joined: 2008-07-06 23:21:27
Location: Paris, France
Contact:

Exporting to HTML without stylesheet info

Post by David Sharp »

Hi,
I'm looking for the most efficient way to export a file to HTML, but without the stylesheet data that's inserted via the standard NWP command.

The idea would be to disregard parameters such as fonts and colours, and simply map the RTF content defined in my simple NWP template to basic HTML tags.

"Heading 1" would convert to <h1>
"Heading 2" would convert to <h2>
A bullet list would convert to <ul> or <ol>, links would convert to links, bold to <em>, etc.

As things stand now, to convert an NWP file for publication on one of my web sites, I either convert it to simple text and code it manually using BBEdit, or use the NWP "export to HTML" command and then remove all the extraneous info using BBEdit.

Is there a macro or other tool to do what I want, either from within NWP or via an external program?

(I guess my dream feature would be the ability, when creating an NWP template, to specify exactly how I wanted each style element to be exported to HTML.)

Many thanks for any help,

martin
Official Nisus Person
Posts: 4788
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Exporting to HTML without stylesheet info

Post by martin »

Hi David,

There's no way to customize the HTML export in Nisus Writer as you'd wish. However, writing a macro is certainly a possibility depending on your needs. I know some other dedicated Nisus users have put macro-controlled exports to good use, but it's a complicated thing to get working. You might see Jerry's macro thread on this, or this updated post and macro on his personal website.

David Sharp
Posts: 48
Joined: 2008-07-06 23:21:27
Location: Paris, France
Contact:

Re: Exporting to HTML without stylesheet info

Post by David Sharp »

Many thanks for that, Martin

Jerry's macro indeed seems like the kind of thing I'm looking for, although I fear that implementing it may be beyond my current rather modest abilities.

More generally, I'm interested in the ways a document can be made "interoperable" in the sense that it can be switched between a printable format (such as RTF) and a mark-up language such as HTML or XML or a proprietary format such as PDF.

I guess my dream application would be one that enabled me to include formatting instructions, meta-data, links to related material and also different language versions in the same file, and then authorise different "views" of the material for various media or display systems. Rather than an "export" command, this would simply involve various ways of viewing one and the same file.

I think about this a lot, but I don't even know where to start looking. Are there good forums which deal with this kind of issue?

(I note that scientific or technical writers, for understandable reasons, promote various tools and systems for doing this kind of thing. But most of my writing is non-technical, shading from poetry through to journalism and political and social texts with footnotes).

Best wishes,

martin
Official Nisus Person
Posts: 4788
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Exporting to HTML without stylesheet info

Post by martin »

I don't think I've ever seen an application that does the kind of thing you're looking for. Certainly you write some NWP macros that process your documents in special ways- marking content in styles your macro scans for, stashing away content inside comments, etc. But any solution would be rather esoteric and specific to your needs, and likely require some significant macro writing skills.

ralph strauch
Posts: 31
Joined: 2003-08-14 08:27:57
Location: Los Angeles, CA
Contact:

Re: Exporting to HTML without stylesheet info

Post by ralph strauch »

One approach to this that I've explored involves taking the text through the Wordpress editor. That editor has two modes -- visual and html. If you copy formatted text from Nisus and paste it into the editor, things like italics, bold, and lists are maintained. You can then switch to html mode and copy the resulting html. It isn't perfect, but it will certainly do some of what you want. I haven't tried headers, so I don't know what it would do with them.

Ralph

David Sharp
Posts: 48
Joined: 2008-07-06 23:21:27
Location: Paris, France
Contact:

Re: Exporting to HTML without stylesheet info

Post by David Sharp »

Ralph: many thanks for your reply.

I'd already noticed that when I copy (command-C) text from an MS Word file into a Wordpress window, the attributes are conserved (including links to footnotes), and I can then see the data as HTML. Needless to say, in true Word fashion the latter is pretty messy.

However I've just tried the same thing with NWP, and *none* of the formatting is transferred into Wordpress.

I've tried both simple "Copy" and "Copy character attributes", but in neither case am I getting the result you mention.

Is there some command for "copying formatted text" from NWP that i'm missing? Have searched the manual, but no luck.

ralph strauch
Posts: 31
Joined: 2003-08-14 08:27:57
Location: Los Angeles, CA
Contact:

Re: Exporting to HTML without stylesheet info

Post by ralph strauch »

I'm just doing a straight copy from Nisus and paste into the visual mode if the Wordpress 3.1 editor. I think I remember looking at an add-in editor several year ago, but as far as I can tell now I'm using the standard wordpress editor.

If you have your editor in html mode it won't transfer the formatting, but the visual mode should.

Ralph

jtranter
Posts: 38
Joined: 2010-03-12 00:37:07

Re: Exporting to HTML without stylesheet info

Post by jtranter »

For over a decade now I have used a word processor to create an RTF file (or to convert a DOC file sent in) then a wonderful program called R2NET to translate the RTF file to XHTML. (Then BBedit to make it look nice.) (Nisus offers the best range of useful macros while in RTF format.)

R2NET works in Windows, Linux and MAC OS X. I produced most of the forty issues of a 250-page per issue internet magazine (jacket2.org) using it. I am not a computer programmer, by the way, just a writer. The programmers live here:

http://www.logictran.net/products/r2net.html

They say:

With R2Net, you can use your favorite word processor to create documents and then publish them in HTML, XHTML, DocBook, or OEB right out of the box. You can also add support for your own document types. R2Net is very customizable and can be fine tuned to give you the exact output you desire. We have ActiveX, DLL, Unix library, and Mac OS X Cocoa Framework versions of the filter that give you the power to embed R2Net in your own system, website, or product.

We offer a free evaluation version of R2Net that is fully functional for thirty (30) days. You can request either a standard demo license or a developer demo license that lets you take advantage of R2Net's library features.
Pricing (in US dollars)

License Price Annual Maintenance
Single User $69.95 $24.99
Server $699.95 $139.95
Developer $249.95 $49.95

If you're unsure about which license you need, or if you want to know more about how R2Net is licensed, click here:

http://www.logictran.net/products/licenses.html

I don't work for them (I hardly know them). I find they answer emails. And are very helpful.

best

John Tranter

feat
Posts: 105
Joined: 2004-01-29 04:17:10
Location: Paris, FR

Re: Exporting to HTML without stylesheet info

Post by feat »

the problem with r2net is there are quite a few idiosyncrasies it doesn't catch when processing NW output: for instance, it will quit converting at the first linked graphic file it encounters… that's because, it won't honor any Nisus internal link, be it a table of contents, an index, whatever…

otherwise, it's particularly good at generating some quite faithful html code — except it will occasionally swallow a linefeed or two here and there, especially when they're just before a change of style!

Post Reply