Skip to content

Commit

Permalink
doc: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sfermigier committed Nov 28, 2023
1 parent 9fcb81d commit 4dc1f28
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ repos:
- id: trailing-whitespace
# Misc Python
- id: debug-statements
- id: check-docstring-first
- id: forbid-new-submodules
args: ['--allow-missing-credentials']
- id: fix-encoding-pragma
args: ['--remove']
# - id: check-docstring-first
# - id: name-tests-test
# - id: no-commit-to-branch
# - id: requirements-txt-fixer
Expand Down
4 changes: 2 additions & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ src/dev/orchestrator.md: ../nua_orchestrator_local/README.md
cp ../nua_orchestrator_local/README.md src/dev/orchestrator.md

run: $(src)
./scripts/gen-api.py
python ./scripts/gen-api.py
mkdocs serve

build: $(src)
./scripts/gen-api.py
python ./scripts/gen-api.py
mkdocs build
cp -a src/.well-known site/
cp -a assets/root/* site/
Expand Down
9 changes: 6 additions & 3 deletions doc/scripts/gen-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class Generator:

def __post_init__(self):
self.root_dir = Path("..") / self.source / "src"
self.output = (Path("src") / "dev" / "api" / f"{self.source}.md").open("w")
self.output = []
self.output_file = (Path("src") / "dev" / "api" / f"{self.source}.md").open("w")

def generate_spi(self):
"""Generate API documentation."""
Expand All @@ -39,8 +40,10 @@ def generate_spi(self):
self.print(f"::: {module_name}")
self.print()

def print(self, *args, **kwargs):
print(*args, **kwargs, file=self.output)
self.output_file.write("\n".join(self.output).strip() + "\n")

def print(self, *args):
self.output.append(" ".join(args))


def main():
Expand Down
7 changes: 7 additions & 0 deletions nua-lib/src/nua/lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@

# In the container:
NUA_BUILD_PATH = "/nua/build"
"""The directory where the application is built."""

NUA_APP_PATH = "/nua/app"
"""The directory where the application is installed."""

NUA_METADATA_PATH = "/nua/metadata"
"""The directory where the application metadata is stored."""

NUA_SCRIPTS_PATH = "/nua/scripts"
"""The directory where the operation and maintenance scripts are stored."""


def nua_config_names():
Expand Down

0 comments on commit 4dc1f28

Please sign in to comment.