Skip to content

Commit

Permalink
different solution for depth issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Julfried committed Nov 10, 2024
1 parent 18ee1c3 commit 7ea4d45
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 56 deletions.
77 changes: 38 additions & 39 deletions doc/additional_tools/pyreverse/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,49 @@ Usage
#####


To run ``pyreverse``, use::
``pyreverse`` is run from the command line using the following syntax::

pyreverse [options] <packages>

where ``<packages>`` is one or more Python packages or modules to analyze.

``<packages>`` can either be a package or a list of modules separated by spaces.
The available options are organized into the following categories:

For detailed descriptions of the command-line options read on. This page includes sections on:
* :ref:`filtering-and-scope` - Control which classes and relationships appear in your diagrams
* :ref:`display-options` - Customize the visual appearance including colors and labels
* :ref:`output-control` - Select output formats and set the destination directory
* :ref:`project-configuration` - Define project settings like source roots and ignored files

* :ref:`Filtering and Scope <filtering-and-scope>` - Options for filtering classes and limiting the scope of the generated diagrams.
* :ref:`Display Options <display-options>` - Customize how diagrams are rendered, including colors and module names.
* :ref:`Output Control <output-control>` - Specify output formats and directory locations for generated files.
* :ref:`Project Configuration <project-configuration>` - Configure project-specific settings such as ignored files and source roots.

.. _filtering-and-scope:

Filtering and Scope
'''''''''''''''''''

.. _filtering-and-scope:
===================


--all-ancestors
...............
---------------
*Show all ancestors of all classes in <projects>.*

**Default:** ``None``


--all-associated
................
----------------
*Show all classes associated with the target classes, including indirect associations.*

**Default:** ``None``


--class
.......
-------
*Create a class diagram with all classes related to <class>; this uses by default the options -ASmy*

**Default:** ``None``


--filter-mode
.............
-------------
*Filter attributes and functions according to <mode>. Correct modes are:
'PUB_ONLY' filter all non public attributes [DEFAULT], equivalent to PRIVATE+SPECIAL
'ALL' no filter
Expand All @@ -60,136 +59,136 @@ Filtering and Scope


--show-ancestors
................
----------------
*Show <ancestor> generations of ancestor classes not in <projects>.*

**Default:** ``None``


--show-associated
.................
-----------------
*Show <association_level> levels of associated classes not in <projects>.*

**Default:** ``None``


--show-builtin
..............
--------------
*Include builtin objects in representation of classes.*

**Default:** ``False``


--show-stdlib
.............
-------------
*Include standard library objects in representation of classes.*

**Default:** ``False``




Display Options
'''''''''''''''

.. _display-options:

Display Options
===============


--color-palette
...............
---------------
*Comma separated list of colors to use for the package depth coloring.*

**Default:** ``('#77AADD', '#99DDFF', '#44BB99', '#BBCC33', '#AAAA00', '#EEDD88', '#EE8866', '#FFAABB', '#DDDDDD')``


--colorized
...........
-----------
*Use colored output. Classes/modules of the same package get the same color.*

**Default:** ``False``


--max-color-depth
.................
-----------------
*Use separate colors up to package depth of <depth>. Higher depths will reuse colors.*

**Default:** ``2``


--module-names
..............
--------------
*Include module name in the representation of classes.*

**Default:** ``None``


--no-standalone
...............
---------------
*Only show nodes with connections.*

**Default:** ``False``


--only-classnames
.................
-----------------
*Don't show attributes and methods in the class boxes; this disables -f values.*

**Default:** ``False``




Output Control
''''''''''''''

.. _output-control:

Output Control
==============


--output
........
--------
*Create a *.<format> output file if format is available. Available formats are: .dot, .puml, .plantuml, .mmd, .html. Any other format will be tried to be created by using the 'dot' command line tool, which requires a graphviz installation. In this case, these additional formats are available (see `Graphviz output formats <https://graphviz.org/docs/outputs/>`_).*

**Default:** ``dot``


--output-directory
..................
------------------
*Set the output directory path.*

**Default:** ``""``




Project Configuration
'''''''''''''''''''''

.. _project-configuration:

Project Configuration
=====================


--ignore
........
--------
*Files or directories to be skipped. They should be base names, not paths.*

**Default:** ``('CVS',)``


--project
.........
---------
*Set the project name. This will later be appended to the output file names.*

**Default:** ``""``


--source-roots
..............
--------------
*Add paths to the list of the source roots. Supports globbing patterns. The source root is an absolute path or a path relative to the current working directory used to determine a package namespace for modules located under the source root.*

**Default:** ``()``


--verbose
.........
---------
*Makes pyreverse more verbose/talkative. Mostly useful for debugging.*

**Default:** ``False``
12 changes: 6 additions & 6 deletions doc/additional_tools/pyreverse/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ can be used as well. In this case, ``pyreverse`` first generates a temporary ``.
fed to Graphviz to generate the final image.

.. toctree::
:caption: Pyreverse
:maxdepth: 3
:titlesonly:
:hidden:
:maxdepth: 2
:caption: Pyreverse
:titlesonly:
:hidden:

configuration
output_examples
configuration
output_examples
22 changes: 11 additions & 11 deletions doc/exts/pyreverse_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,25 @@ def _write_config_page(run: Run) -> None:
{get_rst_title("Usage", "#")}
To run ``pyreverse``, use::
``pyreverse`` is run from the command line using the following syntax::
pyreverse [options] <packages>
where ``<packages>`` is one or more Python packages or modules to analyze.
``<packages>`` can either be a package or a list of modules separated by spaces.
The available options are organized into the following categories:
For detailed descriptions of the command-line options read on. This page includes sections on:
* :ref:`Filtering and Scope <filtering-and-scope>` - Options for filtering classes and limiting the scope of the generated diagrams.
* :ref:`Display Options <display-options>` - Customize how diagrams are rendered, including colors and module names.
* :ref:`Output Control <output-control>` - Specify output formats and directory locations for generated files.
* :ref:`Project Configuration <project-configuration>` - Configure project-specific settings such as ignored files and source roots.
""" # noqa: E501
* :ref:`filtering-and-scope` - Control which classes and relationships appear in your diagrams
* :ref:`display-options` - Customize the visual appearance including colors and labels
* :ref:`output-control` - Select output formats and set the destination directory
* :ref:`project-configuration` - Define project settings like source roots and ignored files
"""
]
options: list[OptionsData] = [OptionsData(name, info) for name, info in run.options]
option_groups: dict[str, list[str]] = {g: [] for g in OPTIONS_GROUPS.values()}

for option in sorted(options, key=lambda x: x.name):
option_string = get_rst_title(f"--{option.name}", ".")
option_string = get_rst_title(f"--{option.name}", "-")
option_string += f"*{option.optdict.get('help')}*\n\n"

if option.optdict.get("default") == "":
Expand All @@ -69,9 +68,10 @@ def _write_config_page(run: Run) -> None:
for group_title in OPTIONS_GROUPS.values():
ref_title = group_title.lower().replace(" ", "-")
sections.append(
f"""{get_rst_title(group_title, "'")}
f"""\
.. _{ref_title}:
{get_rst_title(group_title, "=")}
{"".join(option_groups[group_title])}"""
)
Expand Down

0 comments on commit 7ea4d45

Please sign in to comment.