Skip to content

Commit

Permalink
Merge pull request #17036 from Sacha0/multilinedocstrings
Browse files Browse the repository at this point in the history
Explain multiline method signature inter-line character alignment reqs. in CONTRIBUTING.md
  • Loading branch information
vtjnash authored Jun 23, 2016
2 parents 7176754 + b3c9f1c commit 65c6e6e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ If you want to edit an existing docstring signature, you **first** have to chang
edit the helpdb.jl or inline method docstrings. The existing signatures in the `doc/stdlib/*.rst` files are pattern matched to base docstrings and the new content overwrites the content in `doc/stdlib/`.
The signature definitions **must** be in sync or else the pattern match will fail and documentation will be lost in the result.
To add entirely new methods to the `stdlib` documentation, first add the signature in the appropriate `doc/stdlib/*.rst` file before writing the docstring, rebuilding Julia, and re-running `doc/genstdlib.jl`.
Pattern matching requires that multiline method signatures' inter-line character alignment in `doc/stdlib/*.rst` match that in the corresponding docstring. For example, docstring
```julia
"""
foo(bar, baz,
qux, quux)
Foo `bar`, `baz`, `qux`, and `quux`.
"""
```
will only match entries in `doc/stdlib/*.rst` of the form
```rst
.. function:: foo(bar, baz,
.............. qux, quux)
```
where `.` in the preceding snippet's second line is wildcard, and their number preceding indent-` qux, quux)` matches the character count of `.. function:: `.

It is encouraged to write all new docstrings in Markdown markup. If you need to write a more complicated docstring that contains cross-references or citations it can be written in a restructured text codeblock.
Many of the existing docstrings are currently restructured text codeblocks and these will be transitioned to Markdown over time. RST codeblocks are delineated with the triple-quote (\`\`\`rst \`\`\`) Makdown codeblock syntax.
Expand Down

0 comments on commit 65c6e6e

Please sign in to comment.