docs: GitHub Action up the JSON docs

pull/9377/head
Daniel Mensinger 3 years ago
parent d7ea066c5c
commit 2ab5620769
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 12
      .github/workflows/website.yml
  2. 49
      docs/meson.build

@ -12,6 +12,9 @@ on:
paths:
- docs/**
workflow_dispatch:
release:
types:
- published
# This job is copy/paster into wrapdb CI, please update it there when doing any
# change here.
@ -40,6 +43,7 @@ jobs:
cd docs
../meson.py setup _build
ninja -C _build
ninja -C _build test
- name: Update website
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
@ -47,3 +51,11 @@ jobs:
cd docs
ninja -C _build upload
if: env.HAS_SSH_KEY == 'true'
- name: Release the current JSON docs
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: docs/_build/reference_manual.json
tag: ${{ github.ref }}
if: ${{ github.event_name == 'release' }}

@ -15,27 +15,60 @@ docs_gen = custom_target(
build_by_default: true,
install: false)
refman_gen = custom_target(
'gen_refman',
genrefman = find_program('./genrefman.py')
refman_binary = custom_target(
'gen_refman_bin',
input: files('sitemap.txt'),
output: ['configured_sitemap.txt', 'refman_links.json'],
output: 'reference_manual.bin',
depfile: 'reman_dep.d',
command: [
find_program('./genrefman.py'),
genrefman,
'-l', 'yaml',
'-g', 'pickle',
'-o', '@OUTPUT@',
'--depfile', '@DEPFILE@',
'--force-color',
]
)
refman_md = custom_target(
'gen_refman_md',
input: refman_binary,
output: ['configured_sitemap.txt', 'refman_links.json'],
command: [
genrefman,
'-l', 'pickle',
'-g', 'md',
'-s', '@INPUT@',
'-s', files('sitemap.txt'),
'-i', '@INPUT@',
'-o', '@OUTPUT0@',
'--link-defs', '@OUTPUT1@',
'--depfile', '@DEPFILE@',
'--force-color',
'--no-modules',
],
)
refman_json = custom_target(
'gen_refman_json',
build_by_default: true,
input: refman_binary,
output: 'reference_manual.json',
command: [
genrefman,
'-l', 'pickle',
'-g', 'json',
'-i', '@INPUT@',
'-o', '@OUTPUT@',
'--force-color',
],
)
test('validate_docs', find_program('./jsonvalidator.py'), args: [refman_json])
hotdoc = import('hotdoc')
documentation = hotdoc.generate_doc(meson.project_name(),
project_version: meson.project_version(),
sitemap: refman_gen[0],
sitemap: refman_md[0],
build_by_default: true,
depends: docs_gen,
index: 'markdown/index.md',
@ -49,7 +82,7 @@ documentation = hotdoc.generate_doc(meson.project_name(),
syntax_highlighting_activate: true,
keep_markup_in_code_blocks: true,
extra_extension: meson.current_source_dir() / 'extensions' / 'refman_links.py',
refman_data_file: refman_gen[1],
refman_data_file: refman_md[1],
)
run_target('upload',

Loading…
Cancel
Save