Add --docformat argument for reStructuredText or plaintext input #137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This leaves markdown as the default for rendering the docstrings, but adds a new
--docformat
option (named after theepydoc
option) allowing the use of reStructuredText (viadocutils
) or plain text (using an HTML<pre>
block).This will be useful for anyone hoping to migrate from epydoc which did not support Markdown, but did support its own format epydoc and the Python standard reStructuredText.
This will also indirectly greatly improve the display of doctests or Python snippets using the
>>>
notation which the Markdown rendering does not understand (see #63).It would be relatively simple to make the
markdown
/docutils
import lazy, so that people using one input format would not require the other dependency be installed.This would close the main goal of #111 (although it does not make life complicated by looking at the per-file settings in any
__docformat__
declaration).Thank you to @j6k4m8 whose work on #101 was very useful. I would be happy to include his work by adding GitHub Flavoured Markdown as another option here, e.g.
--docformat gfm
?