diff --git a/docs/_includes/carousel.html b/docs/_includes/carousel.html deleted file mode 100644 index a4ecb1574e10..000000000000 --- a/docs/_includes/carousel.html +++ /dev/null @@ -1,32 +0,0 @@ -
-
- -
-
- - diff --git a/docs/_includes/overrides/home.html b/docs/_includes/overrides/home.html deleted file mode 100644 index b5bcdedb405f..000000000000 --- a/docs/_includes/overrides/home.html +++ /dev/null @@ -1,49 +0,0 @@ -{% extends "main.html" %} - -{% block tabs %} -{{ super() }} - -{% endblock tabs %} - -{% block content %} - - - - - -

InvenTree - Intuitive Inventory Management

- - -
-
- -
-
- {{ page.content }} -{% endblock content %} diff --git a/docs/_includes/overrides/main.html b/docs/_includes/overrides/main.html deleted file mode 100644 index 576314115d57..000000000000 --- a/docs/_includes/overrides/main.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "base.html" %} - -{% block footer %} -{% include "partials/version_banner.html" %} -{% include "partials/footer.html" %} -{% endblock footer %} diff --git a/docs/_includes/overrides/partials/outdated.html b/docs/_includes/overrides/partials/outdated.html deleted file mode 100644 index 542e7fa4ab4a..000000000000 --- a/docs/_includes/overrides/partials/outdated.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/_includes/overrides/partials/version_banner.html b/docs/_includes/overrides/partials/version_banner.html deleted file mode 100644 index 0db2535c1697..000000000000 --- a/docs/_includes/overrides/partials/version_banner.html +++ /dev/null @@ -1,15 +0,0 @@ -{% if False and config.version_banner %} - -{% endif %} diff --git a/docs/docs/api/schema.md b/docs/docs/api/schema.md index ba610a07739c..e6819bd736b6 100644 --- a/docs/docs/api/schema.md +++ b/docs/docs/api/schema.md @@ -7,7 +7,7 @@ The API schema as documented below is generated using the [drf-spectactular](htt ## API Version -This documentation is for API version: `449` +This documentation is for API version: `483` !!! tip "API Schema History" We track API schema changes, and provide a snapshot of each API schema version in the [API schema repository](https://github.com/inventree/schema/). diff --git a/docs/docs/app/index.md b/docs/docs/app/index.md index f8cdb4992227..3d982e5b3773 100644 --- a/docs/docs/app/index.md +++ b/docs/docs/app/index.md @@ -2,10 +2,11 @@ title: InvenTree Mobile App --- +``` {% with directory="appgallery", per_page=2 %} {% include "carousel.html" %} {% endwith %} - +``` ----- The InvenTree Mobile App brings stock control to your pocket. Integrating seamlessly with the [InvenTree API](../api/index.md), the app provides immediate access to inventory data without requiring physical access to a computer. diff --git a/docs/docs/index.md b/docs/docs/index.md index be8f6aec6a06..4acf40a22c3d 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -14,11 +14,11 @@ It is designed to be lightweight and easy to use for SME or hobbyist application InvenTree is a [Python](https://www.python.org/) and [Django](https://www.djangoproject.com/) application which stores data in a relational database, and serves this data to the user(s) via a web browser, and (optionally) can be integrated into custom applications via an API. ------ - +``` {% with directory="indexgallery", per_page=1 %} {% include "carousel.html" %} {% endwith %} - +``` ------ ## Features diff --git a/docs/docs/report/helpers.md b/docs/docs/report/helpers.md index c8811f561ced..254b42079964 100644 --- a/docs/docs/report/helpers.md +++ b/docs/docs/report/helpers.md @@ -699,15 +699,12 @@ This returns a [Parameter](../concepts/parameters.md) object which contains the The following example assumes that you have a report or label which contains a valid [Part](../part/index.md) instance: ``` -{% raw %} {% load report %} {% parameter part "length" as length %} Part: {{ part.name }}
Length: {{ length.data }} [{{ length.units }}] - -{% endraw %} ``` A [Parameter](../concepts/parameters.md) has the following available attributes: diff --git a/docs/docs/start/advanced.md b/docs/docs/start/advanced.md index 9bacc83924fd..97b9abb4f4fc 100644 --- a/docs/docs/start/advanced.md +++ b/docs/docs/start/advanced.md @@ -25,7 +25,7 @@ The version information contains the following information extracted form the in | Platform | Yes | Linux-5.15.0-67-generic-x86_64 | instance | | Installer | Yes | PKG | environment: `INVENTREE_PKG_INSTALLER`, instance | | Target | No | ubuntu:20.04 | environment: `INVENTREE_PKG_TARGET` | -| Active plugins | Yes | [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}] | instance | +| Active plugins | Yes | `[{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}]` | instance | ### Installer codes diff --git a/docs/generated/.gitignore b/docs/generated/.gitignore deleted file mode 100644 index 72e8ffc0db8a..000000000000 --- a/docs/generated/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/docs/main.py b/docs/main.py index 148e61be65f3..f45860e759f8 100644 --- a/docs/main.py +++ b/docs/main.py @@ -30,8 +30,8 @@ 'READTHEDOCS_VERSION_NAME', 'READTHEDOCS_VERSION_TYPE', ]: - val = os.environ.get(key, None) or '-- MISSING --' - print(f' - {key}: {val}') + if val := os.environ.get(key, None): + print(f' - {key}: {val}') # Cached settings dict values global CONFIG_SETTINGS @@ -145,7 +145,7 @@ def get_build_environment() -> Optional[str]: def define_env(env): """Define custom environment variables for the documentation build process.""" - config = env.config + config = getattr(env, 'config', None) or {} assets_dir = config.get('assets_dir', None) if assets_dir is None: diff --git a/docs/requirements.in b/docs/requirements.in index 7e88513072fc..25e549bf2b2f 100644 --- a/docs/requirements.in +++ b/docs/requirements.in @@ -8,3 +8,4 @@ mkdocs-include-markdown-plugin neoteroi-mkdocs mkdocstrings[python]<=1.0.4,>=1.0.4 mkdocs-mermaid2-plugin +zensical>=0.0.40 diff --git a/docs/requirements.txt b/docs/requirements.txt index bd7e057613ed..15f466a62f26 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -176,10 +176,15 @@ click==8.3.2 \ # mkdocs # neoteroi-mkdocs # properdocs + # zensical colorama==0.4.6 \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 # via mkdocs-material +deepmerge==2.0 \ + --hash=sha256:5c3d86081fbebd04dd5de03626a0607b809a98fb6ccba5770b62466fe940ff20 \ + --hash=sha256:6de9ce507115cff0bed95ff0ce9ecc31088ef50cbdf09bc90a09349a318b3d00 + # via zensical editorconfig==0.17.1 \ --hash=sha256:1eda9c2c0db8c16dbd50111b710572a5e6de934e39772de1959d41f64fc17c82 \ --hash=sha256:23c08b00e8e08cc3adcddb825251c497478df1dada6aefeb01e626ad37303745 @@ -246,6 +251,7 @@ jinja2==3.1.6 \ # mkdocstrings # neoteroi-mkdocs # properdocs + # zensical jsbeautifier==1.15.4 \ --hash=sha256:5bb18d9efb9331d825735fbc5360ee8f1aac5e52780042803943aa7f854f7592 \ --hash=sha256:72f65de312a3f10900d7685557f84cb61a9733c50dcc27271a39f5b0051bf528 @@ -261,6 +267,7 @@ markdown==3.10.2 \ # mkdocstrings # properdocs # pymdown-extensions + # zensical markdown-it-py==4.0.0 \ --hash=sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147 \ --hash=sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3 @@ -480,6 +487,7 @@ pygments==2.20.0 \ # via # mkdocs-material # rich + # zensical pymdown-extensions==10.21.2 \ --hash=sha256:5c0fd2a2bea14eb39af8ff284f1066d898ab2187d81b889b75d46d4348c01638 \ --hash=sha256:c3f55a5b8a1d0edf6699e35dcbea71d978d34ff3fa79f3d807b8a5b3fa90fbdc @@ -487,6 +495,7 @@ pymdown-extensions==10.21.2 \ # mkdocs-material # mkdocs-mermaid2-plugin # mkdocstrings + # zensical python-dateutil==2.9.0.post0 \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 @@ -577,6 +586,7 @@ pyyaml==6.0.3 \ # properdocs # pymdown-extensions # pyyaml-env-tag + # zensical pyyaml-env-tag==1.1 \ --hash=sha256:17109e1a528561e32f026364712fee1264bc2ea6715120891174ed1b980d2e04 \ --hash=sha256:2eb38b75a2d21ee0475d6d97ec19c63287a7e140231e4214969d0eac923cd7ff @@ -624,6 +634,55 @@ termcolor==3.3.0 \ --hash=sha256:348871ca648ec6a9a983a13ab626c0acce02f515b9e1983332b17af7979521c5 \ --hash=sha256:cf642efadaf0a8ebbbf4bc7a31cec2f9b5f21a9f726f4ccbb08192c9c26f43a5 # via mkdocs-macros-plugin +tomli==2.4.1 \ + --hash=sha256:01f520d4f53ef97964a240a035ec2a869fe1a37dde002b57ebc4417a27ccd853 \ + --hash=sha256:0d85819802132122da43cb86656f8d1f8c6587d54ae7dcaf30e90533028b49fe \ + --hash=sha256:136443dbd7e1dee43c68ac2694fde36b2849865fa258d39bf822c10e8068eac5 \ + --hash=sha256:1d8591993e228b0c930c4bb0db464bdad97b3289fb981255d6c9a41aedc84b2d \ + --hash=sha256:2190f2e9dd7508d2a90ded5ed369255980a1bcdd58e52f7fe24b8162bf9fedbd \ + --hash=sha256:2c1c351919aca02858f740c6d33adea0c5deea37f9ecca1cc1ef9e884a619d26 \ + --hash=sha256:36d2bd2ad5fb9eaddba5226aa02c8ec3fa4f192631e347b3ed28186d43be6b54 \ + --hash=sha256:3d48a93ee1c9b79c04bb38772ee1b64dcf18ff43085896ea460ca8dec96f35f6 \ + --hash=sha256:47149d5bd38761ac8be13a84864bf0b7b70bc051806bc3669ab1cbc56216b23c \ + --hash=sha256:4ab97e64ccda8756376892c53a72bd1f964e519c77236368527f758fbc36a53a \ + --hash=sha256:4b605484e43cdc43f0954ddae319fb75f04cc10dd80d830540060ee7cd0243cd \ + --hash=sha256:504aa796fe0569bb43171066009ead363de03675276d2d121ac1a4572397870f \ + --hash=sha256:51529d40e3ca50046d7606fa99ce3956a617f9b36380da3b7f0dd3dd28e68cb5 \ + --hash=sha256:52c8ef851d9a240f11a88c003eacb03c31fc1c9c4ec64a99a0f922b93874fda9 \ + --hash=sha256:559db847dc486944896521f68d8190be1c9e719fced785720d2216fe7022b662 \ + --hash=sha256:5a881ab208c0baf688221f8cecc5401bd291d67e38a1ac884d6736cbcd8247e9 \ + --hash=sha256:5cb41aa38891e073ee49d55fbc7839cfdb2bc0e600add13874d048c94aadddd1 \ + --hash=sha256:5e262d41726bc187e69af7825504c933b6794dc3fbd5945e41a79bb14c31f585 \ + --hash=sha256:5ee18d9ebdb417e384b58fe414e8d6af9f4e7a0ae761519fb50f721de398dd4e \ + --hash=sha256:7008df2e7655c495dd12d2a4ad038ff878d4ca4b81fccaf82b714e07eae4402c \ + --hash=sha256:734e20b57ba95624ecf1841e72b53f6e186355e216e5412de414e3c51e5e3c41 \ + --hash=sha256:7c7e1a961a0b2f2472c1ac5b69affa0ae1132c39adcb67aba98568702b9cc23f \ + --hash=sha256:7f86fd587c4ed9dd76f318225e7d9b29cfc5a9d43de44e5754db8d1128487085 \ + --hash=sha256:7f94b27a62cfad8496c8d2513e1a222dd446f095fca8987fceef261225538a15 \ + --hash=sha256:88dceee75c2c63af144e456745e10101eb67361050196b0b6af5d717254dddf7 \ + --hash=sha256:8a650c2dbafa08d42e51ba0b62740dae4ecb9338eefa093aa5c78ceb546fcd5c \ + --hash=sha256:8d65a2fbf9d2f8352685bc1364177ee3923d6baf5e7f43ea4959d7d8bc326a36 \ + --hash=sha256:96481a5786729fd470164b47cdb3e0e58062a496f455ee41b4403be77cb5a076 \ + --hash=sha256:a120733b01c45e9a0c34aeef92bf0cf1d56cfe81ed9d47d562f9ed591a9828ac \ + --hash=sha256:b1d22e6e9387bf4739fbe23bfa80e93f6b0373a7f1b96c6227c32bef95a4d7a8 \ + --hash=sha256:b8c198f8c1805dc42708689ed6864951fd2494f924149d3e4bce7710f8eb5232 \ + --hash=sha256:c2541745709bad0264b7d4705ad453b76ccd191e64aa6f0fc66b69a293a45ece \ + --hash=sha256:c742f741d58a28940ce01d58f0ab2ea3ced8b12402f162f4d534dfe18ba1cd6a \ + --hash=sha256:c7f2c7f2b9ca6bdeef8f0fa897f8e05085923eb091721675170254cbc5b02897 \ + --hash=sha256:d312ef37c91508b0ab2cee7da26ec0b3ed2f03ce12bd87a588d771ae15dcf82d \ + --hash=sha256:d4d8fe59808a54658fcc0160ecfb1b30f9089906c50b23bcb4c69eddc19ec2b4 \ + --hash=sha256:da25dc3563bff5965356133435b757a795a17b17d01dbc0f42fb32447ddfd917 \ + --hash=sha256:eab21f45c7f66c13f2a9e0e1535309cee140182a9cdae1e041d02e47291e8396 \ + --hash=sha256:eb0dc4e38e6a1fd579e5d50369aa2e10acfc9cace504579b2faabb478e76941a \ + --hash=sha256:ec9bfaf3ad2df51ace80688143a6a4ebc09a248f6ff781a9945e51937008fcbc \ + --hash=sha256:ede3e6487c5ef5d28634ba3f31f989030ad6af71edfb0055cbbd14189ff240ba \ + --hash=sha256:f3c6818a1a86dd6dca7ddcaaf76947d5ba31aecc28cb1b67009a5877c9a64f3f \ + --hash=sha256:f758f1b9299d059cc3f6546ae2af89670cb1c4d48ea29c3cacc4fe7de3058257 \ + --hash=sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30 \ + --hash=sha256:fd0409a3653af6c147209d267a0e4243f0ae46b011aa978b1080359fddc9b6cf \ + --hash=sha256:ff18e6a727ee0ab0388507b89d1bc6a22b138d1e2fa56d1ad494586d61d2eae9 \ + --hash=sha256:ff2983983d34813c1aeb0fa89091e76c3a22889ee83ab27c5eeb45100560c049 + # via zensical typing-extensions==4.15.0 \ --hash=sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466 \ --hash=sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548 @@ -675,3 +734,18 @@ wcmatch==10.1 \ --hash=sha256:5848ace7dbb0476e5e55ab63c6bbd529745089343427caa5537f230cc01beb8a \ --hash=sha256:f11f94208c8c8484a16f4f48638a85d771d9513f4ab3f37595978801cb9465af # via mkdocs-include-markdown-plugin +zensical==0.0.40 \ + --hash=sha256:045bdcb6d00a11ddcab7d379d0d986cdf78dba8e9287d8e628ef11958241507d \ + --hash=sha256:168fe3489dd93ae92978b4db11d9300c63e10d382b81634232c2872ce9e746c2 \ + --hash=sha256:39bf728a68a5418feeda8f3385cd1063fdb8d896a6812c3dede4267b2868df12 \ + --hash=sha256:48c38e0ae314c25f2e5e64210bbad9be6e970f2d40fe9da106586ad90ce5e85e \ + --hash=sha256:5c294751977a664614cb84e987186ad8e282af77ce0d0d800fe48ee57791279d \ + --hash=sha256:7101ba0c739c78bc3a57d22130b59b9e6fdf96c21c8a6b4244070de6b34527d4 \ + --hash=sha256:8652ba203bd588ebf2d66bda4457a4a7d8e193c886960859c75081c0e3b946de \ + --hash=sha256:9ffa6cf208b7ab6b771703be827d4d8c7f07f173abeffb35a8015a0b832b2a40 \ + --hash=sha256:b65a7143c9c6a460880bf3e65b777952bd2dcede9dd17a6c6bac9b4a0686ad9b \ + --hash=sha256:bc750c3ba8d11833d9b9ac8fc14adc3435225b6d17314a21a91eb60209511ca5 \ + --hash=sha256:c5c86ac468df2dfe515ff54ffa97725c38226f1e5c970059b7e88078abab89ab \ + --hash=sha256:d48ec476c2e8ce3f8585a1278083aabc35ec80361f2c4fc4a53b9a525778f7fc \ + --hash=sha256:f25f62dcd61f6306cab890dfa34c81d2709f5db290b4c3f2675343771db28c90 + # via -r docs/requirements.in diff --git a/src/backend/InvenTree/plugin/plugin.py b/src/backend/InvenTree/plugin/plugin.py index 1e9518cc9912..a7ed8d898d40 100644 --- a/src/backend/InvenTree/plugin/plugin.py +++ b/src/backend/InvenTree/plugin/plugin.py @@ -97,7 +97,7 @@ class MetaBase: def get_meta_value(self, key: str, old_key: Optional[str] = None, default=None): """Reference a meta item with a key. - Args: + Arguments: key (str): key for the value old_key (str, optional): deprecated key - will throw warning default (optional): Value if nothing with key can be found. Defaults to None. diff --git a/tasks.py b/tasks.py index 23470bf1864e..7058be8d71c9 100644 --- a/tasks.py +++ b/tasks.py @@ -2308,6 +2308,7 @@ def doc_schema(c): @task( help={ 'address': 'Host and port to run the server on (default: localhost:8080)', + 'open': 'Automatically open the documentation in a web browser (default: False)', 'compile_schema': 'Compile the API schema documentation first (default: False)', 'export_settings': 'Export settings definitions before starting the server (default: True)', } @@ -2315,10 +2316,11 @@ def doc_schema(c): def docs_server( c, address='localhost:8080', + open: bool = False, compile_schema: bool = False, export_settings: bool = True, ): - """Start a local mkdocs server to view the documentation.""" + """Start a local zensical server to view the documentation.""" # Extract settings definitions if export_settings: export_definitions(c, basedir='docs') @@ -2326,23 +2328,35 @@ def docs_server( if compile_schema: doc_schema(c) - run(c, f'mkdocs serve -a {address} -f docs/mkdocs.yml') + cmd = f'zensical serve -a {address} -f docs/mkdocs.yml' + + if open: + cmd += ' --open' + + run(c, cmd) @task( - help={'mkdocs': 'Build the documentation using mkdocs at the end (default: False)'} + help={ + 'zensical': 'Build the documentation using zensical at the end (default: False)' + } ) -def build_docs(c, mkdocs=False): - """Build the required documents for building the docs. Optionally build the documentation using mkdocs.""" +def build_docs( + c, definitions: bool = True, strict: bool = True, zensical: bool = False +): + """Build the required documents for building the docs. Optionally build the documentation using zensical.""" migrate(c) export_definitions(c, basedir='docs') doc_schema(c) - if mkdocs: - run(c, 'mkdocs build -f docs/mkdocs.yml') + if zensical: + cmd = 'zensical build' + if strict: + cmd += ' --strict' + run(c, cmd) info('Documentation build complete') else: - info('Documentation build complete, but mkdocs not requested') + info('Documentation build complete, but zensical not requested') @task diff --git a/zensical.toml b/zensical.toml new file mode 100644 index 000000000000..3b10cb6ad214 --- /dev/null +++ b/zensical.toml @@ -0,0 +1,64 @@ +[project] +repo_url = "https://github.com/inventree/inventree" +repo_name = "inventree/inventree" +site_name = "InvenTree Documentation" +site_url = "https://docs.inventree.org" +site_description = "InvenTree - Open Source Inventory Management" +site_author = "InvenTree Developers" +docs_dir = "docs/docs" +site_dir = "docs/site" + +[project.theme] +variant = "classic" +language = "en" +features = [ + "navigation.expand", + "navigation.instant", + "navigation.instant.progress", + "navigation.path", + "navigation.tabs", + "navigation.tabs.sticky", + "navigation.tracking", + "navigation.top", + "search.highlight", + "toc.follow", + "toc.integrate", +] + +[project.theme.palette] +scheme = "default" + +[project.markdown_extensions.admonition] +[project.markdown_extensions.md_in_html] +[project.markdown_extensions.tables] +[project.markdown_extensions.pymdownx.keys] +[project.markdown_extensions.zensical.extensions.macros] + +[project.markdown_extensions.toc] +permalink = true + +[project.plugins.mkdocstrings.handlers.python] +inventories = ["https://docs.python.org/3/objects.inv"] +paths = ["src/backend/InvenTree"] + +[project.plugins.mkdocstrings.handlers.python.options] +docstring_style = "google" +inherited_members = true +show_source = false + +[project.validation] +unresolved_references = true +unresolved_footnotes = true +unused_definitions = true +unused_footnotes = true +shadowed_definitions = true +shadowed_footnotes = true +invalid_links = true +invalid_link_anchors = true + +[project.extra] +generator = false + +[project.extra.social] +icon = "fontawesome/brands/github" +link = "https://github.com/inventree/inventree"