Skip to content

Instantly share code, notes, and snippets.

@komeda-shinji
Last active August 29, 2015 14:15
Show Gist options
  • Save komeda-shinji/15accda0973b2f343579 to your computer and use it in GitHub Desktop.
Save komeda-shinji/15accda0973b2f343579 to your computer and use it in GitHub Desktop.
ReTextを使ってreStructuredTextで書いたときタイトルとサブタイトルが入らない ref: http://qiita.com/komeda-shinji/items/254442e911f507c65f97
diff -u wpgen/wpgen.py wpgen/wpgen.py
--- wpgen/wpgen.py 2012-04-22 23:52:07.000000000 +0900
+++ wpgen/wpgen.py 2012-04-27 22:00:58.000000000 +0900
@@ -108,7 +109,8 @@
pass
elif ext in (".rst", ".rest") and use_docutils:
parts = publish_parts(text, writer_name='html')
- html = parts['body']
+ #html = parts['body']
+ html = parts['html_body']
if parts['title']:
pagename = parts['title']
elif ext in (".htm", ".html") and bn != "template":
--- markups/restructuredtext.py- 2014-07-23 19:32:40.000000000 +0900
+++ markups/restructuredtext.py 2015-02-17 21:53:02.000000000 +0900
@@ -53,7 +53,8 @@
return self.publish_parts(text)['title']
def get_document_body(self, text):
- return self.publish_parts(text)['body']
+ #return self.publish_parts(text)['body']
+ return self.publish_parts(text)['html_body']
def get_stylesheet(self, text=''):
origstyle = self.publish_parts(text)['stylesheet']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment