Skip to content

Commit 5348668

Browse files
authored
replace recommonmark with myst_parser (#358)
1 parent 2546ac0 commit 5348668

File tree

9 files changed

+85
-29
lines changed

9 files changed

+85
-29
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ tox -e docs
172172
To build and run the documentation locally, run the following from the `docs` directory:
173173

174174
```bash
175-
pip install sphinx recommonmark sphinx_rtd_theme
175+
pip install sphinx myst_parser sphinx_rtd_theme
176176
make html
177177
```
178178

docs/commands.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Commands
22

3+
```{eval-rst}
4+
.. toctree::
5+
:hidden:
6+
:maxdepth: 2
7+
:glob:
8+
9+
Alert Rules <commands/alertrules.rst>
10+
Alerts <commands/alerts.rst>
11+
Audit Logs <commands/auditlogs.rst>
12+
Cases <commands/cases.rst>
13+
Departing Employee <commands/departingemployee.rst>
14+
Devices <commands/devices.rst>
15+
High Risk Employee <commands/highriskemployee.rst>
16+
Legal Hold <commands/legalhold.rst>
17+
Profile <commands/profile.rst>
18+
Security Data <commands/securitydata.rst>
19+
Trusted Activities <commands/trustedactivities.rst>
20+
Users <commands/users.rst>
21+
```
22+
323
* [Alert Rules](commands/alertrules.rst)
424
* [Alerts](commands/alerts.rst)
525
* [Audit Logs](commands/auditlogs.rst)

docs/conf.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import os
1313
import sys
1414

15-
from recommonmark.transform import AutoStructify
16-
1715
import code42cli.__version__ as meta
1816

1917
# -- Project information -----------------------------------------------------
@@ -40,10 +38,13 @@
4038
extensions = [
4139
"sphinx.ext.autodoc",
4240
"sphinx.ext.napoleon",
43-
"recommonmark",
41+
"myst_parser",
4442
"sphinx_click",
4543
]
4644

45+
# Add myst_parser types to suppress warnings
46+
suppress_warnings = ["myst.header"]
47+
4748
# Add any paths that contain templates here, relative to this directory.
4849
templates_path = ["_templates"]
4950

@@ -85,8 +86,15 @@
8586
# Theme options are theme-specific and customize the look and feel of a theme
8687
# further. For a list of options available for each theme, see the
8788
# documentation.
88-
#
89-
html_theme_options = {"style_nav_header_background": "#f0f0f0", "logo_only": True}
89+
90+
html_theme_options = {
91+
"style_nav_header_background": "#f0f0f0",
92+
"logo_only": True,
93+
# TOC options
94+
"navigation_depth": 4,
95+
"titles_only": True,
96+
"collapse_navigation": False,
97+
}
9098

9199
# Add any paths that contain custom static files (such as style sheets) here,
92100
# relative to this directory. They are copied after the builtin static files,
@@ -111,15 +119,7 @@
111119

112120

113121
def setup(app):
114-
app.add_config_value(
115-
"recommonmark_config",
116-
{
117-
# 'url_resolver': lambda url: github_doc_root + url, 'auto_toc_tree_maxdepth': 2,
118-
"enable_eval_rst": True
119-
},
120-
True,
121-
)
122-
app.add_transform(AutoStructify)
122+
pass
123123

124124

125125
sys.path.insert(0, os.path.abspath(".."))

docs/guides.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
11
# User Guides
22

3+
```{eval-rst}
4+
.. toctree::
5+
:hidden:
6+
:maxdepth: 2
7+
:glob:
8+
9+
Get started with the Code42 command-line interface (CLI) <userguides/gettingstarted.md>
10+
Configure a profile <userguides/profile.md>
11+
Ingest data into a SIEM <userguides/siemexample.md>
12+
Manage detection list users <userguides/detectionlists.md>
13+
Manage legal hold users <userguides/legalhold.md>
14+
Clean up your environment by deactivating devices <userguides/deactivatedevices.md>
15+
Write custom extension scripts using the Code42 CLI and Py42 <userguides/extensions.md>
16+
Manage users <userguides/users.md>
17+
Configure trusted activities <userguides/trustedactivities.md>
18+
Configure alert rules <userguides/alertrules.md>
19+
Add and manage cases <userguides/cases.md>
20+
Perform bulk actions <userguides/bulkcommands.md>
21+
```
22+
323
* [Get started with the Code42 command-line interface (CLI)](userguides/gettingstarted.md)
424
* [Configure a profile](userguides/profile.md)
5-
* [Ingest Data into a SIEM](userguides/siemexample.md)
25+
* [Ingest data into a SIEM](userguides/siemexample.md)
626
* [Manage detection list users](userguides/detectionlists.md)
727
* [Manage legal hold users](userguides/legalhold.md)
828
* [Clean up your environment by deactivating devices](userguides/deactivatedevices.md)
9-
* [Write custom extension scripts using the Code42 CLI and py42](userguides/extensions.md)
10-
* [Manage Users](userguides/users.md)
11-
* [Configure Trusted Activities](userguides/trustedactivities.md)
12-
* [Configure Alert Rules](userguides/alertrules.md)
13-
* [Add and Manage Cases](userguides/cases.md)
14-
* [Use Bulk Commands](userguides/bulkcommands.md)
29+
* [Write custom extension scripts using the Code42 CLI and Py42](userguides/extensions.md)
30+
* [Manage users](userguides/users.md)
31+
* [Configure trusted activities](userguides/trustedactivities.md)
32+
* [Configure alert rules](userguides/alertrules.md)
33+
* [Add and manage cases](userguides/cases.md)
34+
* [Perform bulk actions](userguides/bulkcommands.md)

docs/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Code42 command-line interface (CLI)
22

3+
```{eval-rst}
4+
.. toctree::
5+
:hidden:
6+
:maxdepth: 2
7+
8+
guides
9+
```
10+
11+
```{eval-rst}
12+
.. toctree::
13+
:hidden:
14+
:maxdepth: 2
15+
16+
commands
17+
```
18+
319
[![license](https://img.shields.io/pypi/l/code42cli.svg)](https://pypi.org/project/code42cli/)
420
[![versions](https://img.shields.io/pypi/pyversions/code42cli.svg)](https://pypi.org/project/code42cli/)
521

docs/userguides/gettingstarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ python3 -m pip install code42cli --upgrade
6868

6969
## Authentication
7070

71-
```eval_rst
71+
```{eval-rst}
7272
.. important:: The Code42 CLI currently only supports token-based authentication.
7373
```
7474

docs/userguides/siemexample.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ The following tables map the file event data from the Code42 CLI to common event
174174
The table below maps JSON fields, CEF fields, and [Forensic Search fields](https://code42.com/r/support/forensic-search-fields)
175175
to one another.
176176

177-
```eval_rst
177+
```{eval-rst}
178178
179179
+----------------------------+---------------------------------+----------------------------------------+
180180
| JSON field | CEF field | Forensic Search field |
@@ -255,7 +255,7 @@ to one another.
255255

256256
See the table below to map file events to CEF signature IDs.
257257

258-
```eval_rst
258+
```{eval-rst}
259259
260260
+--------------------+-----------+
261261
| Exfiltration event | CEF field |

docs/userguides/trustedactivities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To update multiple trusted activities at once, enter information about the trust
4949
code42 trusted-activities bulk update update_trusted_activities.csv
5050
```
5151

52-
```eval_rst
52+
```{eval-rst}
5353
.. note::
5454
The ``bulk update`` command cannot be used to clear the description of a trusted activity because you cannot indicate an empty string in a CSV format.
5555
Pass an empty string to the ``description`` option of the ``update`` command to clear the description of a trusted activity.

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ commands =
2424

2525
[testenv:docs]
2626
deps =
27-
sphinx
28-
recommonmark
29-
sphinx_rtd_theme
27+
sphinx == 4.4.0
28+
myst_parser == 0.16
29+
sphinx_rtd_theme == 0.5.2
3030
sphinx-click
3131
whitelist_externals = bash
3232

0 commit comments

Comments
 (0)