Looking into the Google style demo and the original Google style guide
it is unclear for me how to create code blocks in doc strings.
As an example (from [1])
def read_and_validate_csv(file_path: pathlib.Path,
specs_and_rules: dict,
encoding: str = 'utf-8') -> pandas.DataFrame:
"""Read a CSV file with respect to specifications about format and
rules about valid values.
Hints: Do not use objects of type type (e.g. str instead of "str")
when
specificing the column type.
Examples:
.. code-block:: python
specs_and_rules = {
'ColumnA': 'str',
'ColumnB': ('str', 'no answer'),
'ColumnC': None,
'ColumnD': (
'Int16',
-9, {
'len': [1, 2, (4-8)],
'val': [0, 1, (3-9)]
}
}
}
Args:
file_path: The csv file to read from.
specs_and_rules: A column name indexed dictionary.
encoding (optional, default='utf-8'): Optional encoding type
used
for reading the csv file.
Returns:
The resulting data frame.
"""
There is something unclear for me in your example_generator() [2]
function. It is unclear for me how pydoctor decide what is simple text
and what is code.
[1] --
<https://codeberg.org/buhtz/buhtzology/src/commit/e7177a8e17c627f5c93befbc02732c84481475af/src/buhtzology/bandas.py#L124>
[2] --
<https://github.com/twisted/pydoctor/blob/6e2febe63a8ed0f2e316009f34721dc1778661e7/docs/google_demo/__init__.py#L136>
_______________________________________________
Twisted mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/twisted.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/WRCA5DKXGDIYC644DRFCXKDUCVJBUO6M/
Code of Conduct: https://twisted.org/conduct