diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml.bkp similarity index 100% rename from .github/workflows/docs.yaml rename to .github/workflows/docs.yaml.bkp diff --git a/.gitignore b/.gitignore index b0e8577e..77011613 100644 --- a/.gitignore +++ b/.gitignore @@ -69,7 +69,7 @@ instance/ .scrapy # Sphinx documentation -docs/reference/ +# docs/references/ docs/_build/ docs/*.rst docs/*.1 diff --git a/LICENSE.txt b/LICENSE.txt index 8ff8093d..d21a342b 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013 - 2023 Konsta Vesterinen +Copyright (c) 2013 - 2024 Konsta Vesterinen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index fe0f2932..04dad454 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,17 @@ True ## Resources -- [Documentation](https://python-validators.github.io/validators/) + + + +- [Documentation](https://yozachar.github.io/pyvalidators/) - [Bugtracker](https://github.com/python-validators/validators/issues) - [Security](https://github.com/python-validators/validators/blob/master/SECURITY.md) - [Code](https://github.com/python-validators/validators/) -[//]: #(Links) + + + [sast-badge]: https://github.com/python-validators/validators/actions/workflows/sast.yaml/badge.svg [sast-link]: https://github.com/python-validators/validators/actions/workflows/sast.yaml [pycqa-badge]: https://github.com/python-validators/validators/actions/workflows/pycqa.yaml/badge.svg diff --git a/docs/index.md b/docs/index.md index fe0f2932..002103a7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,7 +18,7 @@ True ## Resources -- [Documentation](https://python-validators.github.io/validators/) +- [Documentation](https://yozachar.github.io/pyvalidators/) - [Bugtracker](https://github.com/python-validators/validators/issues) - [Security](https://github.com/python-validators/validators/blob/master/SECURITY.md) - [Code](https://github.com/python-validators/validators/) diff --git a/docs/references/between.md b/docs/references/between.md new file mode 100644 index 00000000..61376ea6 --- /dev/null +++ b/docs/references/between.md @@ -0,0 +1,3 @@ +# between + +::: validators.between.between diff --git a/docs/references/btc_address.md b/docs/references/btc_address.md new file mode 100644 index 00000000..989ca21a --- /dev/null +++ b/docs/references/btc_address.md @@ -0,0 +1,3 @@ +# btc_address + +::: validators.btc_address.btc_address diff --git a/docs/references/card.md b/docs/references/card.md new file mode 100644 index 00000000..c45cd8ad --- /dev/null +++ b/docs/references/card.md @@ -0,0 +1,10 @@ +# card + +::: validators.card.amex +::: validators.card.card_number +::: validators.card.diners +::: validators.card.discover +::: validators.card.jcb +::: validators.card.mastercard +::: validators.card.unionpay +::: validators.card.visa diff --git a/docs/references/country_code.md b/docs/references/country_code.md new file mode 100644 index 00000000..63fcade3 --- /dev/null +++ b/docs/references/country_code.md @@ -0,0 +1,3 @@ +# country_code + +::: validators.country_code.country_code diff --git a/docs/references/domain.md b/docs/references/domain.md new file mode 100644 index 00000000..12a44a91 --- /dev/null +++ b/docs/references/domain.md @@ -0,0 +1,3 @@ +# domain + +::: validators.domain.domain diff --git a/docs/references/email.md b/docs/references/email.md new file mode 100644 index 00000000..c7406d59 --- /dev/null +++ b/docs/references/email.md @@ -0,0 +1,3 @@ +# email + +::: validators.email.email diff --git a/docs/references/hashes.md b/docs/references/hashes.md new file mode 100644 index 00000000..82b11bf0 --- /dev/null +++ b/docs/references/hashes.md @@ -0,0 +1,7 @@ +# hashes + +::: validators.hashes.md5 +::: validators.hashes.sha1 +::: validators.hashes.sha224 +::: validators.hashes.sha256 +::: validators.hashes.sha512 diff --git a/docs/references/hostname.md b/docs/references/hostname.md new file mode 100644 index 00000000..2fb99eee --- /dev/null +++ b/docs/references/hostname.md @@ -0,0 +1,3 @@ +# hostname + +::: validators.hostname.hostname diff --git a/docs/references/i18n.md b/docs/references/i18n.md new file mode 100644 index 00000000..55e77433 --- /dev/null +++ b/docs/references/i18n.md @@ -0,0 +1,10 @@ +# i18n + +::: validators.i18n.es_cif +::: validators.i18n.es_doi +::: validators.i18n.es_nie +::: validators.i18n.es_nif +::: validators.i18n.fi_business_id +::: validators.i18n.fi_ssn +::: validators.i18n.fr_department +::: validators.i18n.fr_ssn diff --git a/docs/references/iban.md b/docs/references/iban.md new file mode 100644 index 00000000..2d63d977 --- /dev/null +++ b/docs/references/iban.md @@ -0,0 +1,3 @@ +# iban + +::: validators.iban.iban diff --git a/docs/references/ip_address.md b/docs/references/ip_address.md new file mode 100644 index 00000000..43092d5a --- /dev/null +++ b/docs/references/ip_address.md @@ -0,0 +1,4 @@ +# ip_address + +::: validators.ip_address.ipv4 +::: validators.ip_address.ipv6 diff --git a/docs/references/length.md b/docs/references/length.md new file mode 100644 index 00000000..25e53bb3 --- /dev/null +++ b/docs/references/length.md @@ -0,0 +1,3 @@ +# length + +::: validators.length.length diff --git a/docs/references/mac_address.md b/docs/references/mac_address.md new file mode 100644 index 00000000..e5fcaeba --- /dev/null +++ b/docs/references/mac_address.md @@ -0,0 +1,3 @@ +# mac_address + +::: validators.mac_address.mac_address diff --git a/docs/references/slug.md b/docs/references/slug.md new file mode 100644 index 00000000..4df4ecae --- /dev/null +++ b/docs/references/slug.md @@ -0,0 +1,3 @@ +# slug + +::: validators.slug.slug diff --git a/docs/references/url.md b/docs/references/url.md new file mode 100644 index 00000000..c16d6f4a --- /dev/null +++ b/docs/references/url.md @@ -0,0 +1,3 @@ +# url + +::: validators.url.url diff --git a/docs/references/utils.md b/docs/references/utils.md new file mode 100644 index 00000000..971e1b3d --- /dev/null +++ b/docs/references/utils.md @@ -0,0 +1,4 @@ +# utils + +::: validators.utils.ValidationError +::: validators.utils.validator diff --git a/docs/references/uuid.md b/docs/references/uuid.md new file mode 100644 index 00000000..45602786 --- /dev/null +++ b/docs/references/uuid.md @@ -0,0 +1,3 @@ +# uuid + +::: validators.uuid.uuid diff --git a/mkdocs.yaml b/mkdocs.yaml index 47c692c7..7ac5d95b 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -1,6 +1,6 @@ site_name: "validators" site_description: "Automatic documentation from sources, for MkDocs." -site_url: "https://python-validators.github.io/validators/" +site_url: "https://yozachar.github.io/pyvalidators/" repo_url: "https://github.com/python-validators/validators" edit_uri: "edit/master/docs/" repo_name: "validators/validators" @@ -48,6 +48,7 @@ plugins: import: - https://docs.python-requests.org/en/master/objects.inv - git-revision-date-localized + - mike extra: social: @@ -55,8 +56,29 @@ extra: link: https://github.com/python-validators - icon: fontawesome/brands/python link: https://pypi.org/project/validators + version: + provider: mike + default: dev -copyright: Copyright © 2013 - 2023 Konsta Vesterinen +copyright: Copyright © 2013 - 2024 Konsta Vesterinen nav: - Home: index.md + - API: + - references/between.md + - references/btc_address.md + - references/card.md + - references/country_code.md + - references/domain.md + - references/email.md + - references/hashes.md + - references/hostname.md + - references/i18n.md + - references/iban.md + - references/ip_address.md + - references/length.md + - references/mac_address.md + - references/slug.md + - references/url.md + - references/utils.md + - references/uuid.md diff --git a/package/roll.sh b/package/roll.sh old mode 100644 new mode 100755 diff --git a/pdm.lock b/pdm.lock index 26b74b4d..6a26eeec 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "docs-offline", "docs-online", "hooks", "package", "pycqa", "runner", "sast", "testing", "tooling"] strategy = ["cross_platform"] lock_version = "4.4.1" -content_hash = "sha256:90bf5fd8d39d4fcf26c942edf3e4b72d92eaecf9f17158730f162624cfc94029" +content_hash = "sha256:0b28fa0002f81e6dc424a697963c9df6c2c25a4906777694d8d07aa1aa33960f" [[package]] name = "alabaster" @@ -690,6 +690,24 @@ files = [ {file = "mergedeep-1.3.4.tar.gz", hash = "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8"}, ] +[[package]] +name = "mike" +version = "2.0.0" +summary = "Manage multiple versions of your MkDocs-powered documentation" +dependencies = [ + "importlib-metadata", + "importlib-resources", + "jinja2>=2.7", + "mkdocs>=1.0", + "pyparsing>=3.0", + "pyyaml>=5.1", + "verspec", +] +files = [ + {file = "mike-2.0.0-py3-none-any.whl", hash = "sha256:87f496a65900f93ba92d72940242b65c86f3f2f82871bc60ebdcffc91fad1d9e"}, + {file = "mike-2.0.0.tar.gz", hash = "sha256:566f1cab1a58cc50b106fb79ea2f1f56e7bfc8b25a051e95e6eaee9fba0922de"}, +] + [[package]] name = "mkdocs" version = "1.5.3" @@ -1049,6 +1067,16 @@ files = [ {file = "pypandoc_binary-1.12-py3-none-win_amd64.whl", hash = "sha256:600006a15ff1729160c203768be0aa95fd43d50ec88f8b23ece0d1423b6f633c"}, ] +[[package]] +name = "pyparsing" +version = "3.1.2" +requires_python = ">=3.6.8" +summary = "pyparsing module - Classes and methods to define and execute parsing grammars" +files = [ + {file = "pyparsing-3.1.2-py3-none-any.whl", hash = "sha256:f9db75911801ed778fe61bb643079ff86601aca99fcae6345aa67292038fb742"}, + {file = "pyparsing-3.1.2.tar.gz", hash = "sha256:a1bac0ce561155ecc3ed78ca94d3c9378656ad4c94c1270de543f621420f94ad"}, +] + [[package]] name = "pyproject-api" version = "1.6.1" @@ -1588,6 +1616,15 @@ files = [ {file = "urllib3-2.0.6.tar.gz", hash = "sha256:b19e1a85d206b56d7df1d5e683df4a7725252a964e3993648dd0fb5a1c157564"}, ] +[[package]] +name = "verspec" +version = "0.1.0" +summary = "Flexible version handling" +files = [ + {file = "verspec-0.1.0-py3-none-any.whl", hash = "sha256:741877d5633cc9464c45a469ae2a31e801e6dbbaa85b9675d481cda100f11c31"}, + {file = "verspec-0.1.0.tar.gz", hash = "sha256:c4504ca697b2056cdb4bfa7121461f5a0e81809255b41c03dda4ba823637c01e"}, +] + [[package]] name = "virtualenv" version = "20.25.0" diff --git a/pyproject.toml b/pyproject.toml index c6c8e4c1..b5b78a72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,6 +61,7 @@ docs-online = [ "mkdocs-material>=9.5.6", "mkdocstrings[python]>=0.24.0", "pyaml>=23.12.0", + "mike>=2.0.0", ] hooks = ["pre-commit>=3.5.0"] package = ["build>=1.0.3", "twine>=4.0.2"] diff --git a/src/export/__main__.py b/src/export/__main__.py index eedb57fc..05526504 100644 --- a/src/export/__main__.py +++ b/src/export/__main__.py @@ -46,7 +46,7 @@ def _generate_reference(source: Path, destination: Path, ext: str): for alias in aliases: _write_ref_content(destination / f"{module_name}.{ext}", module_name, alias.name) if ext == "md": - nav_items["Code Reference"].append(f"reference/{module_name}.md") + nav_items["Code Reference"].append(f"references/{module_name}.md") return nav_items @@ -91,7 +91,7 @@ def _gen_rst_docs(source: Path, refs_path: Path, only_web: bool = False, only_ma + "\n :maxdepth: 2" + "\n :caption: Reference:" + "\n :glob:\n" - + "\n reference/*\n" + + "\n references/*\n" ) # generate RST reference documentation _generate_reference(source / "src/validators/__init__.py", refs_path, "rst") @@ -128,7 +128,7 @@ def generate_documentation( # copy readme as docs index file copy(source / "README.md", source / "docs/index.md") # clean destination - refs_path = source / "docs/reference" + refs_path = source / "docs/references" if refs_path.is_dir(): rmtree(refs_path) refs_path.mkdir(exist_ok=True) @@ -174,7 +174,7 @@ def package(source: Path): only_md=True, only_rst_web=False, only_rst_man=False, - discard_refs=True, + discard_refs=False, ) quit(exit_code)