Or completely awesome. Depends the needs.
a root-relative link to markdown-article a file-relative link to markdown-article
1 | formatter = self.options and VARIANTS[self.options.keys()[0]] |
This will now have a line number in 'custom' since it's the default in pelican.conf, it will have nothing in default.
1 | formatter = self.options and VARIANTS[self.options.keys()[0]] |
Lovely.
8def run(self):
self.assert_has_content()
10 try:
lexer = get_lexer_by_name(self.arguments[0])
12 except ValueError:
# no lexer found - use the text one instead of an exception
14 lexer = TextLexer()
16 if ('linenos' in self.options and
self.options['linenos'] not in ('table', 'inline')):
18 self.options['linenos'] = 'table'
20 for flag in ('nowrap', 'nobackground', 'anchorlinenos'):
if flag in self.options:
22 self.options[flag] = True
24 # noclasses should already default to False, but just in case...
formatter = HtmlFormatter(noclasses=False, **self.options)
26 parsed = highlight('\n'.join(self.content), lexer, formatter)
return [nodes.raw('', parsed, format='html')]
Lovely.
Lovely.
Even if the default is line numbers, we can override it here
formatter = self.options and VARIANTS[self.options.keys()[0]]
Lovely.