Skip to content

Commit

Permalink
Docs - Add PHPDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Feb 15, 2024
1 parent 1be9ae9 commit 9cb118e
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 7 deletions.
59 changes: 52 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,60 @@ jobs:

- uses: actions/setup-node@v4

- name: Building docs
- name: Building JS docs
run: make js-doc

- name: Setup Pages
uses: actions/configure-pages@v4
- uses: actions/upload-artifact@master
with:
name: js
path: docs/js/assets/1.0.0/

phpdoc:
name: "🐘 PHP-Doc"
if: github.repository == '3liz/lizmap-web-client' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:

- name: Check out repository
uses: actions/checkout@v4

- name: Building PHP docs
run: make php-doc

- uses: actions/upload-artifact@master
with:
name: php
path: docs/php

deploy:
needs: [ jsdoc, phpdoc ]
name: "📤 Deploy"
if: github.repository == '3liz/lizmap-web-client' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:

- name: Check out repository
uses: actions/checkout@v4

- uses: actions/download-artifact@master
with:
name: php
path: docs/php/

- uses: actions/download-artifact@master
with:
name: js
path: docs/js/

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/js/assets/1.0.0/
path: docs/

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Deploy to GitHub Pages
if: github.repository == '3liz/lizmap-web-client' && github.ref == 'refs/heads/master'
id: deployment
uses: actions/deploy-pages@v4

Expand All @@ -64,5 +105,9 @@ jobs:
# ./node_modules/.bin/gh-pages-multi deploy -s docs/js/assets/1.0.0/ -t $BRANCH_NAME -v

- name: Summary
if: github.repository == '3liz/lizmap-web-client' && github.ref == 'refs/heads/master'
run: echo "### Published ! :rocket:" >> $GITHUB_STEP_SUMMARY
run: |
echo "
### Published ! :rocket:
[Visit the doc](https://docs.3liz.org/lizmap-web-client/)
" >> $GITHUB_STEP_SUMMARY
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ saas_deploy_snap:
saas_release: check-release
saas_release_lizmap stable $(SAAS_LIZMAP_VERSION) $(GENERIC_PACKAGE_PATH)

php-doc:
docker run --rm -v ${PWD}:/data phpdoc/phpdoc:3 -c docs/phpdoc.xml

js-doc:
rm -rf docs/js
npx jsdoc -c docs/jsdoc.json
Expand Down
23 changes: 23 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8"/>
<title>API documentation</title>
<link rel="stylesheet" href="https://packages.3liz.org/packages.css" />
<body>

<header class="header-container" style="">
<h1>API documentation</h1>
</header>

<article>
<h2>Lizmap Web Client</h2>
<h3>API documentation</h3>
<div class="links">
<ul>
<li><a href="/lizmap-web-client/php">PHP</a></li>
<li><a href="/lizmap-web-client/js">JavaScript</a></li>
</ul>
</div>
</article>
</body>
</html>
20 changes: 20 additions & 0 deletions docs/phpdoc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpdocumentor
configVersion="3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://www.phpdoc.org"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/phpDocumentor/phpDocumentor/master/data/xsd/phpdoc.xsd"
>
<title>Lizmap Web Client Master</title>
<paths>
<output>php</output>
<cache>.build/cache</cache>
</paths>
<version number="master">
<api>
<source dsn="../lizmap/">
<path>modules</path>
</source>
</api>
</version>
</phpdocumentor>

0 comments on commit 9cb118e

Please sign in to comment.