Skip to content
This repository has been archived by the owner on Jan 25, 2019. It is now read-only.

Bug: Missing heading when using rst sources with lonely 1st level heading #124

Open
gchriz opened this issue Sep 2, 2014 · 2 comments
Open

Comments

@gchriz
Copy link
Contributor

gchriz commented Sep 2, 2014

Hi!
When I'm using rst sources with a 1st level heading that is occuring only once in the document the underlying docutils treat that heading as title.
As such it is not included in the parts['body'] that is used in renderers.py and so it's not in the output wok creates.

Example:

heading1
========

some text

heading2
--------

more text

gives (shortened):

<p>some text</p>
<h1>heading2</h1>
<p>more text</p>

Using parts['html_body'] instead makes it appearing, but an even better solution might be to disable this docutils behaviour by:

overrides = {'doctitle_xform': False}
return docutils.core.publish_parts(plain, writer=w, settings_overrides=overrides)['body']

Here the corresponding commit in my wok fork, including some more documentation:
gchriz@ddaf7df

@gchriz
Copy link
Contributor Author

gchriz commented Sep 8, 2014

Now I made that fix configurable.
For backwards compatibility and for users who might need the old behaviour:
gchriz@cb47b5d

@gchriz
Copy link
Contributor Author

gchriz commented Jan 14, 2016

After doing some "git for dummies" I finally managed to create my first pull request here (#152).
As far as I understand Travis is happy with it too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant