From a859f8ba4da2d88a408f428d60a0e45929dfb6af Mon Sep 17 00:00:00 2001 From: Koen1999 Date: Sun, 19 Jan 2025 18:10:21 +0100 Subject: [PATCH] Added meta tags to documentation website --- docs/api_usage.md | 6 ++++++ docs/checker.md | 6 ++++++ docs/ci_cd.md | 6 ++++++ docs/cli_usage.md | 6 ++++++ docs/conf.py | 10 ++++++++-- docs/contributing.md | 6 ++++++ docs/readme.md | 6 ++++++ docs/static/js/{umami.js => script.js} | 0 suricata_check/_version.py | 2 +- 9 files changed, 45 insertions(+), 3 deletions(-) rename docs/static/js/{umami.js => script.js} (100%) diff --git a/docs/api_usage.md b/docs/api_usage.md index d55072c..90bb86c 100644 --- a/docs/api_usage.md +++ b/docs/api_usage.md @@ -1,3 +1,9 @@ +--- +myst: + html_meta: + "description lang=en": "suricata-check is a command line utility to provide feedback on Suricata rules to by detecting issues through static analysis." + "keywords": "Suricata, rules, ruleset, suricata-check, API, Python" +--- # API Usage Sometimes it may be more convenient to avoid the CLI and instead use the module directly, which exposes more functionality and may be easier te extend if your project also uses Python. Below, we will characterize several use-cases you may encounter and how to address them using the functionality exposed by `suricata-check`. diff --git a/docs/checker.md b/docs/checker.md index 22c83d3..07d040e 100644 --- a/docs/checker.md +++ b/docs/checker.md @@ -1,3 +1,9 @@ +--- +myst: + html_meta: + "description lang=en": "suricata-check is a command line utility to provide feedback on Suricata rules to by detecting issues through static analysis." + "keywords": "Suricata, suricata-check, Extend, Checker" +--- # Writing checkers ## CheckerInterface diff --git a/docs/ci_cd.md b/docs/ci_cd.md index 2ded5f6..f5312bd 100644 --- a/docs/ci_cd.md +++ b/docs/ci_cd.md @@ -1,3 +1,9 @@ +--- +myst: + html_meta: + "description lang=en": "suricata-check is a command line utility to provide feedback on Suricata rules to by detecting issues through static analysis." + "keywords": "Suricata, rules, ruleset, suricata-check, Continuous Integration, Continuous Deployment, Workflow, Action, GitHub, GitLab, CodeClimate" +--- # CI/CD Integration If you maintain a large rulebase in through version-control managed platform, you may be interested in integrating `suricata-check` with your Continuous Integration and Continuous Deployment workflows. diff --git a/docs/cli_usage.md b/docs/cli_usage.md index 99f6620..c5e5ea2 100644 --- a/docs/cli_usage.md +++ b/docs/cli_usage.md @@ -1,3 +1,9 @@ +--- +myst: + html_meta: + "description lang=en": "suricata-check is a command line utility to provide feedback on Suricata rules to by detecting issues through static analysis." + "keywords": "Suricata, rules, ruleset, suricata-check, CLI, Command Line, rules, rule" +--- # CLI Usage After having installed `suricata_check` as described in [Installation](./readme.md#installation) and having ensured it is included in the `PATH` variable (check your operating system specific instructions for this), you can invoke it using by running `suricata-check`. diff --git a/docs/conf.py b/docs/conf.py index c34c48c..f4b0d67 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,9 +55,15 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = "sphinx_rtd_theme" +html_theme_options = { + 'display_version': True, + 'prev_next_buttons_location': 'both', + 'style_external_links': True, +} html_static_path = ["static"] +html_favicon = "https://docs.readthedocs.io/favicon.ico" -html_js_files = ["js/umami.js"] +html_js_files = ["js/script.js"] # -- Options for MyST ------------------------------------------------- # https://myst-parser.readthedocs.io/en/latest/ @@ -93,4 +99,4 @@ "search.html", "genindex.html" ] -html_extra_path = ['robots.txt'] \ No newline at end of file +html_extra_path = ['robots.txt'] diff --git a/docs/contributing.md b/docs/contributing.md index 435d357..7ed4ee7 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -1,2 +1,8 @@ +--- +myst: + html_meta: + "description lang=en": "suricata-check is a command line utility to provide feedback on Suricata rules to by detecting issues through static analysis." + "keywords": "Suricata, suricata-check, Python, Contributing" +--- ```{include} ../CONTRIBUTING.md ``` \ No newline at end of file diff --git a/docs/readme.md b/docs/readme.md index d139312..cbffe1a 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,2 +1,8 @@ +--- +myst: + html_meta: + "description lang=en": "suricata-check is a command line utility to provide feedback on Suricata rules to by detecting issues through static analysis." + "keywords": "Suricata, rules, ruleset, suricata-check" +--- ```{include} ../README.md ``` \ No newline at end of file diff --git a/docs/static/js/umami.js b/docs/static/js/script.js similarity index 100% rename from docs/static/js/umami.js rename to docs/static/js/script.js diff --git a/suricata_check/_version.py b/suricata_check/_version.py index 6cf84e1..52a7322 100644 --- a/suricata_check/_version.py +++ b/suricata_check/_version.py @@ -25,7 +25,7 @@ def get_version() -> str: try: import setuptools_git_versioning - v = str(setuptools_git_versioning.get_version()) + v = str(setuptools_git_versioning.get_version(root=SURICATA_CHECK_DIR)) _logger.debug( "Detected suricata-check version using setuptools_git_versioning: %s", v )