Skip to content

Commit

Permalink
Modify rst_to_html for consistency.
Browse files Browse the repository at this point in the history
Without this additional option, the rst block generated is very different depending on if you have one or multiple top-level sections defined. In fact the top-level title is removed completely without this (given our template doesn't include %(body_pre_docinfo)s).

For more information see - https://biostar.usegalaxy.org/p/11211/.
  • Loading branch information
jmchilton committed Mar 17, 2015
1 parent 5c8bb70 commit 157eba6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/galaxy/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,18 @@ class FakeStream( object ):
def write( self, str ):
if len( str ) > 0 and not str.isspace():
log.warn( str )

settings_overrides = {
"embed_stylesheet": False,
"template": os.path.join(os.path.dirname(__file__), "docutils_template.txt"),
"warning_stream": FakeStream(),
"doctitle_xform": False, # without option, very different rendering depending on
# number of sections in help content.
}

return unicodify( docutils.core.publish_string( s,
writer=docutils.writers.html4css1.Writer(),
settings_overrides={ "embed_stylesheet": False,
"template": os.path.join(os.path.dirname(__file__), "docutils_template.txt"),
"warning_stream": FakeStream() } ) )
settings_overrides=settings_overrides ) )


def xml_text(root, name=None):
Expand Down

1 comment on commit 157eba6

@hexylena
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh!! So this is what was happening to all of my titles. I switched to **What it does** because I just assumed that I was terrible at rST.

Please sign in to comment.