Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Docs

on:
push:
branches:
- master
release:
types: [published]
workflow_dispatch:

permissions:
contents: write

jobs:
hookdocs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build docs
run: npm run build:docs

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ package/dist

# PHPStan result cache
/.phpstan-cache/

# Generated docs (published to gh-pages by workflow)
/docs/
46 changes: 46 additions & 0 deletions .hookdoc/layout.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?js= title ?> - Cloudinary Docs</title>

<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">

<link
href="https://fonts.googleapis.com/css?family=IBM+Plex+Mono|IBM+Plex+Sans:300,400|Playfair+Display:900&display=swap"
rel="stylesheet">
</head>

<body>

<div id="main">

<?js if (title !== 'Home') { ?>
<h1 class="page-title"><?js= title ?></h1>
<?js } ?>

<?js= content ?>
</div>

<nav>
<?js= this.nav ?>
</nav>

<br class="clear">

<footer>
<a href="https://cloudinary.com/" target="_blank" rel="noopener noreferrer">Cloudinary</a> |
<a href="https://github.com/cloudinary/cloudinary_wordpress/" target="_blank" rel="noopener noreferrer">Cloudinary
on GitHub</a>
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"></script>
</body>
</html>
19 changes: 19 additions & 0 deletions hookdoc-conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"opts": {
"destination": "docs",
"template": "node_modules/wp-hookdoc/template",
"recurse": true,
"readme": "./README.md"
},
"source": {
"includePattern": ".+\\.(php|inc)?$"
},
"plugins": [
"node_modules/wp-hookdoc/plugin"
],
"templates": {
"default": {
"layoutFile": ".hookdoc/layout.tmpl"
}
}
}
Loading
Loading