Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
C0DK committed May 30, 2021
1 parent eca1f57 commit ca8c461
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 50 deletions.
51 changes: 9 additions & 42 deletions docs/reference/filters.rst
Expand Up @@ -7,82 +7,49 @@
Filters
================

list of all filters
--------------------

.. automodule:: codoc.service.filters


.. _type_ex_filter:

Type based
----------------------
.. automodule:: codoc.service.filters.type_exclusion_filter


.. _class_ex_filter:

Exclude classes
`````````````````

.. autofunction:: exclude_classes

.. _function_ex_filter:

Exclude functions
`````````````````

.. autofunction:: exclude_functions


.. _module_ex_filter:

Exclude modules
`````````````````

.. autofunction:: exclude_modules

Exclude exceptions
````````````````````

.. autofunction:: exclude_exceptions

Only classes
`````````````````

.. autofunction:: include_only_classes

Only functions
`````````````````

.. autofunction:: include_only_functions


Only modules
`````````````````

.. autofunction:: include_only_modules

Only exceptions
````````````````````

.. autofunction:: include_only_exceptions

.. _child_filter:

Child Based
----------------------

.. autofunction:: codoc.service.filters.get_children_of
.. autofunction:: content_of

Depth based
----------------------

.. autofunction:: codoc.service.filters.get_depth_based_filter
.. autofunction:: get_depth_based_filter

.. _class_diagram:

Class Diagram filter
----------------------
.. autofunction:: class_diagram_filter


.. autofunction:: codoc.service.filters.class_diagram_filter
.. autofunction:: filter_by_regex
.. autofunction:: exclude_by_regex


Customization
Expand Down
8 changes: 3 additions & 5 deletions src/codoc/service/filters/children_based.py
Expand Up @@ -32,14 +32,12 @@ def get_children_of(
the current node. I.e if a class, Foo, defined in FooModule, then FooModule
is the parent of Foo.
Example
Example that returns all modules/classes/exceptions/functions defined
inside `myproject.subproject`.
.. code-block:: python
# returns all modules/classes/exceptions/functions
# defined inside `myporject.subproject`.
filter_function = filters.get_children_of(myproject.subproject)
filter_function = filters.content_of(myproject.subproject)
filtered_graph = filter_function(graph)
Expand Down
12 changes: 9 additions & 3 deletions src/codoc/service/filters/regex_based.py
Expand Up @@ -13,8 +13,11 @@ def filter_by_regex(pattern: str, flags=0) -> FilterType:
The regex is done solely on the `name` attribute.
The following example removes all instances of "test".
The following example removes all instances that don't include "test".
Example:
.. code-block:: python
graph = filters.filter_by_regex("test", flags=re.IGNORECASE)(graph)
To understand how to use regex, please consult the python documentation:
Expand All @@ -34,9 +37,12 @@ def exclude_by_regex(pattern: str, flags=0) -> FilterType:
The regex is done solely on the `name` attribute.
The following example removes all instances of "test".
The following example removes all instances with a name that contains "test".
Example:
graph = filters.filter_by_regex("test", flags=re.IGNORECASE)(graph)
.. code-block:: python
graph = filters.exclude_by_regex("test", flags=re.IGNORECASE)(graph)
To understand how to use regex, please consult the python documentation:
Expand Down

0 comments on commit ca8c461

Please sign in to comment.