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 Apr 16, 2024
1 parent 85017c1 commit 64d2fdb
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.4
mkdocs-htmlproofer-plugin==1.2.0
mkdocs-kroki-plugin==0.7.1
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 @@ -238,6 +240,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 @@ -252,6 +255,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.4 \
--hash=sha256:08fd0c6f33c8da9e00daf40f7865943113b3879a1c621b2bbf0fa794ffe997d3 \
--hash=sha256:1f94eb510862ef94e982a2910404fa17a1657ecf29f45a07b0f438c00767fc85
Expand Down Expand Up @@ -566,6 +573,7 @@ requests==2.31.0 \
--hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \
--hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1
# 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 64d2fdb

Please sign in to comment.