I prefer to write everything as a text file w. textwidth=80 and have
written this very simple script which uses the "txt2html" tool to
generate an HTML file which can later be used to paste the formatted
article into, eg., OpenOffice:
------------ BEGIN ------------
#!/bin/bash
#view text document in HTML page
BASEDIR=~/Work
FN=${USER}_$1
txt2html --xhtml --append_head $BASEDIR/html/txthead.html
--escape_HTML_chars --titlefirst --eight_bit_clean $1.txt
> /tmp/$FN.html
firefox /tmp/$FN.html &
------------ END ------------
This script allows simple formatting like *italics* and _underline_, but
I'd like something a but more "shiny", which would e.g. also recognize
chapter and section headings and maybe even generate a TOC.
Does anybody have any recommendations? There's txt2tags, which I just
found (http://txt2tags.sourceforge.net/writing-book.html), and I suppose
one could write something similar to easily convert a text file to a
LaTex file, but as I said - do anyone have any experience using such
tools?
Till now, I've been happy with my small "view as HTML" script, but with
the more elaborate structure needed in a book I'm beginning to feel its
limitations.
Thanks in advance for any response,
Carsten
Carsten Agger <a...@c.dk> dixit:
> This script allows simple formatting like *italics* and _underline_, but
> I'd like something a but more "shiny", which would e.g. also recognize
> chapter and section headings and maybe even generate a TOC.
Don't know about the TOC, but a time ago I heard from a tool called
"otl" that does more or less what you want.
Anyway, if your plan is to publish the book as HTML, I would use some
almost-plain-text format that already had some kind of powerful HTML
converter/generator. Like, for example, POD (maybe a bit limited for
what you want) or the Python tools (Docutils, reStructuredText and
Sphinx).
I have no big experience with those tools, though, and myself I would
write directly using HTML and will generate the TOC with a hand made
script, probably. Nonetheless Sphinx sounds promising for your needs, or
even otl.
--
Raúl "DervishD" Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
...snip...This script allows simple formatting like *italics* and _underline_, but I'd like something a but more "shiny", which would e.g. also recognize chapter and section headings and maybe even generate a TOC.
Thanks for all the tips - I'll check all of your suggestions out! It
seems there are quite a few ways of doing this. :-)
You may want to have a look at docutils, http://docutils.sourceforge.net/
"Docutils is an open-source text processing system for processing
plaintext documentation into useful formats, such as HTML or LaTeX. It
includes reStructuredText, the easy to read, easy to use,
what-you-see-is-what-you-get plaintext markup language."
reStructuredText handles TOC, headings, lists, tables. The markup
is such that the original text can be easily read as a plain text.
reStructuredText is used for the Python documentation.
I am using docutils and reStructuredText in a moinmoin wiki and find
it very useful.
Xavier
+1 for reStructuredText. Easy to write, readable in source form, and
looks good both in html and as latex converted to pdf.
~Matt
On Thu, Jul 09, 2009 at 11:17:36AM +0200, Carsten Agger wrote:
> [snip]
>
> Till now, I've been happy with my small "view as HTML" script, but with
> the more elaborate structure needed in a book I'm beginning to feel its
> limitations.
>
> Thanks in advance for any response,
>
> Carsten
Hi Carsten,
Another good almost-plain-text format is AsciiDoc [1] which I
really like. It's similar to reStructuredText and is easy to
read/write and very readable. It also has a good Vim syntax
hilighting.
It can be easily converted to HTML and through DocBook to many
other formats like LaTeX, PDF, etc. (It's also useful to create
man pages.)
Simon
[1]: http://methods.co.nz/asciidoc/
- --
+ privacy is necessary
+ using http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iQIcBAEBCAAGBQJKV3PhAAoJEJL+/bfkTDL5qiUQALDGG+FWxRC6W8CazuzxIpAJ
20/1SPAUllYv+ZDxj0APVSM3L6mwlBZeX1Pn/n3TZy1zbglsWNqAK1ogNdArH2gh
yGy7vVGT7F8M46n4ANo+NiCru86UdVqgN+/FoQ6+syqFQD9Zgtf5STQjyw6eHbe2
PtaYM3GWo0lMWlojjPfBFLqHbw1c1BZWQA6sUFE8hI7r/u3FjF/xj6k/BUJFVIHR
WMQnDYXGq7WQ44Y6zwhOvO3hkQDJlVIhZmgHGZqErTrX7nVitNdT8/VMX17TVj40
NM6/SO9bW7BQMbJn75v7f4bzGzLwocmNGbY1pdIG994tbDji8GEHkjy+JDfO1LIN
StaNSH+nM/BG0OJydzi0CDYYd+xCUeWHzmETPSYFPpfgsjU66ADlCatAd5lF1YR0
5byL8SIjFj2MQ4BP3bn3E2m7azK/qaJZKKLZgpgQqGpJvd67vZ19nCYaoVkhmLfW
ihwNI7mYjIXi74gDlRPXvJCF3tg7WwjDgoUwiB+zSte/XXC3gBg5itlxmstJlTfM
rww258pdBqpcFRYdqCrfJEpKWmpLfIXo7cprpDPV5OKH3Ux5O4OKwI+ALyyS1tps
J9D7Vh3flvs177S+8c0CKnpoeaO563Q3eZ0V4iH2r0WEy1ObXPkqKubBJw/+2GKn
mu8GO18ibm6YQBthhXvs
=md7y
-----END PGP SIGNATURE-----
Call me old-school -- heh, I'm a *vi* user for crying out loud! -- but I
use groff with the mdoc or the newer mom macros. I figure that if
you're already committed to the idea of marking up plain test, you might
as well go with the traditional solution. It's not really any harder to
learn than any of the newer markup tools.
I'm also very fond of the supplementary "little languages" like pic, eqn
and tbl. Being able to use them in my documents is a plus.
Of course, groff can output to PDF or HTML too, so no one needs to know
you used a dinosaur app to create the documents you circulate. ;-)