Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull from template #34

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
55b7e8d
remove supported apps page
CallumWalley Sep 19, 2024
27acdef
Add pymarkdown extensions to requirements
CallumWalley Sep 20, 2024
127821e
remove pymdown-extensions
CallumWalley Sep 20, 2024
eed4c37
consolidated and simplified somew stylesheets
CallumWalley Sep 23, 2024
3b89aa7
add prose and spellcheck config
CallumWalley Sep 23, 2024
4cc6884
Some improvements to problem matcher, added test fail file.
CallumWalley Sep 25, 2024
328a2a5
added extra catch to meta check
CallumWalley Sep 25, 2024
14090d8
Merge pull request #1 from nesi/advisory-heron
CallumWalley Sep 25, 2024
5a0046a
Remove fetch includes as that only really needed in support docs.
CallumWalley Sep 27, 2024
59202d2
Updated some stuff around dictionary updating
CallumWalley Sep 27, 2024
4a0596d
Demo deploy should work now
CallumWalley Sep 27, 2024
73a00da
Merge pull request #2 from nesi/advisory-heron
CallumWalley Sep 27, 2024
afa5c1d
Test PR
CallumWalley Sep 27, 2024
2129b9f
Update demo_deploy.yml
CallumWalley Sep 27, 2024
f6ecd01
trigger
CallumWalley Sep 27, 2024
13e81af
Update demo_deploy.yml
CallumWalley Sep 27, 2024
ecb4738
Update demo_deploy.yml
CallumWalley Sep 27, 2024
9ae6502
Merge branch 'main' into CallumWalley-patch-1
CallumWalley Sep 27, 2024
3599831
Oops no payload
CallumWalley Sep 27, 2024
0dad978
Merge pull request #4 from nesi/mergymere
CallumWalley Sep 27, 2024
7cb15e4
Merge pull request #3 from nesi/CallumWalley-patch-1
CallumWalley Sep 27, 2024
3a49693
Delete TODO.md
CallumWalley Sep 27, 2024
aaa3b7c
Update demo_deploy.yml
CallumWalley Sep 27, 2024
69bb22e
Delete SETUP.md
CallumWalley Sep 27, 2024
0677479
Update demo_deploy.yml
CallumWalley Sep 27, 2024
e51da16
Update README.md
CallumWalley Sep 27, 2024
727e9ef
Return to working
CallumWalley Sep 27, 2024
442c189
Delete overrides/partials/.gitkeep
CallumWalley Sep 27, 2024
0a37d78
Merge pull request #5 from nesi/no-todo
CallumWalley Sep 27, 2024
d78895b
remove comments
CallumWalley Sep 27, 2024
984a942
Fix commented out catch block
CallumWalley Sep 27, 2024
bf73d1c
Merge pull request #6 from nesi/advisory-heron
CallumWalley Sep 27, 2024
4dd58ab
Update from upstream again
CallumWalley Sep 27, 2024
b0452b4
Uneeded change
CallumWalley Sep 27, 2024
181e7bb
remove debug line
CallumWalley Sep 27, 2024
86e78b9
Merge remote-tracking branch 'template/main' into pull-from-template
CallumWalley Sep 27, 2024
10b5a06
uneeded change
CallumWalley Sep 27, 2024
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
78 changes: 78 additions & 0 deletions .github/workflows/demo_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Deploy PR branches
on:
pull_request:
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TARGET_REPO: "mkdocs-demo-deploy"
TARGET_OWNER: "CallumWalley"
WORKFLOW_ID: "deploy.yml"
DEPLOY_URL: "https://callumwalley.github.io/mkdocs-demo-deploy"
HEAD: ${{ github.event.pull_request.head.ref }}
permissions: write-all
jobs:
demo-deploy:
continue-on-error: true
name: Trigger test deployments
runs-on: ubuntu-latest
steps:
- name: Trigger Workflow in Another Repository
run: |
set -x
set -o xtrace
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/dispatches \
-d "{\"event_type\":\"deploy\",\"client_payload\":{\"targets\":\"${GITHUB_REPOSITORY}:${HEAD}\", \"use-cache\":\"true\"}}"

# This would be better if it worked
# - name: Run 'deploy.yml' Workflow
# uses: convictional/[email protected]
# with:
# owner: ${TARGET_OWNER}
# repo: ${TARGET_REPO}
# github_token: ${{ secrets.PAT }}
# workflow_file_name: deploy.yml
# client_payload: '{"targets":"${GITHUB_REPOSITORY}:${HEAD}", "use-cache":"true"}'
- name: Wait for Workflow Action
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/actions/runs/deploy.yml
- name: Wait for Workflow Action
run: |
# Just give a minute or so to deploy
sleep 60
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Post messages open requests
run: |
msg="Test deployment available at <a href=\"${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}\">${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}</a>"
changed_pages="$(git diff --name-only origin/main -- '*.md')"
# Logic for truncating out long sections commented out.
# maxlines=-5
if [ -n "${changed_pages}" ]; then
msg="${msg}<br><br>Seems the following pages differ;<br><ul>"
for f in ${changed_pages};do
# maxlines=((maxlines+1))
#if [ ${maxlines} -lt 1 ]; then
g=${f#*/}; h=${g%.*}
msg="${msg}<li><a href=\"${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}/${h}\" target=_blank>${h##*/}</a></li>"
#fi
done
# if [ ${maxlines} -gt 0 ];then
# msg="${msg}<li> ... and ${maxlines} more.</li>"
# fi
msg="${msg}</ul>"
fi
msg="${msg}<br><br><em><a href="${DEPLOY_URL}">See all deployed demo sites</a></em>"
(gh pr comment ${HEAD} --edit-last --body "${msg}") || (gh pr comment ${HEAD} --body "${msg}")
echo "::info title=Deploy successful::${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}"
12 changes: 0 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ on:
push:
branches: [main]
workflow_dispatch:
# inputs:
# pr-deploy:
# description: Deploy open merge requests in sub-directories.
# type: boolean
# default: true
env:
PYTHON_VERSION: 3.x
GH_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -62,10 +57,3 @@ jobs:
with:
key: mkdocs-${{ hashfiles('.cache/**') }}
path: .cache
# - name: Post messages to PRs
# run: |
# for pr in ${{ steps.dev-deps.outputs.branches }}; do
# msg="Test deployment available at <a href=\"https://docs.nesi.org.nz/${pr}\">https://docs.nesi.org.nz/${pr}</a>"
# (gh pr comment ${pr} --edit-last --body "${msg}") || (gh pr comment ${pr} --body "${msg}")
# done

3 changes: 2 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"column": 4,
"endLine": 5,
"message": 7,
"loop": true
},
"owner": "proselint",
"fileLocation": "autoDetect",
Expand Down Expand Up @@ -94,7 +95,7 @@
"column": 4,
"endColumn": 5,
"line": 6,
"message": 7
"message": 7,
},
"owner": "test-build",
"fileLocation": [
Expand Down
6 changes: 6 additions & 0 deletions checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Spellcheck pipeline settings can be modified in [.spellcheck.yml](../.spellcheck
List of custom words can be found in [dictionary.txt](../docs/assets/glossary/dictionary.txt),
however you **should not edit this manually**, see [adding-words-to-dictionary](../docs/CONTRIBUTING.md#adding-words-to-dictionary).

This list is automatically updated daily in the case of docs.nesi, but not the other sites.
You should occasionally run
`wget -O docs/assets/glossary/dictionary.txt https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/dictionary.txt`
to keep it up to date.


### Limitations

Spellchecker does not provide output lineumber / column.
Expand Down
36 changes: 20 additions & 16 deletions checks/run_meta_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def _run_check(f):
for r in f():
print(f"::{r.get('level', 'warning')} file={input_path},title={f.__name__},col={r.get('col', 0)},endColumn={r.get('endColumn', 99)},line={r.get('line', 1)}::{r.get('message', 'something wrong')}")
sys.stdout.flush()
time.sleep(0.01)



def _title_from_filename():
Expand Down Expand Up @@ -136,26 +138,29 @@ def _unpack(toc, a):
return toc[a[0]]
return _unpack(toc[a[0]]["children"], a[1:])

if in_code_block:
return
try:
if in_code_block:
return

header_match = re.match(r"^(#+)\s*(.*)$", line)
header_match = re.match(r"^(#+)\s*(.*)$", line)

if not header_match:
return

header_level = len(header_match.group(1))
header_name = header_match.group(2)
if not header_match:
return
header_level = len(header_match.group(1))
header_name = header_match.group(2)

if header_level == 1:
toc = {header_name: {"lineno": lineno, "children": {}}}
toc_parents = [header_name]
if header_level == 1:
toc = {header_name: {"lineno": lineno, "children": {}}}
toc_parents = [header_name]

while header_level < len(toc_parents)+1:
toc_parents.pop(-1)
while header_level < len(toc_parents)+1:
toc_parents.pop(-1)

_unpack(toc, toc_parents)["children"][header_name] = {"level": header_level, "lineno": lineno, "children": {}}
toc_parents += [header_name]
_unpack(toc, toc_parents)["children"][header_name] = {"level": header_level, "lineno": lineno, "children": {}}
toc_parents += [header_name]
except Exception:
print(f"::error file={input_path},title=misc-nav,col=0,endColumn=0,line=1 ::Failed to parse Nav tree. Something is wrong.")


def _nav_check():
Expand Down Expand Up @@ -268,4 +273,3 @@ def _count_children(d):

# FIXME terrible hack to make VSCode in codespace capture the error messages
# see https://github.com/microsoft/vscode/issues/92868 as a tentative explanation
time.sleep(5)
5 changes: 4 additions & 1 deletion checks/run_proselint.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import sys
from pathlib import Path
import time

import proselint
from proselint import config, tools
Expand All @@ -22,10 +23,12 @@
for file in files:
print(f"Running proselint on {file}")
content = Path(file).read_text(encoding="utf8")
fails = proselint.tools.lint(content, config=config_custom)
for notice in proselint.tools.lint(content, config=config_custom):
print(
f"::{notice[7]} file={file},line={notice[2]+1},"
f"col={notice[3]+2},endColumn={notice[2]+notice[6]+1},"
f"title={notice[0]}::'{notice[1]}'",
flush=True,
flush=True
)
time.sleep(0.01)
13 changes: 12 additions & 1 deletion checks/run_test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
import logging
import sys
import re
import time


"""
This doesnt work and I have no idea why.
This works but is a bit messy
"""


def parse_macro(record):

# These are not useful messages
Expand All @@ -29,6 +32,13 @@ def parse_macro(record):
record.name = g["title"]
record.filename = g["file"]
record.msg = g["message"]

# Does not give correct path to file in question in 'title'.
# Infer from message.
m = re.search(r"'(.*?\.md)'", record.msg)
if m:
record.filename = m.group(1)

return True


Expand All @@ -42,3 +52,4 @@ def parse_macro(record):
log.addHandler(sh)
config = load_config(config_file_path="./mkdocs.yml")
build.build(config)
time.sleep(5)
2 changes: 2 additions & 0 deletions docs/assets/glossary/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,7 @@ json-c's
json-c
jvarkit's
jvarkit
kaitiaki
kaitiakitanga
kalign2's
kalign2
Expand Down Expand Up @@ -2168,6 +2169,7 @@ tabix's
tabix
tabixpp's
tabixpp
taonga
tbb's
tbb
tbl2asn's
Expand Down
4 changes: 1 addition & 3 deletions docs/assets/glossary/update_dictionary.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

# Updates dictionary for spellcheck

wget -O docs/assets/glossary/dictionary.txt https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/dictionary.txt
( cd "${PWD/\/docs\/*/}" && wget -O docs/assets/glossary/dictionary.txt https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/dictionary.txt )
31 changes: 0 additions & 31 deletions docs/assets/stylesheets/footer copy.css

This file was deleted.

41 changes: 41 additions & 0 deletions docs/assets/stylesheets/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,62 @@
--md-accent-bg-color: rgb(210,227,235);
--md-accent-bg-color--light: rgb(210,227,235,0.5);
}
/* :root{
--nesi-grey : #414f5c;
--nesi-grey--light: #94a5ad;
--nesi-yellow :#fcce06;
--nesi-purple: rgb(202, 159, 213);
--nesi-orange : rgb(244, 121, 37);
--nesi-blue : #4fbaed;
--nesi-red:#ef315e;
--nesi-green: #cce310;

[data-md-color-scheme="default"]{
--md-primary-fg-color: var(--nesi-red);

--md-accent-fg-color: var(--nesi-orange);;
--md-accent-fg-color--transparent: rgb(244, 121, 37, 0.25);
}

--md-accent-bg-color: rgb(210,227,235);
[data-md-color-scheme="slate"] {
--md-primary-fg-color: var(--nesi-red);
--md-accent-fg-color: var(--nesi-orange);;
--md-accent-fg-color--transparent: rgb(244, 121, 37, 0.25);

.nt-card-image>img {
filter: brightness(0) invert(1);
}
}
}
// Logo biggification
/* .md-header__button.md-logo img, .md-header__button.md-logo svg {
height: 4rem;
margin: -2rem;
} */

/* Version table stuff */
.md-tag.md-tag-ver{
color: var(--md-code-fg-color);
}
.md-tag.md-tag-ver-shown {
outline: var(--md-primary-fg-color) 2px solid;
}

.md-tag-ver-warn {
text-decoration: line-through;
}
.md-typeset__table {
width: 100%;
}
.md-typeset__table table:not([class]) {
display: table
}
/* convenience class. Not sure if it is used */
.hidden{
display: none;
}
/* Get support button */
.md-button-support{
position: absolute;
margin: -2rem 0 0 1rem;
Expand Down
Empty file removed overrides/partials/.gitkeep
Empty file.
Loading