User:EMBee/Scrap: Difference between revisions

From Rosetta Code
Content added Content deleted
(stuff i'd like to do when i can find the time, if someone else wants to do it, please go ahead.)
(potential algorithm for a text to html conversion)
Line 2: Line 2:
* suggest task for binary math.
* suggest task for binary math.
* draft task for math with boolean lists like in early lisp as per http://paste.lisp.org/display/126287
* draft task for math with boolean lists like in early lisp as per http://paste.lisp.org/display/126287

==Text to HTML==
Convert plain text to HTML.
The plain text has no formatting information.
It may have centered headlines, numbered sections, paragraphs, lists, and URIs. It could even have tables.

potential algorithm:
* split by line
* find average line length to identify centered lines
* find isolated lines to identify section headings
* find URIs
* identify section numbering
* identify bullet and numbered lists
* identify paragraphs
* identify indented lines
* if possible identify tables

to ensure valid html/xhtml create a nested structure:
* create an xml node
* add elements to node
* add lines to element if multiline like paragraph

Revision as of 11:39, 4 January 2012

  • add "suggest task" and "task by category" links to tasks page.
  • suggest task for binary math.
  • draft task for math with boolean lists like in early lisp as per http://paste.lisp.org/display/126287

Text to HTML

Convert plain text to HTML. The plain text has no formatting information. It may have centered headlines, numbered sections, paragraphs, lists, and URIs. It could even have tables.

potential algorithm:

  • split by line
  • find average line length to identify centered lines
  • find isolated lines to identify section headings
  • find URIs
  • identify section numbering
  • identify bullet and numbered lists
  • identify paragraphs
  • identify indented lines
  • if possible identify tables

to ensure valid html/xhtml create a nested structure:

  • create an xml node
  • add elements to node
  • add lines to element if multiline like paragraph