Skip to content

Commit

Permalink
Chore/update doc exts (#406)
Browse files Browse the repository at this point in the history
* replace recommonmark with myst-parser

* style

* add localhost to etc/hosts

* add sleep before integ tests
  • Loading branch information
tora-kozic committed Feb 18, 2022
1 parent 79e8c9a commit e7f9ce6
Show file tree
Hide file tree
Showing 35 changed files with 169 additions and 121 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
- name: Add mock servers host addresses
run: |
sudo tee -a /etc/hosts <<EOF
127.0.0.1 localhost
127.0.0.1 core
127.0.0.1 alerts
127.0.0.1 alert-rules
Expand All @@ -56,4 +57,4 @@ jobs:
- name: Start up the mock servers
run: cd code42-mock-servers; docker-compose up -d --build
- name: Run the integration testss
run: cd py42; tox -e integration
run: sleep 15; cd py42; tox -e integration
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ tox -e docs
To build and run the documentation locally, run the following from the `docs` directory:

```bash
pip install sphinx recommonmark sphinx_rtd_theme
pip install sphinx myst_parser sphinx_rtd_theme
make html
```

Expand Down
26 changes: 13 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import os
import sys

from recommonmark.transform import AutoStructify

import py42.__version__ as meta

# -- Project information -----------------------------------------------------
Expand All @@ -37,7 +35,10 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "recommonmark"]
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "myst_parser"]

# Add myst_parser types to suppress warnings
suppress_warnings = ["myst.header"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down Expand Up @@ -81,7 +82,14 @@
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {"style_nav_header_background": "#f0f0f0", "logo_only": True}
html_theme_options = {
"style_nav_header_background": "#f0f0f0",
"logo_only": True,
# TOC options
"navigation_depth": 4,
"titles_only": True,
"collapse_navigation": False,
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand All @@ -106,15 +114,7 @@


def setup(app):
app.add_config_value(
"recommonmark_config",
{
# 'url_resolver': lambda url: github_doc_root + url, 'auto_toc_tree_maxdepth': 2,
"enable_eval_rst": True
},
True,
)
app.add_transform(AutoStructify)
pass


sys.path.insert(0, os.path.abspath(".."))
20 changes: 20 additions & 0 deletions docs/guides.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@

# User Guides

```{eval-rst}
.. toctree::
:hidden:
:maxdepth: 2
:glob:
Getting Started <userguides/gettingstarted>
Basics <userguides/basics>
userguides/searches
userguides/departingemployee
userguides/highriskemployee
userguides/orgdevices
Device Settings <userguides/devicesettings>
Org Settings <userguides/orgsettings>
Backup Sets <userguides/backupsets>
userguides/cases
userguides/trustedactivities
```

* [Getting Started](userguides/gettingstarted.md)
* [Basics](userguides/basics.md)
* [Executing Searches](userguides/searches.md)
Expand Down
17 changes: 17 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# py42, the Code42 Python SDK

```{eval-rst}
.. toctree::
:hidden:
:maxdepth: 2
guides
```

```{eval-rst}
.. toctree::
:hidden:
:maxdepth: 2
methods
```


[![license](https://img.shields.io/pypi/l/py42.svg)](https://pypi.org/project/py42/)
[![versions](https://img.shields.io/pypi/pyversions/py42.svg)](https://pypi.org/project/py42/)

Expand Down
8 changes: 4 additions & 4 deletions docs/methoddocs/alertrules.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Alert Rules

```eval_rst
```{eval-rst}
.. autoclass:: py42.clients.alertrules.AlertRulesClient
:members:
:show-inheritance:
```

## Exfiltration rules

```eval_rst
```{eval-rst}
.. autoclass:: py42.services.alertrules.ExfiltrationService
:members:
:show-inheritance:
```

## Cloud share rules

```eval_rst
```{eval-rst}
.. autoclass:: py42.services.alertrules.CloudShareService
:members:
:show-inheritance:
```

## File type mismatch rules

```eval_rst
```{eval-rst}
.. autoclass:: py42.services.alertrules.FileTypeMismatchService
:members:
:show-inheritance:
Expand Down
6 changes: 3 additions & 3 deletions docs/methoddocs/alerts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Alerts

```eval_rst
```{eval-rst}
.. autoclass:: py42.clients.alerts.AlertsClient
:members:
:show-inheritance:
Expand All @@ -15,14 +15,14 @@ that match multiple filter rules.

See [Executing Searches](../userguides/searches.md) for more on building search queries.

```eval_rst
```{eval-rst}
.. automodule:: py42.sdk.queries.alerts.filters.alert_filter
:members:
:inherited-members:
:show-inheritance:
```

```eval_rst
```{eval-rst}
.. autoclass:: py42.sdk.queries.alerts.alert_query.AlertQuery
:members:
:show-inheritance:
Expand Down
2 changes: 1 addition & 1 deletion docs/methoddocs/archive.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Archive

```eval_rst
```{eval-rst}
.. autoclass:: py42.clients.archive.ArchiveClient
:members:
:show-inheritance:
Expand Down
2 changes: 1 addition & 1 deletion docs/methoddocs/auditlogs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Audit Logs

```eval_rst
```{eval-rst}
.. autoclass:: py42.clients.auditlogs.AuditLogsClient
:members:
:show-inheritance:
Expand Down
2 changes: 1 addition & 1 deletion docs/methoddocs/backupset.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Backup Sets

```eval_rst
```{eval-rst}
.. autoclass:: py42.clients.settings.device_settings.BackupSet
:members:
:show-inheritance:
Expand Down
6 changes: 3 additions & 3 deletions docs/methoddocs/cases.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Cases

```eval_rst
```{eval-rst}
.. autoclass:: py42.clients.cases.CaseStatus
:members:
:show-inheritance:
```

```eval_rst
```{eval-rst}
.. autoclass:: py42.clients.cases.CasesClient
:members:
:show-inheritance:
```

## Cases File Events

```eval_rst
```{eval-rst}
.. autoclass:: py42.services.casesfileevents.CasesFileEventsService
:members:
:show-inheritance:
Expand Down
12 changes: 6 additions & 6 deletions docs/methoddocs/constants.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# Shared Constants

```eval_rst
```{eval-rst}
.. autoclass:: py42.constants.SortDirection
:members:
:show-inheritance:
```

```eval_rst
```{eval-rst}
.. autoclass:: py42.constants.CaseStatus
:members:
:show-inheritance:
```

```eval_rst
```{eval-rst}
.. autoclass:: py42.constants.RiskTags
:members:
:show-inheritance:
```

```eval_rst
```{eval-rst}
.. autoclass:: py42.constants.TrustedActivityType
:members:
:show-inheritance:
```

```eval_rst
```{eval-rst}
.. autoclass:: py42.constants.DepartingEmployeeFilters
:members:
:show-inheritance:
```

```eval_rst
```{eval-rst}
.. autoclass:: py42.constants.HighRiskEmployeeFilters
:members:
:show-inheritance:
Expand Down
12 changes: 6 additions & 6 deletions docs/methoddocs/detectionlists.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# Detection Lists

```eval_rst
```{eval-rst}
.. autoclass:: py42.clients.detectionlists.DetectionListsClient
:members:
:show-inheritance:
```

## Departing Employees

```eval_rst
```{eval-rst}
.. autoclass:: py42.services.detectionlists.departing_employee.DepartingEmployeeFilters
:members:
:show-inheritance:
```

```eval_rst
```{eval-rst}
.. autoclass:: py42.services.detectionlists.departing_employee.DepartingEmployeeService
:members:
:show-inheritance:
```

## High Risk Employee

```eval_rst
```{eval-rst}
.. autoclass:: py42.clients.detectionlists.RiskTags
:members:
:show-inheritance:
```

```eval_rst
```{eval-rst}
.. autoclass:: py42.services.detectionlists.high_risk_employee.HighRiskEmployeeFilters
:members:
:show-inheritance:
```

```eval_rst
```{eval-rst}
.. autoclass:: py42.services.detectionlists.high_risk_employee.HighRiskEmployeeService
:members:
:show-inheritance:
Expand Down
2 changes: 1 addition & 1 deletion docs/methoddocs/devices.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Devices

```eval_rst
```{eval-rst}
.. autoclass:: py42.services.devices.DeviceService
:members:
:show-inheritance:
Expand Down
2 changes: 1 addition & 1 deletion docs/methoddocs/devicesettings.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Device Settings

```eval_rst
```{eval-rst}
.. autoclass:: py42.clients.settings.device_settings.DeviceSettings
:members:
:show-inheritance:
Expand Down
2 changes: 1 addition & 1 deletion docs/methoddocs/exceptions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Exceptions

```eval_rst
```{eval-rst}
.. automodule:: py42.exceptions
:members:
:inherited-members:
Expand Down

0 comments on commit e7f9ce6

Please sign in to comment.