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

Source Code for Module doconce.st

 1   
 2  from epytext import epytext_author 
 3  from common import default_movie, plain_exercise, DEFAULT_ARGLIST 
 4   
5 -def define(FILENAME_EXTENSION, 6 BLANKLINE, 7 INLINE_TAGS_SUBST, 8 CODE, 9 LIST, 10 ARGLIST, 11 TABLE, 12 EXERCISE, 13 FIGURE_EXT, 14 CROSS_REFS, 15 INDEX_BIB, 16 INTRO, 17 OUTRO):
18 # all arguments are dicts and accept in-place modifications (extensions) 19 20 FILENAME_EXTENSION['st'] = '.st' 21 BLANKLINE['st'] = '\n' 22 # replacement patterns for substitutions of inline tags 23 INLINE_TAGS_SUBST['st'] = { 24 'math': r'\g<begin>\g<subst>\g<end>', 25 'math2': r'\g<begin>\g<puretext>\g<end>', 26 'emphasize': None, 27 'bold': r'\g<begin>**\g<subst>**\g<end>', 28 'verbatim': r"\g<begin>'\g<subst>'\g<end>", 29 'linkURL': r'\g<begin>"\g<url>":\g<link>\g<end>', 30 'linkURL2': r'"\g<url>":\g<link>', 31 'linkURL3': r'"\g<url>":\g<link>', 32 'linkURL2v': r"""\g<url>:'\g<link>'""", 33 'linkURL3v': r"""\g<url>:'\g<link>'""", 34 'plainURL': r'"\g<url>":\g<url>', 35 # the replacement string differs, depending on the match object m: 36 'chapter': r'\n\g<subst>\n', 37 'section': r'\n\g<subst>\n', 38 'subsection': r'\n\g<subst>\n', 39 'subsubsection': r'\n\g<subst>\n', 40 'paragraph': r'*\g<subst>* ', # extra blank 41 'abstract': r'*\g<type>.* \g<text>\n\g<rest>', 42 'title': r'TITLE: \g<subst>', 43 'date': r'DATE: \g<subst>', 44 'author': epytext_author, 45 'movie': default_movie, 46 } 47 48 from rst import rst_code, rst_table 49 CODE['st'] = rst_code 50 TABLE['st'] = rst_table 51 52 LIST['st'] = { 53 'itemize': 54 {'begin': '', 'item': '-', 'end': '\n'}, 55 56 'enumerate': 57 {'begin': '', 'item': '%d.', 'end': '\n'}, 58 59 'description': 60 {'begin': '', 'item': '%s -- ', 'end': '\n'}, 61 62 'separator': '', 63 } 64 ARGLIST['st'] = DEFAULT_ARGLIST 65 from plaintext import plain_ref_and_label, plain_index_bib 66 CROSS_REFS['st'] = plain_ref_and_label 67 INDEX_BIB['st'] = plain_index_bib 68 EXERCISE['st'] = plain_exercise
69