Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
FMCorz committed Jul 9, 2024
0 parents commit 9608b7d
Show file tree
Hide file tree
Showing 18 changed files with 8,067 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- master

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn
- name: Install dependencies
run: npm install
- name: Build website
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
25 changes: 25 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { readFileSync, readdirSync, writeFileSync } from 'fs';
import { JSDOM } from 'jsdom';
import { compareVersions } from 'compare-versions';

function orderByVersion(a, b) {
if (a.added === b.added) {
if (a.removed === b.removed) {
return a.title.localeCompare(b.title);
}
return compareVersions(b.removed ?? '99.99', a.removed ?? '99.99');
}
return compareVersions(b.added, a.added);
}

const featureFiles = readdirSync('./features/').filter((file) => file.endsWith('.json')).map((file) => `./features/${file}`);
const features = featureFiles.reduce((carry, file) => {
carry.push(JSON.parse(readFileSync(file).toString()));
return carry;
}, []).sort(orderByVersion);

const dom = await JSDOM.fromFile('src/index.html');
const document = dom.window.document;
document.getElementById('features-json').innerHTML = JSON.stringify(features);

writeFileSync('dist/index.html', dom.serialize());
8 changes: 8 additions & 0 deletions features/callback-add_htmlattributes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"title": "Callback add_htmlattributes",
"description": "Allows plugins to add, remove or modify any attributes of the HTML tag.",
"component": "core",
"added": "3.3",
"deprecated": "4.4",
"notes": "This is superceded by the hook `before_html_attributes`."
}
8 changes: 8 additions & 0 deletions features/hook-before_html_attributes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"title": "Hook before_html_attributes",
"description": "Allows plugins to add, remove or modify any attributes of the HTML tag by registering to `core\\hook\\output\\before_html_attributes`.",
"component": "core",
"added": "4.4",
"notes": "This supercedes the legacy callback `add_htmlattributes`.",
"links": [{ "title": "Hooks documentation", "url": "https://moodledev.io/docs/apis/core/hooks" }]
}
6 changes: 6 additions & 0 deletions features/php-73.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "PHP 7.3",
"description": "Compatibility with PHP 7.3.",
"added": "3.11",
"removed": "4.1"
}
6 changes: 6 additions & 0 deletions features/php-74.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "PHP 7.4",
"description": "Compatibility with PHP 7.4.",
"added": "3.11",
"removed": "4.2"
}
6 changes: 6 additions & 0 deletions features/php-80.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "PHP 8.0",
"description": "Compatibility with PHP 8.0.",
"added": "3.11",
"removed": "4.4"
}
5 changes: 5 additions & 0 deletions features/php-81.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "PHP 8.1",
"description": "Compatibility with PHP 8.1.",
"added": "4.1"
}
5 changes: 5 additions & 0 deletions features/php-82.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "PHP 8.2",
"description": "Compatibility with PHP 8.2.",
"added": "4.2"
}
5 changes: 5 additions & 0 deletions features/php-83.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "PHP 8.3",
"description": "Compatibility with PHP 8.3.",
"added": "4.4"
}
Loading

0 comments on commit 9608b7d

Please sign in to comment.