Skip to content

Commit

Permalink
Add a note to CONTRIBUTING.md explaining the required inter-line char…
Browse files Browse the repository at this point in the history
…acter alignment of multiline method signatures in doc/stdlib/*.rst.
  • Loading branch information
Sacha0 committed Jun 22, 2016
1 parent 02ac2b1 commit b3c9f1c
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 b3c9f1c

Please sign in to comment.