Skip to content

Commit

Permalink
feat: Display the authors of a TechDocs file
Browse files Browse the repository at this point in the history
  • Loading branch information
nhhagen committed Jun 17, 2024
1 parent d2ef81c commit 5c3530c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions images/techdocs/context/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ mkdocs.yml: /usr/local/share/techdocs/mkdocs.yml

.PHONY: build
build: mkdocs.yml ## Build the website
export SITE_NAME="$(SITE_NAME)" && export REPO_NAME=$(REPO_NAME) export REPO_URL=$(REPO_URL) && export EDIT_URI=$(EDIT_URI) && techdocs-cli generate --no-docker
export SITE_NAME="$(SITE_NAME)" && export REPO_NAME=$(REPO_NAME) export REPO_URL=$(REPO_URL) && export EDIT_URI=$(EDIT_URI) && export AUTHORS=$(AUTHORS) && techdocs-cli generate --no-docker

ENTITY := $(shell yq --no-doc 'select(document_index == 0) | [.metadata.namespace // "default", .kind, .metadata.name] | join("/")' ./catalog-info.yaml)

serve: mkdocs.yml ## Run a preview site
export SITE_NAME="$(SITE_NAME)" && export REPO_NAME=$(REPO_NAME) export REPO_URL=$(REPO_URL) && export EDIT_URI=$(EDIT_URI) && techdocs-cli serve --no-docker
export SITE_NAME="$(SITE_NAME)" && export REPO_NAME=$(REPO_NAME) export REPO_URL=$(REPO_URL) && export EDIT_URI=$(EDIT_URI) && export AUTHORS=$(AUTHORS) && techdocs-cli serve --no-docker

.PHONY: publish
publish: site ## Publish the website to the TechDocs Bucket
Expand Down
4 changes: 4 additions & 0 deletions images/techdocs/context/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ repo_url: !ENV [REPO_URL, null]
edit_uri: !ENV [EDIT_URI, null]
plugins:
- techdocs-core
- git-committers:
enabled: !ENV [AUTHORS, true]
repository: !ENV REPO_NAME
branch: main
- htmlproofer:
validate_external_urls: false
- git-revision-date-localized:
Expand Down
1 change: 1 addition & 0 deletions images/techdocs/context/requirements-techdocs.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mkdocs-awesome-pages-plugin==2.9.2
mkdocs-ezlinks-plugin==0.1.14
mkdocs-git-committers-plugin-2==0.3.0
mkdocs-git-revision-date-localized-plugin==1.2.6
mkdocs-htmlproofer-plugin==1.2.1
mkdocs-kroki-plugin==0.8.0
Expand Down
10 changes: 9 additions & 1 deletion images/techdocs/context/requirements-techdocs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ gitdb==4.0.11 \
gitpython==3.1.43 \
--hash=sha256:35f314a9f878467f5453cc1fee295c3e18e52f1b99f10f6cf5b1682e968a9e7c \
--hash=sha256:eec7ec56b92aad751f9912a73404bc02ba212a23adb2c7098ee668417051a1ff
# via mkdocs-git-revision-date-localized-plugin
# via
# mkdocs-git-committers-plugin-2
# mkdocs-git-revision-date-localized-plugin
idna==3.7 \
--hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \
--hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0
Expand Down Expand Up @@ -239,6 +241,7 @@ mkdocs==1.5.3 \
# via
# mkdocs-awesome-pages-plugin
# mkdocs-ezlinks-plugin
# mkdocs-git-committers-plugin-2
# mkdocs-git-revision-date-localized-plugin
# mkdocs-htmlproofer-plugin
# mkdocs-kroki-plugin
Expand All @@ -254,6 +257,10 @@ mkdocs-awesome-pages-plugin==2.9.2 \
mkdocs-ezlinks-plugin==0.1.14 \
--hash=sha256:3e2085c16a850e022393e80194c17612e7b55de87fb45b3ffb618b5dfdb10811
# via -r requirements-techdocs.in
mkdocs-git-committers-plugin-2==0.3.0 \
--hash=sha256:53e8ad142f4da2601ad676847fd0fcf00924fb778e61d2d559f6ce89add8b663 \
--hash=sha256:6aed7b3fee1da445799da4340ae8cf5bc71b43357f177119b0c447b8dca022d8
# via -r requirements-techdocs.in
mkdocs-git-revision-date-localized-plugin==1.2.6 \
--hash=sha256:e432942ce4ee8aa9b9f4493e993dee9d2cc08b3ea2b40a3d6b03ca0f2a4bcaa2 \
--hash=sha256:f015cb0f3894a39b33447b18e270ae391c4e25275cac5a626e80b243784e2692
Expand Down Expand Up @@ -572,6 +579,7 @@ requests==2.32.0 \
--hash=sha256:f2c3881dddb70d056c5bd7600a4fae312b2a300e39be6a118d30b90bd27262b5 \
--hash=sha256:fa5490319474c82ef1d2c9bc459d3652e3ae4ef4c4ebdd18a21145a47ca4b6b8
# via
# mkdocs-git-committers-plugin-2
# mkdocs-htmlproofer-plugin
# mkdocs-kroki-plugin
# mkdocs-material
Expand Down
2 changes: 1 addition & 1 deletion images/techdocs/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def test_build(
) -> None:
actual_output = docker_client.containers.run(
build_image.id,
command='build REPO_NAME=example/test REPO_URL="http://github.com/example/test" EDIT_URL="edit/main/docs"',
command='build REPO_NAME=example/test REPO_URL="http://github.com/example/test" EDIT_URL="edit/main/docs" AUTHORS=false',
volumes=volumes,
remove=True,
)
Expand Down

0 comments on commit 5c3530c

Please sign in to comment.