2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-04 04:30:56 +00:00
Files
.devcontainer
.devops
.github
.vscode
InvenTree
ci
contrib
deploy
docker
docs
_includes
ci
docs
.gitignore
LICENSE
README.md
__init__.py
main.py
mkdocs.yml
requirements.txt
images
src
.djlintrc
.eslintrc.yml
.gitattributes
.gitignore
.pkgr.yml
.pre-commit-config.yaml
CONTRIBUTING.md
Dockerfile
LICENSE
Procfile
README.md
RELEASE.md
SECURITY.md
backportrc.json
crowdin.yml
docker-compose.yml
docker.dev.env
package-lock.json
package.json
readthedocs.yml
requirements-dev.in
requirements-dev.txt
requirements.in
requirements.txt
runtime.txt
setup.cfg
tasks.py
yarn.lock
InvenTree/docs/main.py
Matthias Mair abee2cee88 Code style improvements ()
* fix list comps

* mopre comp fixes

* reduce computing cost on any() calls

* add bugbear

* check for clean imports

* only allow limited relative imports

* fix notification method lookup

* fix notification method assigement

* rewrite assigment

* fix upstream changes to new style

* fix upstream change to new coding style
2023-04-28 20:49:53 +10:00

30 lines
686 B
Python

"""Main entry point for the documentation build process"""
import os
def define_env(env):
"""Define custom environment variables for the documentation build process"""
@env.macro
def listimages(subdir):
"""Return a listing of all asset files in the provided subdir"""
here = os.path.dirname(__file__)
directory = os.path.join(here, 'docs', 'assets', 'images', subdir)
assets = []
allowed = [
'.png',
'.jpg',
]
for asset in os.listdir(directory):
if any(asset.endswith(x) for x in allowed):
assets.append(os.path.join(subdir, asset))
return assets