Skip to content

Commit fc7edac

Browse files
committed
PR feedback
Remove old template dir Drop system-ops and system-facts Add pydantic to docs/metadata.py Move docs/metadata to pyinfra.api.metadata need to fix docs generation error for missing jinja2 vars Fix linting and only render subset of docs as jinja2 Update python3 -m http.server command in build-public-docs.sh
1 parent 297a88e commit fc7edac

File tree

7 files changed

+204
-144
lines changed

7 files changed

+204
-144
lines changed

docs/conf.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
import os
2-
import sys
31
from datetime import date
42
from os import environ, mkdir, path
53
from shutil import rmtree
64

75
import guzzle_sphinx_theme
86

97
from pyinfra import __version__, local
10-
11-
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
12-
import metadata # noqa # this is a local module
8+
from pyinfra.api import metadata
139

1410
copyright = "Nick Barrett {0} — pyinfra v{1}".format(
1511
date.today().year,
@@ -64,14 +60,17 @@
6460

6561
def rstjinja(app, docname, source):
6662
"""
67-
Render our pages as a jinja template for fancy templating goodness.
63+
Render certain pages as a jinja templates.
6864
"""
6965
# this should only be run when building html
7066
if app.builder.format != "html":
7167
return
72-
src = source[0]
73-
rendered = app.builder.templates.render_string(src, app.config.html_context)
74-
source[0] = rendered
68+
# We currently only render docs/operations.rst
69+
# and docs/facts.rst as jinja2 templates
70+
if docname in ["operations", "facts"]:
71+
src = source[0]
72+
rendered = app.builder.templates.render_string(src, app.config.html_context)
73+
source[0] = rendered
7574

7675

7776
def setup(app):

0 commit comments

Comments
 (0)