Skip to content

Commit a78bfb3

Browse files
committed
add Moodle theme
1 parent 713ff51 commit a78bfb3

File tree

5 files changed

+37
-14
lines changed

5 files changed

+37
-14
lines changed

.github/workflows/publish-apidocs.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# TODO:
2-
# - Theming for Moodle
32
# - Document ALL code (below we exclude a bunch to try on a subset)
3+
# - Document all supported versions and redirect to latest // see notes at https://github.com/phpDocumentor/phpDocumentor/blob/master/tests/integration/phpDocumentor/Configuration/data/phpDocumentor3XMLWithMultipleVersions.xml
44

55
# Generate API docs and publish to GitHub Pages at phpdoc.moodledev.io
66
#
77
# How it works:
8+
# - Get phpdoc config into ./
89
# - Get Moodle code into ./source
10+
# - Setup cache at ./phpdoc-cache
911
# - Build docs into ./docs
10-
# - Cache to ./phpdoc-cache
1112
# - Publish that to phpdoc.moodledev.io
1213

1314
name: Generate phpdoc.moodledev.io
@@ -38,24 +39,15 @@ jobs:
3839
group: ${{ github.workflow }}-${{ github.ref }}
3940
cancel-in-progress: true
4041
steps:
41-
#TODO: add theming config and then uncomment this
42-
# Not using anything in this repo yet
43-
# - name: Checkout moodle/phpdoc
44-
# uses: actions/checkout@v4
42+
- name: Checkout moodle/phpdoc
43+
uses: actions/checkout@v4
4544

4645
- name: Checkout moodle/moodle
4746
uses: actions/checkout@v4
4847
with:
4948
repository: moodle/moodle
5049
path: source
5150

52-
#NOT USING NODE
53-
#TODO: remove commented out lines
54-
# - name: Setup Node
55-
# uses: actions/setup-node@v4
56-
# with:
57-
# node-version-file: '.moodle/.nvmrc'
58-
5951
# Install phpDocumentator using PHIVE
6052
# phpDocumentator recommends PHIVE as the preferred install strategy
6153
# Source: https://github.com/phpDocumentor/phpDocumentor/blob/919d5c1ef42a3c74d050e05ce99add6efa87b5a4/README.md?plain=1#L79
@@ -90,7 +82,7 @@ jobs:
9082
# Notice: -d xdebug.mode=off is required due to a bug/workaround
9183
# Issue: https://github.com/phpDocumentor/phpDocumentor/issues/3642#issuecomment-1912354577
9284
- name: Build with phpDocumentor
93-
run: php -d xdebug.mode=off ${{ github.workspace }}/tools/phpDocumentor run -vv -d source --target docs --cache-folder phpdoc-cache --template default --ignore source/lib --ignore source/admin --ignore source/mod --ignore source/blocks
85+
run: php -d xdebug.mode=off ${{ github.workspace }}/tools/phpDocumentor run -vv -d source --target docs --cache-folder phpdoc-cache --template default --ignore source/lib --ignore source/admin --ignore source/mod --ignore source/blocks --title Moodle PHP API
9486

9587
- name: Upload artifact to GitHub Pages
9688
uses: actions/upload-pages-artifact@v3

.phpdoc/template/base.html.twig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% extends 'layout.html.twig' %}
2+
3+
{% set topMenu = {
4+
"social": [
5+
{ "iconClass": "fab fa-github", "url": "https://github.com/moodle/moodle"},
6+
]
7+
}
8+
%}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<h1 class="phpdocumentor-title">
2+
<a href="{{ path('/') }}" class="phpdocumentor-title__link">
3+
<svg width="123" height="31" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1230.87 315.18" aria-label="Moodle logo">
4+
<path fill="#f98012" d="M289.61 309.77V201.51q0-33.94-28-33.95t-28.06 33.95v108.26H178.4V201.51q0-33.94-27.57-33.95-28.05 0-28 33.95v108.26H67.67V195.12q0-35.43 24.6-53.63 21.66-16.25 58.56-16.25 37.41 0 55.12 19.19 15.26-19.19 55.62-19.19 36.9 0 58.54 16.25 24.6 18.19 24.61 53.63v114.65Zm675.49-.5V0h55.16v309.27Zm-70.3 0v-18.22q-7.39 9.84-25.11 15.76a92.81 92.81 0 0 1-30.05 5.41q-39.4 0-63.28-27.09t-23.89-67c0-26.25 7.76-48.3 23.4-66 13.85-15.65 36.35-26.59 62.29-26.59 29.22 0 46.28 11 56.64 23.63V0h53.68v309.27Zm0-102.92q0-14.78-14-28.33T852 164.47q-21.16 0-33.48 17.24-10.85 15.3-10.84 37.43 0 21.68 10.84 36.94 12.3 17.75 33.48 17.73 12.81 0 27.83-12.07t15-24.86ZM648.57 314.19q-41.87 0-69.19-26.59T552 219.14q0-41.83 27.34-68.45t69.19-26.59q41.85 0 69.44 26.59t27.58 68.45q0 41.88-27.58 68.46t-69.4 26.59Zm0-145.77q-19.94 0-30.65 15.1t-10.71 35.88q0 20.78 10 35.13 11.46 16.34 31.4 16.32T680 254.53q10.46-14.34 10.46-35.13t-10-35.13q-11.46-15.86-31.89-15.85ZM449.13 314.19q-41.86 0-69.2-26.59t-27.33-68.46q0-41.83 27.33-68.45t69.2-26.59q41.83 0 69.44 26.59t27.57 68.45q0 41.88-27.57 68.46t-69.44 26.59Zm0-145.77q-19.94 0-30.66 15.1t-10.71 35.88q0 20.78 10 35.13 11.46 16.34 31.41 16.32t31.39-16.32Q491 240.19 491 219.4t-10-35.13q-11.44-15.86-31.87-15.85Zm636.45 67.47c1.18 13.13 18.25 41.37 46.31 41.37 27.31 0 40.23-15.77 40.87-22.16l58.11-.5c-6.34 19.39-32.1 60.58-100 60.58-28.24 0-54.08-8.79-72.64-26.35s-27.82-40.45-27.82-68.7q0-43.83 27.82-69.68t72.16-25.85q48.25 0 75.34 32 25.13 29.53 25.12 79.28Zm90.13-34c-2.3-11.83-7.23-21.49-14.77-29.06q-12.82-12.3-29.55-12.31-17.25 0-28.82 11.82t-15.5 29.55Z"/>
5+
<path fill="#333" d="m174.74 116.9 54.74-40-.7-2.44C130 86.57 85.08 95.15 0 144.47l.79 2.24 6.76.07c-.62 6.81-1.7 23.64-.32 48.95-9.44 27.32-.24 45.88 8.4 66.07 1.37-21 1.23-44-5.22-66.89-1.35-25.14-.24-41.67.37-48.1l56.4.54a258 258 0 0 0 1.67 33.06c50.4 17.71 101.09-.06 128-43.72-7.47-8.37-22.11-19.79-22.11-19.79Z"/>
6+
</svg>
7+
<!-- {{ project.name }} -->
8+
PHP API
9+
</a>
10+
</h1>

.phpdoc/template/template.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<template>
3+
<name>Moodle PHP API</name>
4+
<author></author>
5+
<email></email>
6+
<version></version>
7+
<extends></extends>
8+
<transformations>
9+
<transformation writer="twig" source="templates/default/index.html.twig" artifact="index2.html"/>
10+
</transformations>
11+
</template>

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Moodle API Documentation Generator
22

33
PHPDoc is generated for all _supported_ major versions of Moodle.
4+
5+
Website is published at https://phpdoc.moodledev.io.

0 commit comments

Comments
 (0)