1. Mechiel Lukkien
  2. textmangle


# status

starting to become useful.  the library interface will probably

# intro

the library textmangle parses readable utf-8 ascii text and distills
block-level layout information from it.  it can then convert it to
either text, html (with or without keeping original formatting),
latex or troff (ms).  there is no code yet for parsing inline layout
information, it may be added in the future.

the syntax is inspired by markdown, restructured text, etc.

the following layout information can be found in a document:

	starting with a ``#'', multiple such hashes can be specified,
	causing deeper levels of headings.
quoted text
	just indented text.  handled the same as normal text, except
	that headers are treated as normal text.
	a listing.  items start with either ``- '', ``* '' or ``• ''.
	multi-line text can be created by starting second and later
	lines with two spaces.  complexer structures can be created
	by indenting text after the first (single- or multiline)
	lists one-line titles, and then their descriptions.  the
	title can only be one line long.  the description follows
	immediately, as indented text.  just like with lists, complex
	constructures can be create.
	just a paragraph of text
	sequence of constructs, with each construct being one of
	the above.

this file is valid textmangle-syntax.

# download

get the latest version at:


# install

make sure you have $ROOT set, now "mk install" to compile and install
the files.

when building from within inferno, insert SYSHOST=Inferno and ROOT=
in the mk invocations to override the values in the mkconfig.

# run

the program "mangletext" uses the library to parse text and output
in one of the formats.  see the program's usage for help.  the
program is a simple example of how to use the library.  the library
has output generating functions (they are small).

# licence & author

this code is in the public domain.  the code is written by mechiel
lukkien, reachable at mechiel@xs4all.nl or mechiel@ueber.net.

# todo

- understand lists in middle of text?  so we don't require a newline
  before a list?
- indented paragraphs in normal text should be seen as quoted text,
  or an example (code).  for lists & descriptions, they should be
  handled like normal text.
- test more, find more corner cases.  the text output sometimes
  generates too many trailing newlines for indented text.
- more fully implement & test latex and troff output
- make textmangle recognize enumerations/ordered lists?
- understand some form of quoted text, where no markup is interpreted.
- implement inline markup?
- inline syntax:
	* automatic urls?
	* inline html/troff/latex/text?
	* bold, italic, monospace
	* need "verbatim" quote/indent?
- write manual page?
- try to conform a bit more with markdown.  to make transitions easier.