-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor makefile and docs appendix
Signed-off-by: tarilabs <[email protected]>
- Loading branch information
Showing
11 changed files
with
133 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
|
||
.PHONY: install | ||
install: | ||
poetry install | ||
|
||
.PHONY: gen-docs | ||
gen-docs: install | ||
poetry run python docs/appendixes/gen-appendix-links.py docs/ | ||
|
||
.PHONY: docs-live | ||
docs-live: | ||
docs-live: gen-docs | ||
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material | ||
|
||
.PHONY: docs-build | ||
docs-build: gen-docs | ||
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material build | ||
|
||
.PHONY: build | ||
build: install | ||
poetry build | ||
|
||
.PHONY: test | ||
test: | ||
poetry run pytest -s -x -rA | ||
|
||
.PHONY: test-e2e | ||
test-e2e: | ||
poetry run pytest --e2e -s -x -rA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- this file is generated by toolings --> | ||
# Appendix "All links" | ||
This is a collection of all the links from this website: | ||
|
||
- https://docs.sigstore.dev/ | ||
- https://github.com/kubeflow/community/pull/682#issuecomment-2130072374 | ||
- https://github.com/kubernetes/enhancements/pull/4639 | ||
- https://github.com/lampajr/oci-storage-initializer/blob/main/GET_STARTED.md | ||
- https://github.com/opencontainers/image-spec/blob/main/manifest.md#guidelines-for-artifact-usage | ||
- https://www.cncf.io/projects/confidential-containers | ||
- https://www.kubeflow.org/docs/components/model-registry | ||
- https://www.openpolicyagent.org/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from markdown_it.tree import SyntaxTreeNode | ||
from markdown_it import MarkdownIt | ||
|
||
import os | ||
import fnmatch | ||
import click | ||
|
||
@click.command() | ||
@click.argument('dir', required=True) | ||
def parse_markdown_files(dir): | ||
all_href = get_all_hrefs(dir) | ||
with open(f"{dir}/appendixes/appendix-links.md", "w") as appendix: | ||
appendix.write("""<!-- this file is generated by toolings --> | ||
# Appendix "All links" | ||
This is a collection of all the links from this website: | ||
""" | ||
) | ||
for e in all_href: | ||
appendix.write(f"- {e}\n") | ||
appendix.write("\n") | ||
|
||
def get_all_hrefs(dir): | ||
md = MarkdownIt("commonmark") | ||
all_href = [] | ||
for root, _, files in os.walk(dir): | ||
for filename in fnmatch.filter(files, '*.md'): | ||
if filename == "appendix-links.md": | ||
continue # skip appendix-links file itself | ||
with open(f"{root}/{filename}", "r") as f: | ||
tokens = md.parse(f.read()) | ||
node = SyntaxTreeNode(tokens) | ||
for n in node.walk(): | ||
if n.type == "link": | ||
all_href.append(n.attrs["href"]) | ||
all_href.sort() | ||
print(all_href) | ||
return all_href | ||
|
||
if __name__ == '__main__': | ||
parse_markdown_files() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters