From 2e2b89fee806ccf3bf222d80da1a6b6190daa20b Mon Sep 17 00:00:00 2001 From: Alexander Uhlig <2765645+alxn4@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:00:29 +0000 Subject: [PATCH] added htmlproofer --- .github/workflows/mkdocs-gh-pages.yaml | 1 + docs/docs-readme.md | 10 +++++----- mkdocs.yaml | 22 +++++++++++++++++++++- pyproject.toml | 2 ++ 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.github/workflows/mkdocs-gh-pages.yaml b/.github/workflows/mkdocs-gh-pages.yaml index eaeeab92..047d6b87 100644 --- a/.github/workflows/mkdocs-gh-pages.yaml +++ b/.github/workflows/mkdocs-gh-pages.yaml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest env: GH_C17_DEV_TOKEN: ${{ secrets.GH_C17_DEV_TOKEN }} + ENABLED_HTMLPROOFER: ${{ vars.ENABLED_HTMLPROOFER || 'False' }} steps: - name: Checkout reflect-cpp repo uses: actions/checkout@v4 diff --git a/docs/docs-readme.md b/docs/docs-readme.md index af2a2d84..14834b53 100644 --- a/docs/docs-readme.md +++ b/docs/docs-readme.md @@ -8,15 +8,15 @@ hide: ## The basics - +[Structs](concepts/structs.md) - Recaps the motivating example in the README. A struct is the equivalent of an AND statement or a product type in type theory. [Optional fields](optional_fields.md) - For defining fields in your serialized format that might be absent in some cases. [Struct flattening](flatten_structs.md) - For making struct A "inherit" the fields of struct B. - +[Processors](concepts/processors.md) - For modifying the structs before serialization and deserialization. For instance, processors can be used to transform all field names from `snake_case` to `camelCase`. - +[The rfl::Field-syntax](concepts/field_syntax.md) - Describes an alternative syntax which requires slightly more effort, but allows for some powerful functionalities. [String literals](literals.md) - For representing strings that can only assume a limited number of enumerated values. @@ -62,7 +62,7 @@ hide: ## Custom classes - +[Custom classes](concepts/custom_classes.md) - For custom classes with private fields. [Custom parsers for your classes](custom_parser.md) - For custom classes with private fields that you want to leave absolutely untouched. @@ -98,7 +98,7 @@ hide: ## Advanced topics - +[Supporting your own format](supported_formats/supporting_your_own_format.md) - For supporting your own serialization and deserialization formats. [Maintaining backwards compatability](backwards_compatability.md) - Instructions on how to ensure that your API is backwards-compatible with older versions. diff --git a/mkdocs.yaml b/mkdocs.yaml index 2fac29d7..52fa5487 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -65,10 +65,16 @@ extra: # https://www.mkdocs.org/user-guide/configuration/#validation #validation: -# omitted_files: warn # absolute_links: warn # unrecognized_links: warn +validation: + omitted_files: warn + links: + absolute_links: relative_to_docs + anchors: warn + unrecognized_links: warn + extra_css: - assets/stylesheets/tweaks.css @@ -127,6 +133,20 @@ watch: plugins: - search - meta + - htmlproofer: + enabled: !ENV [ENABLED_HTMLPROOFER, False] + raise_error_after_finish: True + raise_error_excludes: + 403: ['*'] + 502: ['*'] + 504: ['*'] + + ignore_urls: + - localhost:8080/* + - mailto:* + - 'data:image/*' + - '#*' + hooks: - docs/plugins/main.py diff --git a/pyproject.toml b/pyproject.toml index 977dd426..a1ccc998 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,10 +6,12 @@ version = "0.14.1" dependencies = [ "mkdocs~=1.6", "mkdocs-material~=9.5", + "mkdocs-htmlproofer-plugin~=1.2", ] [tool.hatch.envs.insiders] dependencies = [ "mkdocs~=1.6", "mkdocs-material @ git+https://{env:GH_C17_DEV_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git@9.5.39-insiders-4.53.14", + "mkdocs-htmlproofer-plugin~=1.2", ] \ No newline at end of file