Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MyST based documentation testing #7186

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
17 changes: 17 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,20 @@ jobs:
- name: Test Type
run: |
pixi run -e ${{ matrix.environment }} test-type || echo "Failed"

myst_test_suite:
name: myst:${{ matrix.environment }}:${{ matrix.os }}
needs: [pre_commit, setup, pixi_lock]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
environment: ["myst"]
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
environments: ${{ matrix.environment }}
- name: Test Type
Copy link
Member

@hoxbro hoxbro Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Test Type
- name: Test MyST

run: |
pixi run -e ${{ matrix.environment }} test-myst
13 changes: 13 additions & 0 deletions doc/_plugins/pyodide.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const pyodideDirective = {
name: 'pyodide',
doc: 'Stub to render Sphinx Pyodide directives',
arg: { },
options: {},
run(data) {
return [{type: 'code', language: 'python', children: [{ type: 'text', 'value': data.node.value}]} ]
},
};

const plugin = { name: 'Pyodide', directives: [pyodideDirective] };

export default plugin;
13 changes: 13 additions & 0 deletions doc/_plugins/toctree.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const toctreeDirective = {
name: 'toctree',
doc: 'Stub to render Sphinx Toctree directives ',
arg: { },
options: {},
run() {
return []
},
};

const plugin = { name: 'Toctree', directives: [toctreeDirective] };

export default plugin;
17 changes: 17 additions & 0 deletions doc/myst.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See docs at: https://mystmd.org/guide/frontmatter
version: 1
project:
id: aaff1569-a397-4602-b3ff-e1559614f6b7
title: Panel Website
# description:
# keywords: []
# authors: []
github: https://github.com/holoviz/panel
plugins:
- _plugins/pyodide.mjs
- _plugins/toctree.mjs
site:
template: book-theme
options:
favicon: _static/favicon.png
logo: _static/logo_horizontal_light_theme.png
2 changes: 1 addition & 1 deletion panel/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
},
"plugins": ["@typescript-eslint", "@stylistic/eslint-plugin"],
"extends": [],
"ignorePatterns": ["*/dist", "*/theme/**/*.js", ".eslintrc.js", "*/_templates/*.js", "*/template/**/*.js", "examples/*", "scripts/*"],
"ignorePatterns": ["*/dist", "*/theme/**/*.js", ".eslintrc.js", "*/_templates/*.js", "*/template/**/*.js", "examples/*", "scripts/*", "doc/_plugins/*"],
"rules": {
"@typescript-eslint/ban-types": ["error", {
"types": {
Expand Down
7 changes: 7 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ docs = ["py311", "example", "doc"]
build = ["py311", "build"]
lint = ["py311", "lint"]
lite = ["py311", "lite"]
myst = ["py312", "myst-doc"]

[dependencies]
nodejs = ">=18"
Expand Down Expand Up @@ -195,6 +196,12 @@ depends_on = [
'_docs-pyodide',
]

[feature.myst-doc.dependencies]
mystmd = "*"

[feature.myst-doc.tasks]
test-myst = { cmd = "myst build", cwd = "doc" }

# =============================================
# ================== BUILD ====================
# =============================================
Expand Down
Loading