Beispiel #1
0
 def handle(self, man, match):
     try:
         block = self.make()
         block.parse_args(match.group(1))
         tparser.BlockParser(man, block, self.close)
     except ExternalException, exn:
         man.error(exn)
Beispiel #2
0
def handleCode(man, match):
    lang = ""
    line = None
    opts = match.group(2)
    if opts:
        for opt in opts.split(','):
            if opt == "line":
                line = 1
            elif opt.startswith("line="):
                try:
                    line = int(opt[5:])
                except ValueError:
                    raise common.ParseException("bad line number: %s" % opt)
            else:
                lang = opt
    tparser.BlockParser(man, highlight.CodeBlock(man, lang, line), END_CODE)
Beispiel #3
0
def handleGnuPlot(man, match):
	tparser.BlockParser(man, GnuPlotBlock(match.group(2), match.group(4)), GNUPLOT_CLOSE)
Beispiel #4
0
def handleNoWiki(man, match):
    tparser.BlockParser(man, NonParsedBlock(), END_NOWIKI)
Beispiel #5
0
def handleFile(man, match):
    tparser.BlockParser(man, FileBlock(), END_FILE)
Beispiel #6
0
def handleDotOld(man, match):
    common.onDeprecated("@<dot> form is now deprecated. Use <dot> instead.")
    tparser.BlockParser(man, DotBlock(match.group(2)), DOT_CLOSE_OLD)
Beispiel #7
0
def handleDot(man, match):
    tparser.BlockParser(man, DotBlock(match.group(2)), DOT_CLOSE)
Beispiel #8
0
def new_multi_code(man, match):
	block = highlight.CodeBlock(man, "")
	block.add(match.group(1))
	tparser.BlockParser(man, block, END_CODE)