Skip to content

Commit

Permalink
Doc: Update API
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc committed Jul 18, 2023
1 parent 661addc commit 54e7f16
Show file tree
Hide file tree
Showing 30 changed files with 121 additions and 87 deletions.
13 changes: 6 additions & 7 deletions docs/api/device.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# AntaDevice Abstracted class
### ::: anta.device.AntaDevice
options:
filters: ["!^_[^_]", "!__(eq|rich_repr)__"]

::: anta.device.AntaDevice
heading_level: 2
### ::: anta.device.AsyncEOSDevice
options:
filters: ["!^_[^_]", "!__(eq|rich_repr)__"]

# AsyncEOSDevice class

::: anta.device.AsyncEOSDevice
heading_level: 2
12 changes: 4 additions & 8 deletions docs/api/inventory.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# ANTA Inventory module
### ::: anta.inventory.AntaInventory
options:
filters: ["!^_[^_]", "!__str__"]

::: anta.inventory.AntaInventory
heading_level: 2

# Exceptions

::: anta.inventory.exceptions
heading_level: 2
### ::: anta.inventory.exceptions
16 changes: 4 additions & 12 deletions docs/api/inventory.models.input.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# Data models for anta.inventory
### ::: anta.inventory.models.AntaInventoryInput

::: anta.inventory.models.AntaInventoryInput
heading_level: 2
### ::: anta.inventory.models.AntaInventoryHost

# User inventory components
### ::: anta.inventory.models.AntaInventoryNetwork

::: anta.inventory.models.AntaInventoryHost
heading_level: 2

::: anta.inventory.models.AntaInventoryNetwork
heading_level: 2

::: anta.inventory.models.AntaInventoryRange
heading_level: 2
### ::: anta.inventory.models.AntaInventoryRange
17 changes: 5 additions & 12 deletions docs/api/models.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# AntaTest definition
### ::: anta.models.AntaTest
options:
filters: ["!^_[^_]", "!__init_subclass__"]

::: anta.models.AntaTest
heading_level: 2
### ::: anta.models.AntaCommand

# AntaCommand definition

::: anta.models.AntaCommand
heading_level: 2

# AntaTemplate definition

::: anta.models.AntaTemplate
heading_level: 2
### ::: anta.models.AntaTemplate
5 changes: 1 addition & 4 deletions docs/api/report_manager.md
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# ANTA ReportManager module

::: anta.reporter.ReportTable
heading_level: 2
### ::: anta.reporter.ReportTable
5 changes: 1 addition & 4 deletions docs/api/report_manager_models.md
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# ColorManager Entry

::: anta.reporter.models.ColorManager
heading_level: 2
### ::: anta.reporter.models.ColorManager
7 changes: 3 additions & 4 deletions docs/api/result_manager.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# ANTA ResultManager module

::: anta.result_manager.ResultManager
heading_level: 2
### ::: anta.result_manager.ResultManager
options:
filters: ["!^_[^_]", "!^__len__"]
14 changes: 6 additions & 8 deletions docs/api/result_manager_models.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# TestResult Entry
### ::: anta.result_manager.models.TestResult
options:
filters: ["!^_[^_]", "!__str__"]

::: anta.result_manager.models.TestResult
heading_level: 2

# ListResult

::: anta.result_manager.models.ListResult
heading_level: 2
### ::: anta.result_manager.models.ListResult
options:
filters: ["!^_[^_]", "!^__(len|getitem|iter)__",]
6 changes: 4 additions & 2 deletions docs/api/tests.aaa.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for AAA tests
# ANTA catalog for interfaces tests

::: anta.tests.aaa
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.configuration.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for configuration tests

::: anta.tests.configuration
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.connectivity.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for connectivity tests

::: anta.tests.connectivity
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.field_notices.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for Field Notices tests

::: anta.tests.field_notices
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.hardware.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for hardware tests

::: anta.tests.hardware
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.interfaces.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for interfaces tests

::: anta.tests.interfaces
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.logging.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for logging tests

::: anta.tests.logging
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.mlag.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for mlag tests

::: anta.tests.mlag
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.multicast.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for multicast tests

::: anta.tests.multicast
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.profiles.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for profiles tests

::: anta.tests.profiles
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.routing.bgp.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for routing-bgp tests

::: anta.tests.routing.bgp
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.routing.generic.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for routing-generic tests

::: anta.tests.routing.generic
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.routing.ospf.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for routing-ospf tests

::: anta.tests.routing.ospf
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.security.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for security tests

::: anta.tests.security
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.snmp.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for SNMP tests

::: anta.tests.snmp
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.software.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for software tests

::: anta.tests.software
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.stp.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for STP tests

::: anta.tests.stp
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
4 changes: 3 additions & 1 deletion docs/api/tests.system.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ANTA catalog for system tests

::: anta.tests.system
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false

4 changes: 3 additions & 1 deletion docs/api/tests.vxlan.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ANTA catalog for VxLAN tests

::: anta.tests.vxlan
heading_level: 3
options:
show_root_heading: false
show_root_toc_entry: false
3 changes: 1 addition & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ mkdocs-git-revision-date-localized-plugin>=1.1.0
mkdocs-git-revision-date-plugin>=0.3.2
mkdocs-material>=8.3.9
mkdocs-material-extensions>=1.0.3
mkdocstrings>=0.19.0
mkdocstrings-python>=0.7.1
mkdocstrings[python]>=0.20.0
mdx_truly_sane_lists
fontawesome_markdown
mike==1.1.2
7 changes: 7 additions & 0 deletions docs/stylesheets/extra.material.css
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,10 @@
/* width: 50%; */
}
}

/* mkdocstrings css from official repo to indent sub-elements nicely */
/* Indentation. */
div.doc-contents {
padding-left: 25px;
border-left: .05rem solid var(--md-typeset-table-color);
}
31 changes: 25 additions & 6 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,37 @@ extra_javascript:
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js

watch:
# Watch src/ directory to reload on changes to docstrings for mkdocstrings
# plugin.
- docs
# Watch src/ directory to reload on changes to docstrings for mkdocstrings plugin.
- anta

plugins:
- mkdocstrings:
default_handler: python
handlers:
python:
paths: [anta]
import:
- https://docs.python.org/3/objects.inv
- https://mkdocstrings.github.io/objects.inv
- https://mkdocstrings.github.io/griffe/objects.inv
options:
show_root_heading: false
show_source: true
watch:
- anta
docstring_options:
ignore_init_summary: true
docstring_section_style: table
heading_level: 2
inherited_members: false
merge_init_into_class: true
separate_signature: true
show_root_heading: true
show_root_full_path: false
show_signature_annotations: true
# sadly symbols are for insiders only
# https://mkdocstrings.github.io/python/usage/configuration/headings/#show_symbol_type_toc
# show_symbol_type_heading: true
# show_symbol_type_toc: true
# default filters here
filters: ["!^_[^_]"]
- search:
lang: en
- git-revision-date-localized:
Expand Down Expand Up @@ -172,6 +189,8 @@ nav:
- Inventory:
- Inventory module: api/inventory.md
- Inventory models: api/inventory.models.input.md
- Device:
- Device models: api/device.md
- Test:
- Test models: api/models.md
- Result Manager:
Expand Down

0 comments on commit 54e7f16

Please sign in to comment.