pydoctor: Python code-blocks in Google-style doc-strings
![](https://secure.gravatar.com/avatar/148a51ecc80531586e1f5530d64b988a.jpg?s=120&d=mm&r=g)
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/e7177a8e17c627f5c93befbc027...> [2] -- <https://github.com/twisted/pydoctor/blob/6e2febe63a8ed0f2e316009f34721dc1778...>
participants (1)
-
c.buhtz@posteo.jp