bloggerhtml.py
21 lines
| 757 B
| text/x-python
|
PythonLexer
/ converters / bloggerhtml.py
David Warde-Farley
|
r8747 | from converters.html import ConverterHTML | ||
Matthias BUSSONNIER
|
r8620 | import io | ||
Matthias BUSSONNIER
|
r8618 | |||
David Warde-Farley
|
r8747 | |||
Matthias BUSSONNIER
|
r8618 | class ConverterBloggerHTML(ConverterHTML): | ||
"""Convert a notebook to html suitable for easy pasting into Blogger. | ||||
It generates an html file that has *only* the pure HTML contents, and a | ||||
separate file with `_header` appended to the name with all header contents. | ||||
Typically, the header file only needs to be used once when setting up a | ||||
blog, as the CSS for all posts is stored in a single location in Blogger. | ||||
""" | ||||
David Warde-Farley
|
r8747 | |||
Matthias BUSSONNIER
|
r8618 | def optional_header(self): | ||
with io.open(self.outbase + '_header.html', 'w', | ||||
encoding=self.default_encoding) as f: | ||||
f.write('\n'.join(self.header_body())) | ||||
return [] | ||||
def optional_footer(self): | ||||
return [] | ||||