-
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.
Merge pull request #233 from Andre601/feature/restructure-wiki
Move Wiki to GitHub Pages
- Loading branch information
Showing
14 changed files
with
556 additions
and
382 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,53 @@ | ||
name: Update Wiki | ||
name: Publish wiki | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- 'wiki/**' | ||
branches: | ||
- 'master' | ||
- master | ||
paths: | ||
- '.github/workflows/wiki.yml' | ||
- 'docs/**' | ||
- 'mkdocs.yml' | ||
- 'requirements.txt' | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: github-pages | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
update: | ||
buildSite: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: SwiftDocOrg/github-wiki-publish-action@v1 | ||
with: | ||
path: 'wiki' | ||
env: | ||
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.PAT }} | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python 3.x | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- name: Update Pip and install dependencies | ||
run: | | ||
python -m pip install -U pip | ||
pip install -r requirements.txt | ||
- name: Build Site | ||
run: mkdocs build | ||
- name: Configure GitHub Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Upload Pages Artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: 'site/' | ||
- name: Deploy to GitHub Pages | ||
uses: actions/deploy-pages@v3 | ||
id: deployment |
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,3 @@ | ||
.md-header__button.md-logo img, .md-header__button.md-logo svg { | ||
height: 3rem; | ||
} |
File renamed without changes
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,74 @@ | ||
document$.subscribe(async () => { | ||
const url = `https://api.allorigins.win/raw?url=${encodeURIComponent('https://andre601.ch/oneversionremake/protocol_versions.json')}`; | ||
|
||
const versions_table = document.querySelector('[data-md-component="versions-table"]'); | ||
|
||
const headerText = ['Protocol', 'Version', 'Major']; | ||
|
||
function createTable(data) { | ||
const table = document.createElement("table"); | ||
const tableHead = document.createElement("thead"); | ||
const tableBody = document.createElement("tbody"); | ||
|
||
if(tableHead === null || tableBody === null) | ||
return; | ||
|
||
const headRow = document.createElement("tr"); | ||
for(let i = 0; i < 3; i++) { | ||
const cell = document.createElement("th"); | ||
const text = document.createTextNode(`${headerText[`${i}`]}`); | ||
|
||
cell.appendChild(text); | ||
headRow.appendChild(cell); | ||
} | ||
|
||
tableHead.appendChild(headRow); | ||
|
||
console.log(data.protocols) | ||
|
||
for(i in data.protocols){ | ||
const value = data.protocols[i]; | ||
const row = document.createElement("tr"); | ||
|
||
const protocol = document.createElement("td"); | ||
const protocolText = document.createTextNode(value.protocol) | ||
|
||
const version = document.createElement("td"); | ||
const versionText = document.createTextNode(value.name) | ||
|
||
const major = document.createElement("td"); | ||
const majorText = document.createTextNode(value.major) | ||
|
||
protocol.appendChild(protocolText); | ||
version.appendChild(versionText); | ||
major.appendChild(majorText); | ||
|
||
row.appendChild(protocol); | ||
row.appendChild(version); | ||
row.appendChild(major); | ||
|
||
tableBody.appendChild(row); | ||
} | ||
|
||
table.appendChild(tableHead); | ||
table.appendChild(tableBody); | ||
|
||
versions_table.appendChild(table); | ||
} | ||
|
||
async function fetchData() { | ||
const data = await fetch(`${url}`).then(_ => _.json()); | ||
|
||
__md_set("__versions_data", data, sessionStorage); | ||
createTable(data); | ||
} | ||
|
||
if(document.querySelector('[data-md-component="versions-table"]')) { | ||
const cached = __md_get("__versions_data", sessionStorage); | ||
if(cached != null) { | ||
createTable(cached); | ||
} else { | ||
fetchData(); | ||
} | ||
} | ||
}) |
Oops, something went wrong.