{"id":15023104,"url":"https://github.com/oprypin/mkdocs-code-validator","last_synced_at":"2025-10-25T16:30:55.801Z","repository":{"id":54346558,"uuid":"353111968","full_name":"oprypin/mkdocs-code-validator","owner":"oprypin","description":"Checks Markdown code blocks in a MkDocs site against user-defined actions","archived":false,"fork":false,"pushed_at":"2024-12-07T18:22:33.000Z","size":73,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T08:05:51.799Z","etag":null,"topics":["linter","mkdocs","mkdocs-plugin"],"latest_commit_sha":null,"homepage":"https://oprypin.github.io/mkdocs-code-validator","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oprypin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"oprypin"}},"created_at":"2021-03-30T19:03:22.000Z","updated_at":"2024-12-07T18:22:36.000Z","dependencies_parsed_at":"2023-10-15T13:26:44.571Z","dependency_job_id":"4cab5066-92e1-4858-b252-06ac408338f3","html_url":"https://github.com/oprypin/mkdocs-code-validator","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"586842aa7e72d08d4cc61c1bf3644a3fe109b344"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oprypin%2Fmkdocs-code-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oprypin%2Fmkdocs-code-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oprypin%2Fmkdocs-code-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oprypin%2Fmkdocs-code-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oprypin","download_url":"https://codeload.github.com/oprypin/mkdocs-code-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238174152,"owners_count":19428633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linter","mkdocs","mkdocs-plugin"],"created_at":"2024-09-24T19:58:44.339Z","updated_at":"2025-10-25T16:30:55.510Z","avatar_url":"https://github.com/oprypin.png","language":"Python","funding_links":["https://github.com/sponsors/oprypin"],"categories":[],"sub_categories":[],"readme":"# mkdocs-code-validator\n\n**Checks Markdown code blocks in a [MkDocs][] site against user-defined actions**\n\n[![PyPI](https://img.shields.io/pypi/v/mkdocs-code-validator)](https://pypi.org/project/mkdocs-code-validator/)\n[![License](https://img.shields.io/github/license/oprypin/mkdocs-code-validator)](https://github.com/oprypin/mkdocs-code-validator/blob/master/LICENSE.md)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/oprypin/mkdocs-code-validator/ci.yml.svg)](https://github.com/oprypin/mkdocs-code-validator/actions?query=event%3Apush+branch%3Amaster)\n\n```shell\npip install mkdocs-code-validator\n```\n\n## Usage\n\nActivate the plugin in **mkdocs.yml**. The `identifiers` config is mandatory. And the plugin **doesn't work without [pymdownx.superfences][]**:\n\n```yaml\nplugins:\n  - search\n  - code-validator:\n      identifiers:\n        bash:\n          validators:\n            - grep a\nmarkdown_extensions:\n  - pymdownx.superfences\n```\n\nThe above contrived config checks that every \u003ccode\u003e```bash\u003c/code\u003e code block in the Markdown files of this MkDocs site must contain the letter \"a\", otherwise a warning will appear.\n\nThe content of each code block is piped as stdin to the command. The exit code of the command is what's checked: a non-zero code will produce a warning (which in MkDocs you can make fatal with the `--strict` flag). The output of the command is not used in any way, only preserved on the screen as part of a warning.\n\nYou can add any number of identifiers, and within them any number of `validators` commands, each of them has the ability to produce a warning.\n\nIf stdin is not usable with your command, the input can be passed as a temporary file instead -- that is done if the command contains the exact argument `$\u003c` (which is then replaced with a file path). For the above example, changing the command to `grep a $\u003c` would be equivalent (other than technicalities).\n\nThe commands do *not* allow freeform shell syntax, it's just one subprocess to call with its arguments. To explicitly opt into a shell, just run it as (e.g.) `sh -c 'if grep a; then exit 1; fi'`. Or, with a temporary file: `sh -c 'if grep a \"$1\"; then exit 1; fi' $\u003c`.\n\nThe definition of what a code block is is all according to the [pymdownx.superfences][] extension. It must be enabled; the plugin won't do anything without it.\n\n\n[mkdocs]: https://www.mkdocs.org/\n[documentation site]: https://oprypin.github.io/mkdocs-code-validator\n[pymdownx.superfences]: https://facelessuser.github.io/pymdown-extensions/extensions/superfences/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foprypin%2Fmkdocs-code-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foprypin%2Fmkdocs-code-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foprypin%2Fmkdocs-code-validator/lists"}