##// END OF EJS Templates
forgott conflict
forgott conflict

File last commit:

r8933:4f9d83a9
r9692:7026c28a
Show More
bloggerhtml.py
46 lines | 1.7 KiB | text/x-python | PythonLexer
David Warde-Farley
Introduce standard structure from coding guidelines in converters/.
r8789 """Notebook export in Blogger-aware HTML.
This file contains `ConverterBloggerHTML`, a subclass of `ConverterHTML` that
provides output suitable for easy pasting into a blog hosted on the Blogger
platform. See the class docstring for more information.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Stdlib imports
Matthias BUSSONNIER
all seem to convert again
r8620 import io
Matthias BUSSONNIER
latex working
r8618
David Warde-Farley
Introduce standard structure from coding guidelines in converters/.
r8789 # Our own imports
Anthony Scopatz
convters sub-package use relative imports
r8933 from .html import ConverterHTML
David Warde-Farley
Introduce standard structure from coding guidelines in converters/.
r8789
#-----------------------------------------------------------------------------
David Warde-Farley
More descriptive comment headers.
r8808 # Classes declarations
David Warde-Farley
Introduce standard structure from coding guidelines in converters/.
r8789 #-----------------------------------------------------------------------------
David Warde-Farley
PEP8-ify several files
r8747
Matthias BUSSONNIER
latex working
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
PEP8-ify several files
r8747
Matthias BUSSONNIER
latex working
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 []