def set_html(self, html):
"""
When setting the html for this Google Document we do two
things:
1. We extract the content from the html. Using a regular
expression we pull the meat of the document out of the body
of the html, we also cut off the footer Google adds on
automatically.
2. We extract the various sections from the content of the
document. Again using a regular expression, we look for h1,
h2, ... tags to split the document up into sections. Note:
it is important when you are writing your Google Document
to use the heading text styles, so this code will split
things correctly.
"""
self._html = html
self._extract_content()
self._extract_sections()
评论列表
文章目录