Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test
on:
push:
branches:
- "**"
pull_request:
workflow_dispatch:
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: ~/.cache
restore-keys: |
mkdocs-material-
- run: pip install -r requirements.txt
- run: mkdocs build --strict
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
__pycache__/
.venv/

site

# IDE / Editor
.vscode/
.idea/
Expand Down
2 changes: 1 addition & 1 deletion docs/content/getting-started/mod-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dependencies {

Modの起点となるメインクラスです。

[#Modクラス](../component/mod.md) で詳しく解説しています。
<!-- NOTE: Modクラス解説を追加 -->

## mods.toml

Expand Down
13 changes: 10 additions & 3 deletions hooks/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ def on_page_markdown(markdown, page, **kwargs):
path = page.file.src_uri

for annotation in ANNOTATIONS:
for m in re.finditer(f'({annotation}): ?(.*)', markdown):
log.warning(f"Doc file '{path}' contains {annotation}: {m[0]}")

for m in re.finditer(f'<!-- ({annotation}): ?(.*) -->', markdown):
text = f"Doc file '{path}' contains {annotation}: {m[2]}"

if(annotation == "NOTE"):
log.info(text)
print(f"::notice title=mkdocs::{text}")
continue

log.warning(text)
print(f"::warning title=mkdocs::{text}")
Loading