Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More documentation examples #84

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions docs/numpydoc_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
a line by itself, preferably preceded by a blank line.

"""
from __future__ import absolute_import, division, print_function

import os # standard library imports first

import matplotlib as mpl
Expand Down Expand Up @@ -128,3 +126,37 @@ def foo(var1, var2, *args, long_var_name="hi", **kwargs):
# But for function, method and module, there should be no blank lines
# after closing the docstring.
pass



class TestClassDocumentation:
"""
This is an example docstring of a class.

Unordered list:

* multi-line
item 1
* item 2
* sub-item 3

.. note::
This is a note inside a class docstring.

Parameters
----------
filename : str
The name of the file to be read.

"""

def __init__(self, filename: str):
"""Initialize the class.

Parameters
----------
filename : str
The name of the file to be read.

"""
self.filename = filename
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def dynamic_author_list():
out_path = current_dir / "mdanalysis_sphinx_theme" / "authors.py"
author_lines = "\n".join([f' u"{name}",' for name in authors])
template = f"""\
#-*- coding:utf-8 -*-
# -*- coding:utf-8 -*-

# This file is generated from the AUTHORS file during the installation process.
# Do not edit it as your changes will be overwritten.
Expand Down