Package doconce :: Module html
[hide private]
[frames] | no frames]

Module html

source code

Functions [hide private]
 
html_code(filestr, format) source code
 
html_figure(m) source code
 
html_table(table) source code
 
html_movie(m) source code
 
html_author(authors_and_institutions, auth2index, inst2index, index2inst, auth2email) source code
 
html_ref_and_label(section_label2title, format, filestr) source code
 
bibdict2htmllist(pyfile, citations)
Transform dict with bibliography to an HTML ordered list with anchors.
source code
 
html_index_bib(filestr, index, citations, bibfile) source code
 
define(FILENAME_EXTENSION, BLANKLINE, INLINE_TAGS_SUBST, CODE, LIST, ARGLIST, TABLE, EXERCISE, FIGURE_EXT, CROSS_REFS, INDEX_BIB, INTRO, OUTRO) source code
 
latin2html(text)
Transform a text with possible latin-1 characters to the equivalent valid text in HTML with all special characters with ordinal > 159 encoded as &#number;
source code
Variables [hide private]
  __package__ = 'doconce'
Function Details [hide private]

latin2html(text)

source code 

Transform a text with possible latin-1 characters to the equivalent valid text in HTML with all special characters with ordinal > 159 encoded as &#number;

Method: convert from plain text (open(filename, 'r')) to utf-8, run through each character c, if ord(c) > 159, add the HTML encoded text to a list, otherwise just add c to the list, then finally join the list to make the new version of the text.

Note: A simpler method is just to set <?xml version="1.0" encoding="utf-8" ?> as the first line in the HTML file, see how rst2html.py starts the HTML file. (However, the method below shows how to cope with special European characters in general.)