Skip to content

mjl-/textmangle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# status

starting to become useful.  the library interface will probably
change.


# 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:

headers
	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.
list
	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)
	element.
description
	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.
paragraph
	just a paragraph of text
sequence
	sequence of constructs, with each construct being one of
	the above.

this file is valid textmangle-syntax.


# download

get the latest version at:

	http://www.ueber.net/code/r/textmangle


# 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.

About

from mercurial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published