Permalink
Browse files

New target BBCode (-t bbcode)

  • Loading branch information...
1 parent 93d0c1a commit 2146a32ea7416c3ccc0c6ca8b4a8f30248c5d6f0 @farvardin farvardin committed Nov 9, 2010
Showing with 72 additions and 1 deletion.
  1. +72 −1 txt2tags
View
@@ -141,7 +141,7 @@ else:
# first file and gui for the second. There is no --no-<action>.
# --version and --help inside %!options are also odd
#
-TARGETS = 'html xhtml xhtmls sgml dbk tex lout man mgp wiki gwiki doku pmw moin pm6 txt art adoc creole mdwn'.split()
+TARGETS = 'html xhtml xhtmls sgml dbk tex lout man mgp wiki gwiki doku pmw moin pm6 txt art adoc creole mdwn bbcode'.split()
TARGETS.sort()
FLAGS = {'headers' :1 , 'enum-title' :0 , 'mask-email' :0 ,
@@ -186,6 +186,7 @@ TARGET_NAMES = {
'adoc' : _('AsciiDoc document'),
'creole' : _('Creole 1.0 document'),
'mdwn' : _('MarkDown document'),
+ 'bbcode' : _('BBCode document')
}
DEBUG = 0 # do not edit here, please use --debug
@@ -602,6 +603,11 @@ r"""\documentclass{article}
%(HEADER1)s
%(HEADER2)s
%(HEADER3)s
+""",
+ 'bbcode': """\
+%(HEADER1)s
+%(HEADER2)s
+%(HEADER3)s
"""
# @SysInclude { tbl } # Tables support
# setup: @MakeContents { Yes } # show TOC
@@ -1572,6 +1578,46 @@ def getTags(config):
'tableRowOpen' : '|' ,
'tableRowClose' : '|' ,
'tableCellSep' : ' |' ,
+ },
+ # http://www.phpbb.com/community/faq.php?mode=bbcode
+ # http://www.bbcode.org/reference.php (but seldom implemented)
+ 'bbcode': {
+ '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]' ,
+ 'fontItalicOpen' : '[i]' ,
+ 'fontItalicClose' : '[/i]' ,
+ 'fontUnderlineOpen' : '[u]' ,
+ 'fontUnderlineClose' : '[/u]' ,
+ #'fontStrikeOpen' : '[s]' , (not supported by phpBB)
+ #'fontStrikeClose' : '[/s]' ,
+ 'listOpen' : '[list]' ,
+ 'listClose' : '[/list]' ,
+ 'listItemOpen' : '[*]' ,
+ #'listItemClose' : '[/li]' ,
+ 'numlistOpen' : '[list=1]' ,
+ 'numlistClose' : '[/list]' ,
+ 'numlistItemOpen' : '[*]' ,
+ 'url' : '[url]\a[/url]' ,
+ 'urlMark' : '[url=\a]\a[/url]',
+ #'urlMark' : '[url]\a[/url]',
+ 'img' : '[img]\a[/img]' ,
+ #'tableOpen' : '[table]',
+ #'tableClose' : '[/table]' ,
+ #'tableRowOpen' : '[tr]' ,
+ #'tableRowClose' : '[/tr]' ,
+ #'tableCellOpen' : '[td]' ,
+ #'tableCellClose' : '[/td]' ,
+ #'tableTitleCellOpen' : '[th]' ,
+ #'tableTitleCellClose' : '[/th]' ,
}
}
@@ -2123,6 +2169,31 @@ def getRules(config):
'blanksaroundbar':1,
'blanksaroundtitle':1,
},
+ 'bbcode': {
+ #'keeplistindent':1,
+ 'keepquoteindent':1,
+ #'indentverbblock':1,
+ 'linkable':1,
+ #'labelbeforelink':1,
+ 'tableable':1,
+ 'imglinkable':1,
+ 'tablecellstrip':1,
+ #'autotocwithbars':1,
+ 'autonumberlist':1,
+ 'spacedlistitemopen':1,
+ 'spacednumlistitemopen':1,
+ 'deflisttextstrip':1,
+ #'verbblocknotescaped':1,
+ 'blanksaroundpara':1,
+ #'blanksaroundverb':1,
+ #'blanksaroundquote':1,
+ 'blanksaroundlist':1,
+ 'blanksaroundnumlist':1,
+ #'blanksarounddeflist':1,
+ 'blanksaroundtable':1,
+ 'blanksaroundbar':1,
+ 'blanksaroundtitle':1,
+ },
}
# Exceptions for --css-sugar

0 comments on commit 2146a32

Please sign in to comment.