""" A MoinMoin target. http://moinmo.in """ from targets import _ NAME = _('MoinMoin page') TYPE = 'wiki' HEADER = """\ '''%(HEADER1)s''' ''%(HEADER2)s'' %(HEADER3)s """ # http://moinmo.in/HelpOnMoinWikiSyntax TAGS = { 'title1' : '= \a =' , 'title2' : '== \a ==' , 'title3' : '=== \a ===' , 'title4' : '==== \a ====' , 'title5' : '===== \a =====', 'blockVerbOpen' : '{{{' , 'blockVerbClose' : '}}}' , 'blockQuoteLine' : ' ' , 'fontMonoOpen' : '{{{' , 'fontMonoClose' : '}}}' ,
""" A CSV table target. """ import targets from targets import _ NAME = _('CSV table') TYPE = 'office' TAGS = { 'tableCellSep' : targets.CSV['separator'] , 'tableCellOpen' : targets.CSV.get('quotechar') or '' , 'tableCellClose' : targets.CSV.get('quotechar') or '' , } RULES = { 'tableable': 1, 'tableonly': 1, 'tablecellstrip': 1, 'blanksaroundtable': 1, 'confdependenttags': 1, }
""" A HTML5 target. """ from targets import _ from html import TYPE import html NAME = _('HTML5 page') EXTENSION = 'html' HEADER = """\ <!DOCTYPE html> <html> <head> <meta charset="%(ENCODING)s"> <title>%(HEADER1)s</title> <meta name="generator" content="http://txt2tags.org"> <link rel="stylesheet" href="%(STYLE)s"> <style> body{background-color:#fff;color:#000;} hr{background-color:#000;border:0;color:#000;} hr.heavy{height:5px;} hr.light{height:1px;} img{border:0;display:block;} img.right{margin:0 0 0 auto;} img.center{border:0;margin:0 auto;} table th,table td{padding:4px;} .center,header{text-align:center;} table.center {margin-left:auto; margin-right:auto;}
""" A BBCode target. http://www.bbcode.org """ from targets import _ NAME = _('BBCode document') TYPE = 'wiki' HEADER = """\ %(HEADER1)s %(HEADER2)s %(HEADER3)s """ # http://www.phpbb.com/community/faq.php?mode=bbcode # http://www.bbcode.org/reference.php (but seldom implemented) TAGS = { 'title1' : '[size=200]\a[/size]' , 'title2' : '[size=170]\a[/size]' , 'title3' : '[size=150]\a[/size]' , 'title4' : '[size=130]\a[/size]' , 'title5' : '[size=120]\a[/size]' , 'blockQuoteOpen' : '[quote]' , 'blockQuoteClose' : '[/quote]' , 'fontMonoOpen' : '[code]' , 'fontMonoClose' : '[/code]' , 'fontBoldOpen' : '[b]' , 'fontBoldClose' : '[/b]' ,
""" A Plain Text target. """ from targets import _ NAME = _('Plain Text') TYPE = 'text' HEADER = """\ %(HEADER1)s %(HEADER2)s %(HEADER3)s """ TAGS = { 'title1': ' \a', 'title2': '\t\a', 'title3': '\t\t\a', 'title4': '\t\t\t\a', 'title5': '\t\t\t\t\a', 'blockQuoteLine': '\t', 'listItemOpen': '- ', 'numlistItemOpen': '\a. ', 'bar1': '\a', 'url': '\a', 'urlMark': '\a (\a)', 'email': '\a', 'emailMark': '\a (\a)', 'img': '[\a]',
""" A Slidy target. http://www.w3.org/Talks/Tools/Slidy2 """ from targets import _ from targets.xhtml import RULES, EXTENSION import targets.xhtml NAME = _('Slidy slides') TYPE = 'office' TAGS = targets.xhtml.TAGS.copy() TAGS['numlistOpen'] = '<ul class="incremental">' TAGS['numlistClose'] = '</ul>' TAGS['blocktitle1Open'] = '<div class="slide">' TAGS['blocktitle1Close'] = '</div>' HEADER = """\ <?xml version="1.0" encoding="%(ENCODING)s"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>%(HEADER1)s</title> <meta name="copyright" content="Copyright © %(HEADER2)s %(HEADER2)s" /> <meta name="generator" content="http://txt2tags.org" /> <link rel="stylesheet" type="text/css" media="screen, projection, print" href="slidy_t2t.css" /> <link rel="stylesheet" type="text/css" href="%(STYLE)s" />
""" A RTF target. Target specific occurrence number in txt2tags core: 6. """ from targets import _ NAME = _('RTF document') TYPE = 'office' HEADER = \ r"""{\rtf1\ansi\ansicpg1252\deff0 {\fonttbl {\f0\froman Times;} {\f1\fswiss Arial;} {\f2\fmodern Courier;} } {\colortbl;\red0\green0\blue255;} {\stylesheet {\s1\sbasedon222\snext1\f0\fs24\cf0 Normal;} {\s2\sbasedon1\snext2{\*\txttags paragraph}\f0\fs24\qj\sb0\sa0\sl480\slmult1\li0\ri0\fi360 Body Text;} {\s3\sbasedon2\snext3{\*\txttags verbatim}\f2\fs20\ql\sb0\sa240\sl240\slmult1\li720\ri720\fi0 Verbatim;} {\s4\sbasedon2\snext4{\*\txttags quote}\f0\fs24\qj\sb0\sa0\sl480\slmult1\li720\ri720\fi0 Block Quote;} {\s10\sbasedon1\snext10\keepn{\*\txttags maintitle}\f1\fs24\qc\sb0\sa0\sl480\slmult1\li0\ri0\fi0 Title;} {\s11\sbasedon1\snext2\keepn{\*\txttags title1}\f1\fs24\qc\sb240\sa240\sl480\slmult1\li0\ri0\fi0\b Heading 1;} {\s12\sbasedon11\snext2\keepn{\*\txttags title2}\f1\fs24\ql\sb240\sa240\sl480\slmult1\li0\ri0\fi0\b Heading 2;} {\s13\sbasedon11\snext2\keepn{\*\txttags title3}\f1\fs24\ql\sb240\sa240\sl480\slmult1\li360\ri0\fi0\b Heading 3;} {\s14\sbasedon11\snext2\keepn{\*\txttags title4}\f1\fs24\ql\sb240\sa240\sl480\slmult1\li360\ri0\fi0\b\i Heading 4;} {\s15\sbasedon11\snext2\keepn{\*\txttags title5}\f1\fs24\ql\sb240\sa240\sl480\slmult1\li360\ri0\fi0\i Heading 5;} {\s21\sbasedon2\snext21{\*\txttags list}\f0\fs24\qj\sb0\sa0\sl480\slmult1{\*\txttags list indent}\li720\ri0\fi-360 List;}
""" A Lout target. http://savannah.nongnu.org/projects/lout Target specific occurrence number in txt2tags core: 2. """ from targets import _ NAME = _('Lout document') TYPE = 'office' HEADER = """\ @SysInclude { doc } @Document @InitialFont { Times Base 12p } # Times, Courier, Helvetica, ... @PageOrientation { Portrait } # Portrait, Landscape @ColumnNumber { 1 } # Number of columns (2, 3, ...) @PageHeaders { Simple } # None, Simple, Titles, NoTitles @InitialLanguage { English } # German, French, Portuguese, ... @OptimizePages { Yes } # Yes/No smart page break feature // @Text @Begin @Display @Heading { %(HEADER1)s } @Display @I { %(HEADER2)s } @Display { %(HEADER3)s } #@NP # Break page after Headers """ TAGS = { 'paragraphOpen': '@LP',
""" A WordPress target. http://wordpress.org """ from targets import _ import html NAME = _('WordPress post') TYPE = 'html' HEADER = HEADERCSS = """\ %(HEADER1)s %(HEADER2)s %(HEADER3)s """ TAGS = html.TAGS.copy() for tag in TAGS: TAGS[tag] = TAGS[tag].lower() WPTAGS = { # Exclusions to let the WordPress code cleaner 'bodyOpen': '', 'bodyClose': '', 'paragraphOpen': '', 'paragraphClose': '', 'comment': '', 'EOD': '', # All list items must be closed 'listItemClose': '</li>',
""" A DocBook target. """ from targets import _ NAME = _('DocBook document') TYPE = 'office' HEADER = """\ <?xml version="1.0" encoding="%(ENCODING)s" ?> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"\ "docbook/dtd/xml/4.5/docbookx.dtd"> <article lang="en"> <articleinfo> <title>%(HEADER1)s</title> <authorgroup> <author><othername>%(HEADER2)s</othername></author> </authorgroup> <date>%(HEADER3)s</date> </articleinfo> """ TAGS = { 'paragraphOpen': '<para>', 'paragraphClose': '</para>', 'title1Open': '~A~<sect1><title>\a</title>', 'title1Close': '</sect1>',
""" A PmWiki target. http://www.pmwiki.org """ from targets import _ NAME = _('PmWiki page') TYPE = 'wiki' HEADER = """\ (:Title %(HEADER1)s:) (:Description %(HEADER2)s:) (:Summary %(HEADER3)s:) """ # http://www.pmwiki.org/wiki/PmWiki/TextFormattingRules # http://www.pmwiki.org/wiki/Main/WikiSandbox TAGS = { 'title1': '~A~! \a ', 'title2': '~A~!! \a ', 'title3': '~A~!!! \a ', 'title4': '~A~!!!! \a ', 'title5': '~A~!!!!! \a ', 'blockQuoteOpen': '->', 'blockQuoteClose': '\n', # In-text font 'fontLargeOpen': "[+",
""" A SPIP target. http://www.spip.net """ from targets import _ NAME = _('SPIP article') TYPE = 'wiki' HEADER = """\ {{{%(HEADER1)s}}} {{%(HEADER2)s}} {%(HEADER3)s} """ # http://www.spip-contrib.net/Les-raccourcis-typographiques-en # http://www.spip-contrib.net/Carnet-Bac-a-Sable # some tags are not implemented by spip tags, but spip accept html tags. TAGS = { 'title1': '{{{ \a }}}', 'title2': '<h4>\a</h4>', 'title3': '<h5>\a</h5>', 'blockVerbOpen': '<cadre>', 'blockVerbClose': '</cadre>', 'blockQuoteOpen': '<quote>', 'blockQuoteClose': '</quote>',
""" A reStructuredText target. http://docutils.sourceforge.net/rst.html """ from lib import aa import targets from targets import _ NAME = _('ReStructuredText document') TYPE = 'wiki' TAGS = { 'title1': '\a', 'title2': '\a', 'title3': '\a', 'title4': '\a', 'title5': '\a', 'blockVerbOpen': '::\n', 'blockQuoteLine': ' ', 'listItemOpen': targets.RST['bullet'] + ' ', 'numlistItemOpen': '\a. ', 'bar1': aa.line(targets.RST['bar1'], 10), 'url': '\a', 'urlMark': '`\a <\a>`_', 'email': '\a', 'emailMark': '`\a <\a>`_', 'img': '\n\n.. image:: \a\n :align: ~A~\n\nENDIMG', 'urlImg': '\n :target: ', '_imgAlignLeft': 'left',
""" A PageMaker target. Target specific occurrence number in txt2tags core: 1. """ from targets import _ NAME = _('PageMaker document') TYPE = 'office' HEADER = """\ <PMTags1.0 win><C-COLORTABLE ("Preto" 1 0 0 0) ><@Normal= <FONT "Times New Roman"><CCOLOR "Preto"><SIZE 11> <HORIZONTAL 100><LETTERSPACE 0><CTRACK 127><CSSIZE 70><C+SIZE 58.3> <C-POSITION 33.3><C+POSITION 33.3><P><CBASELINE 0><CNOBREAK 0><CLEADING -0.05> <GGRID 0><GLEFT 7.2><GRIGHT 0><GFIRST 0><G+BEFORE 7.2><G+AFTER 0> <GALIGNMENT "justify"><GMETHOD "proportional"><G& "ENGLISH"> <GPAIRS 12><G%% 120><GKNEXT 0><GKWIDOW 0><GKORPHAN 0><GTABS $> <GHYPHENATION 2 34 0><GWORDSPACE 75 100 150><GSPACE -5 0 25> ><@Bullet=<@-PARENT "Normal"><FONT "Abadi MT Condensed Light"> <GLEFT 14.4><G+BEFORE 2.15><G%% 110><GTABS(25.2 l "")> ><@PreFormat=<@-PARENT "Normal"><FONT "Lucida Console"><SIZE 8><CTRACK 0> <GLEFT 0><G+BEFORE 0><GALIGNMENT "left"><GWORDSPACE 100 100 100><GSPACE 0 0 0> ><@Title1=<@-PARENT "Normal"><FONT "Arial"><SIZE 14><B> <GCONTENTS><GLEFT 0><G+BEFORE 0><GALIGNMENT "left"> ><@Title2=<@-PARENT "Title1"><SIZE 12><G+BEFORE 3.6> ><@Title3=<@-PARENT "Title1"><SIZE 10><GLEFT 7.2><G+BEFORE 7.2> ><@Title4=<@-PARENT "Title3"> ><@Title5=<@-PARENT "Title3">
""" A Creole 1.0 target. http://www.wikicreole.org """ from targets import _ NAME = _('Creole 1.0 document') TYPE = 'wiki' HEADER = """\ %(HEADER1)s %(HEADER2)s %(HEADER3)s """ # http://www.wikicreole.org/wiki/AllMarkup TAGS = { 'title1': '= \a =', 'title2': '== \a ==', 'title3': '=== \a ===', 'title4': '==== \a ====', 'title5': '===== \a =====', 'blockVerbOpen': '{{{', 'blockVerbClose': '}}}', 'blockQuoteLine': ' ', # 'fontMonoOpen' : '##' , # planned for 2.0, # 'fontMonoClose' : '##' , # meanwhile we disable it 'fontBoldOpen': '**', 'fontBoldClose': '**',
""" A MagicPoint target. http://member.wide.ad.jp/wg/mgp Target specific occurrence number in txt2tags core: 5. """ from targets import _ NAME = _('MagicPoint presentation') TYPE = 'office' HEADER = """\ #!/usr/X11R6/bin/mgp -t 90 %%deffont "normal" xfont "utopia-medium-r", charset "iso8859-1" %%deffont "normal-i" xfont "utopia-medium-i", charset "iso8859-1" %%deffont "normal-b" xfont "utopia-bold-r" , charset "iso8859-1" %%deffont "normal-bi" xfont "utopia-bold-i" , charset "iso8859-1" %%deffont "mono" xfont "courier-medium-r", charset "iso8859-1" %%default 1 size 5 %%default 2 size 8, fore "yellow", font "normal-b", center %%default 3 size 5, fore "white", font "normal", left, prefix " " %%tab 1 size 4, vgap 30, prefix " ", icon arc "red" 40, leftfill %%tab 2 prefix " ", icon arc "orange" 40, leftfill %%tab 3 prefix " ", icon arc "brown" 40, leftfill %%tab 4 prefix " ", icon arc "darkmagenta" 40, leftfill %%tab 5 prefix " ", icon arc "magenta" 40, leftfill %%%%------------------------- end of headers ----------------------------- %%page
""" A XHTML target. """ from targets import _ from html import TYPE, RULES import html NAME = _('XHTML page') EXTENSION = 'html' HEADER = """\ <?xml version="1.0" encoding="%(ENCODING)s" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>%(HEADER1)s</title> <meta name="generator" content="http://txt2tags.org" /> <link rel="stylesheet" type="text/css" href="%(STYLE)s" /> </head> <body bgcolor="white" text="black"> <div align="center"> <h1>%(HEADER1)s</h1> <h2>%(HEADER2)s</h2> <h3>%(HEADER3)s</h3> </div> """
""" An AsciiDoc target. http://www.methods.co.nz/asciidoc """ from targets import _ NAME = _('AsciiDoc document') ALIASES = ['asc', 'asciidoc'] TYPE = 'wiki' HEADER = """\ = %(HEADER1)s %(HEADER2)s %(HEADER3)s """ # http://asciidoc.org/asciidoc.css-embedded.html TAGS = { 'title1' : '== \a' , 'title2' : '=== \a' , 'title3' : '==== \a' , 'title4' : '===== \a' , 'title5' : '===== \a' , 'blockVerbOpen' : '----' , 'blockVerbClose' : '----' , 'deflistItem1Close' : '::' , 'deflistClose' : '' , 'deflistItem2Open' : ' ' ,
""" A LaTeX target. http://www.latex-project.org Target specific occurrence number in txt2tags core: 7. """ from targets import _ NAME = _('LaTeX document') ALIASES = ['latex'] TYPE = 'office' HEADER = \ r"""\documentclass{article} \usepackage{graphicx} \usepackage{paralist} %% needed for compact lists \usepackage[normalem]{ulem} %% needed by strike \usepackage[urlcolor=blue,colorlinks=true]{hyperref} \usepackage[%(ENCODING)s]{inputenc} %% char encoding \usepackage{%(STYLE)s} %% user defined \title{%(HEADER1)s} \author{%(HEADER2)s} \begin{document} \date{%(HEADER3)s} \maketitle \clearpage """
""" A SPIP target. http://www.spip.net """ from targets import _ NAME = _('SPIP article') TYPE = 'wiki' HEADER = """\ {{{%(HEADER1)s}}} {{%(HEADER2)s}} {%(HEADER3)s} """ # http://www.spip-contrib.net/Les-raccourcis-typographiques-en # http://www.spip-contrib.net/Carnet-Bac-a-Sable # some tags are not implemented by spip tags, but spip accept html tags. TAGS = { 'title1' : '{{{ \a }}}' , 'title2' : '<h4>\a</h4>', 'title3' : '<h5>\a</h5>', 'blockVerbOpen' : '<cadre>' , 'blockVerbClose' : '</cadre>' , 'blockQuoteOpen' : '<quote>' , 'blockQuoteClose' : '</quote>' ,
""" A XHTML Strict target. """ from targets import _ from html import TYPE, RULES import html NAME = _('XHTML Strict page') EXTENSION = 'html' HEADER = """\ <?xml version="1.0" encoding="%(ENCODING)s" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>%(HEADER1)s</title> <meta name="generator" content="http://txt2tags.org" /> <link rel="stylesheet" type="text/css" href="%(STYLE)s" /> <style type="text/css">body {background-color:#FFFFFF ; color:#000000}</style> </head> <body> <div style="text-align:center"> <h1>%(HEADER1)s</h1> <h2>%(HEADER2)s</h2> <h3>%(HEADER3)s</h3> </div>
import aatw from aatw import TYPE, EXTENSION, TAGS from targets import _ NAME = _('ASCII Art Spreadsheet Web') RULES = aatw.RULES.copy() RULES['tableonly'] = 1 RULES['spread'] = 1 RULES['spreadgrid'] = 1 RULES['spreadmarkup'] = 'html'
""" A CSV table target. """ import targets from targets import _ NAME = _('CSV table') TYPE = 'office' TAGS = { 'tableCellSep': targets.CSV['separator'], 'tableCellOpen': targets.CSV.get('quotechar') or '', 'tableCellClose': targets.CSV.get('quotechar') or '', } RULES = { 'tableable': 1, 'tableonly': 1, 'tablecellstrip': 1, 'blanksaroundtable': 1, 'confdependenttags': 1, }
""" An Open Document Spreadsheet target. """ from targets import _ NAME = _('Open Document Spreadsheet') TYPE = 'office' HEADER = """\ <?xml version='1.0' encoding='UTF-8'?> <office:document xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:version="1.1" office:mimetype="application/vnd.oasis.opendocument.spreadsheet"><office:meta><meta:generator>Txt2tags www.txt2tags.org</meta:generator></office:meta><office:automatic-styles/><office:body><office:spreadsheet> """ TAGS = { 'tableOpen': '<table:table table:name="' + _('Sheet') + 'n_table">', 'tableClose': '</table:table>', 'tableRowOpen': '<table:table-row>', 'tableRowClose': '</table:table-row>', 'tableCellOpen': '<table:table-cell><text:p>', 'tableCellClose': '</text:p></table:table-cell>', 'EOD': '</office:spreadsheet></office:body></office:document>', } RULES = { 'escapexmlchars': 1, 'tableable': 1, 'tableonly': 1, 'tablecellstrip': 1, 'tablenumber': 1,
""" A MOM target. http://www.schaffter.ca/mom/mom-01.html """ from targets import _ NAME = _('MOM groff macro') TYPE = 'office' ## MOM ## # # "mom" is a sort of "LaTeX" for groff and has a lot of macro # commands and variables to customize for specific needs. # These few lines of commands are sufficient anyway for a good # postscript typesetted document (and so also pdf): the author # of "mom" is a professional typographer so the typesetting # defaults are pleasant and sane. See mom's author site: # http://www.schaffter.ca/mom/mom-01.html that's a good # example of documentation too! # NB: \# are commented lines in groff. # I put here a lot of options, commented or not, to let you # see the possibilities but there many more... # NB: use "-k" option for groff if input/output is UTF-8 # # usage: groff -k -m mom sample.mom > sample.ps # HEADER = """\ \# Cover and title .TITLE "%(HEADER1)s"
""" An Open Document Spreadsheet target. """ from targets import _ NAME = _('Open Document Spreadsheet') TYPE = 'office' HEADER = """\ <?xml version='1.0' encoding='UTF-8'?> <office:document xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:version="1.1" office:mimetype="application/vnd.oasis.opendocument.spreadsheet"><office:meta><meta:generator>Txt2tags www.txt2tags.org</meta:generator></office:meta><office:automatic-styles/><office:body><office:spreadsheet> """ TAGS = { 'tableOpen' : '<table:table table:name="' + _('Sheet') + 'n_table">', 'tableClose' : '</table:table>' , 'tableRowOpen' : '<table:table-row>' , 'tableRowClose' : '</table:table-row>' , 'tableCellOpen' : '<table:table-cell><text:p>' , 'tableCellClose' : '</text:p></table:table-cell>' , 'EOD' : '</office:spreadsheet></office:body></office:document>', } RULES = { 'escapexmlchars': 1, 'tableable': 1, 'tableonly': 1, 'tablecellstrip': 1, 'tablenumber': 1,
from lib import aa import aat from aat import TYPE, EXTENSION import targets from targets import _ NAME = _('ASCII Art Presentation') TAGS = aat.TAGS.copy() TAGS['urlMark'] = TAGS['emailMark'] = '\a (\a)' TAGS['bar1'] = aa.line(targets.AA['bar1'], targets.CONF['width'] - 2) TAGS['bar2'] = aa.line(targets.AA['bar2'], targets.CONF['width'] - 2) if not targets.CONF['chars']: TAGS['listItemOpen'] = '* ' RULES = aat.RULES.copy() RULES['blanksaroundtitle'] = 0 RULES['blanksaroundnumtitle'] = 0 RULES['blanksaroundlist'] = 0 RULES['blanksaroundnumlist'] = 0 RULES['blanksarounddeflist'] = 0 RULES['slides'] = 1
""" A WordPress target. http://wordpress.org """ from targets import _ import html NAME = _('WordPress post') TYPE = 'html' HEADER = HEADERCSS = """\ %(HEADER1)s %(HEADER2)s %(HEADER3)s """ TAGS = html.TAGS.copy() for tag in TAGS: TAGS[tag] = TAGS[tag].lower() WPTAGS = { # Exclusions to let the WordPress code cleaner 'bodyOpen' : '', 'bodyClose' : '', 'paragraphOpen' : '', 'paragraphClose' : '', 'comment' : '', 'EOD' : '', # All list items must be closed 'listItemClose' : '</li>' ,
""" A MediaWiki (Wikipedia) target. http://www.mediawiki.org """ from targets import _ NAME = _('Wikipedia page') TYPE = 'wiki' HEADER = """\ '''%(HEADER1)s''' %(HEADER2)s ''%(HEADER3)s'' """ # http://en.wikipedia.org/wiki/Help:Editing # http://www.mediawiki.org/wiki/Sandbox TAGS = { 'title1' : '== \a ==' , 'title2' : '=== \a ===' , 'title3' : '==== \a ====' , 'title4' : '===== \a =====' , 'title5' : '====== \a ======', 'blockVerbOpen' : '<pre>' , 'blockVerbClose' : '</pre>' , 'blockQuoteOpen' : '<blockquote>' , 'blockQuoteClose' : '</blockquote>' ,
""" A Google Wiki target. """ from targets import _ NAME = _('Google Wiki page') TYPE = 'wiki' HEADER = """\ *%(HEADER1)s* %(HEADER2)s _%(HEADER3)s_ """ # http://code.google.com/p/support/wiki/WikiSyntax TAGS = { 'title1' : '= \a =' , 'title2' : '== \a ==' , 'title3' : '=== \a ===' , 'title4' : '==== \a ====' , 'title5' : '===== \a =====', 'blockVerbOpen' : '{{{' , 'blockVerbClose' : '}}}' , 'blockQuoteLine' : ' ' , 'fontMonoOpen' : '{{{' , 'fontMonoClose' : '}}}' , 'fontBoldOpen' : '*' ,
""" A LaTeX Spreadsheet target. Target specific occurrence number in txt2tags core: 7. """ # inherits from the LaTeX target from tex import TYPE, TAGS, ESCAPES import tex from targets import _ NAME = _('LaTeX Spreadsheet') EXTENSION = 'tex' HEADER = \ r"""\documentclass{article} \usepackage{graphicx} \usepackage[urlcolor=black,colorlinks=true]{hyperref} \usepackage[%(ENCODING)s]{inputenc} %% char encoding \usepackage{%(STYLE)s} %% user defined \begin{document} """ RULES = tex.RULES.copy() RULES['tableonly'] = 1 RULES['spread'] = 1 RULES['spreadgrid'] = 1 RULES['spreadmarkup'] = 'tex'
""" An utmac target. http://utroff.org/tmac.html http://utroff.org/man/utmac.html man utmac """ from targets import _ NAME = _('Utmac document') TYPE = 'office' HEADER = """\ .DT "%(HEADER1)s" .DA "%(HEADER2)s" .DI "%(HEADER3)s" .H1 "%(HEADER1)s" .H* "%(HEADER2)s" . .\\" txt2tags shortcuts .ds url \\W'\\\\$2'\\\\$1\\W .ds mail \\W'mailto:\\\\$2'\\\\$1\\W .ds underl \\Z'\\\\$*'\\v'.25m'\\l"\\w'\\\\$*'u"\\v'-.25m' .ds strike \\Z'\\\\$*'\\v'-.25m'\\l"\w'\\\\$*'u"\\v'.25m' .\\"ds underl \\X'SetColor blue'\\\\$1\\X'SetColor black' .\\"ds strike \\X'SetColor red'\\\\$1\\X'SetColor black' .\ """ TAGS = {
""" A HTML 4.0 target. """ from targets import _ import targets from config import HTML_LOWER NAME = _('HTML page') TYPE = 'html' HEADER = """\ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <META NAME="generator" CONTENT="http://txt2tags.org"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=%(ENCODING)s"> <LINK REL="stylesheet" TYPE="text/css" HREF="%(STYLE)s"> <TITLE>%(HEADER1)s</TITLE> </HEAD><BODY BGCOLOR="white" TEXT="black"> <CENTER> <H1>%(HEADER1)s</H1> <FONT SIZE="4"><I>%(HEADER2)s</I></FONT><BR> <FONT SIZE="4">%(HEADER3)s</FONT> </CENTER> """ HEADERCSS = """\ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML>
import aap from aap import TYPE, EXTENSION, TAGS from targets import _ NAME = _('ASCII Art Presentation Print') RULES = aap.RULES.copy() RULES['print'] = 1
""" A Foswiki/TWiki target. http://foswiki.org http://twiki.org """ from targets import _ NAME = _('Foswiki or TWiki page') TYPE = 'wiki' HEADER = """\ ---+!! %(HEADER1)s *%(HEADER2)s* %%BR%% __%(HEADER3)s__ """ # http://foswiki.org/System/TextFormattingRules # http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules TAGS = { 'title1': '---++ \a', 'title2': '---+++ \a', 'title3': '---++++ \a', 'title4': '---+++++ \a', 'title5': '---++++++ \a', 'blockVerbOpen': '<verbatim>', 'blockVerbClose': '</verbatim>', 'blockQuoteOpen': '<blockquote>', 'blockQuoteClose': '</blockquote>', 'fontMonoOpen': '=', 'fontMonoClose': '=',
""" A Lout target. http://savannah.nongnu.org/projects/lout Target specific occurrence number in txt2tags core: 2. """ from targets import _ NAME = _('Lout document') TYPE = 'office' HEADER = """\ @SysInclude { doc } @SysInclude { tbl } @Document @InitialFont { Times Base 12p } # Times, Courier, Helvetica, ... @PageOrientation { Portrait } # Portrait, Landscape @ColumnNumber { 1 } # Number of columns (2, 3, ...) @PageHeaders { Simple } # None, Simple, Titles, NoTitles @InitialLanguage { English } # German, French, Portuguese, ... @OptimizePages { Yes } # Yes/No smart page break feature // @Text @Begin @Display @Heading { %(HEADER1)s } @Display @I { %(HEADER2)s } @Display { %(HEADER3)s } #@NP # Break page after Headers """ TAGS = {
from lib import aa import txt import targets from targets import _ NAME = _('ASCII Art Text') TYPE = 'text' EXTENSION = 'txt' TAGS = { 'title1' : '\a' , 'title2' : '\a' , 'title3' : '\a' , 'title4' : '\a' , 'title5' : '\a' , 'blockQuoteLine' : targets.AA['quote'] , 'listItemOpen' : targets.AA['bullet'] + ' ', 'numlistItemOpen' : '\a. ' , 'bar1' : aa.line(targets.AA['bar1'], targets.CONF['width']), 'bar2' : aa.line(targets.AA['bar2'], targets.CONF['width']), 'url' : '\a' , 'urlMark' : '\a[\a]' , 'email' : '\a' , 'emailMark' : '\a[\a]' , 'img' : '[\a]' , 'imgEmbed' : '\a' , 'fontBoldOpen' : '*' , 'fontBoldClose' : '*' , 'fontItalicOpen' : '/' ,
""" A HTML Spreadsheet target. """ from targets import _ from html5 import TYPE, TAGS import html5 NAME = _('HTML Spreadsheet') EXTENSION = 'html' HEADER = """\ <!DOCTYPE html> <html> <head> <meta charset="%(ENCODING)s"> <title>%(HEADER1)s</title> <meta name="generator" content="http://txt2tags.org"> <link rel="stylesheet" href="%(STYLE)s"> <style> body{background-color:#fff;color:#000;} hr{background-color:#000;border:0;color:#000;} hr.heavy{height:5px;} hr.light{height:1px;} img{border:0;display:block;} img.right{margin:0 0 0 auto;} table,img.center{border:0;margin:0 auto;} table th,table td{padding:4px;} .center,header{text-align:center;} .right{text-align:right;}
""" A Redmine target. http://www.redmine.org """ from targets import _ NAME = _('Redmine Wiki page') TYPE = 'wiki' HEADER = """\ h1. %(HEADER1)s Author: %(HEADER2)s Date: %(HEADER3)s """ TAGS = { 'title1': 'h1. \a', 'title2': 'h2. \a', 'title3': 'h3. \a', 'title4': 'h4. \a', 'title5': 'h5. \a', 'fontBoldOpen': '*', 'fontBoldClose': '*', 'fontItalicOpen': '_', 'fontItalicClose': '_', 'fontStrikeOpen': '-', 'fontStrikeClose': '-', 'fontUnderlineOpen': "+",
""" A Txt2tags target. http://www.txt2tags.org """ from targets import _ NAME = _('Txt2tags document') TYPE = 'wiki' HEADER = """\ %(HEADER1)s %(HEADER2)s %(HEADER3)s %%! style : %(STYLE)s %%! encoding : %(ENCODING)s """ TAGS = { 'title1' : ' = \a =~A~' , 'title2' : ' == \a ==~A~' , 'title3' : ' === \a ===~A~' , 'title4' : ' ==== \a ====~A~' , 'title5' : ' ===== \a =====~A~' , 'numtitle1' : ' + \a +~A~' , 'numtitle2' : ' ++ \a ++~A~' , 'numtitle3' : ' +++ \a +++~A~' , 'numtitle4' : ' ++++ \a ++++~A~' , 'numtitle5' : ' +++++ \a +++++~A~' , 'anchor' : '[\a]',
""" A Markdown target. http://daringfireball.net/projects/markdown """ from targets import _ NAME = _('Markdown document') ALIASES = ['mdwn', 'mdown', 'markdown'] TYPE = 'wiki' HEADER = """\ %(HEADER1)s %(HEADER2)s %(HEADER3)s """ # regular markdown: http://daringfireball.net/projects/markdown/syntax # markdown extra: http://michelf.com/projects/php-markdown/extra/ # sandbox: # http://daringfireball.net/projects/markdown/dingus # http://michelf.com/projects/php-markdown/dingus/ TAGS = { 'title1' : '# \a ' , 'title2' : '## \a ' , 'title3' : '### \a ' , 'title4' : '#### \a ' , 'title5' : '##### \a ' , 'blockVerbLine' : ' ' ,
""" A reStructuredText target. http://docutils.sourceforge.net/rst.html """ from lib import aa import targets from targets import _ NAME = _('ReStructuredText document') TYPE = 'wiki' TAGS = { 'title1' : '\a' , 'title2' : '\a' , 'title3' : '\a' , 'title4' : '\a' , 'title5' : '\a' , 'blockVerbOpen' : '::\n' , 'blockQuoteLine' : ' ' , 'listItemOpen' : targets.RST['bullet'] + ' ', 'numlistItemOpen' : '\a. ' , 'bar1' : aa.line(targets.RST['bar1'], 10) , 'url' : '\a' , 'urlMark' : '`\a <\a>`_' , 'email' : '\a' , 'emailMark' : '`\a <\a>`_' , 'img' : '\n\n.. image:: \a\n :align: ~A~\n\nENDIMG', 'urlImg' : '\n :target: ' , '_imgAlignLeft' : 'left' ,
""" A CSV Spreadsheet target. """ # inherits from the CSV table target from csv import TYPE, TAGS import csv from targets import _ NAME = _('CSV Spreadsheet') EXTENSION = 'csv' RULES = csv.RULES.copy() RULES['spread'] = 1 RULES['spreadmarkup'] = 'txt'