Skip to content
Closed

Docs #11

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e0a9663
Add documentation inventory across five PandABlocks repos
coretl Jun 8, 2026
a751ae0
Add documentation gap analysis draft
coretl Jun 8, 2026
d98099a
added plan
coretl Jun 8, 2026
b13adff
docs: Stage A scaffold
coretl Jun 11, 2026
5a8e675
ci: build docs with myst instead of sphinx
coretl Jun 11, 2026
ce954be
Added the knowledge files that produced the previous 2 commits
coretl Jun 11, 2026
fc03172
ci: align docs workflow with python-copier-template; main branch + ar…
coretl Jun 11, 2026
38f5adb
ci: match copier trigger conditions to avoid duplicate docs runs
coretl Jun 11, 2026
542fc6a
ci: upload only rendered html as docs artifact (51MB -> ~7MB)
coretl Jun 11, 2026
42c2880
ci: keep html/ wrapper in docs artifact, drop only templates cache
coretl Jun 11, 2026
b1ad8fa
docs: point commented FPGA xref at /main
coretl Jun 11, 2026
56ca830
docs: Prompt D — tutorials quadrant (tutorial0, tutorial1, tutorial2)
coretl Jun 11, 2026
40d891c
docs: Prompt D — how-to quadrant (12 pages)
coretl Jun 11, 2026
9309f4a
docs: Prompt D — reference quadrant (opkg, machine-targets, glossary,…
coretl Jun 11, 2026
6a45024
docs: Prompt D — explanations quadrant (4 pages)
coretl Jun 11, 2026
de18f53
docs: convert working_with_a_design into use-web-control + save-resto…
coretl Jun 11, 2026
bfec7c9
docs: fix glossary to use MyST definition-list syntax
coretl Jun 11, 2026
3864506
docs: apply fresh-eyes review fixes and live-UI corrections
coretl Jun 12, 2026
697f198
devcontainer: add kas-based devcontainer
coretl Jun 12, 2026
e1c4632
knowledge: add Stage B issue script and fresh-eyes review status
coretl Jun 12, 2026
11c64ea
ci: publish docs to gh-pages from the docs branch too
coretl Jun 12, 2026
2c7944c
docs: Stage B — link GitHub issues into stubs and verify notes
coretl Jun 12, 2026
e15e891
Created issues
coretl Jun 12, 2026
d74c4a0
docs: recreate all 8 attribute-state icons as SVGs (Prompt C)
coretl Jun 12, 2026
b64b148
removed requirement for pre 5.0 upgrading of panda in upgrade-via-ssh
adedamola-sode Jun 16, 2026
6a3031d
removed tutorial names from files/nav links
tomkane-dls Jun 16, 2026
2fd5032
Added pre 5.0 instructions
adedamola-sode Jun 16, 2026
296c9b7
move setup by editing config.txt to its own how-to
tomkane-dls Jun 16, 2026
a39b1a8
reorganise tutorials for upgrading firmware, give legacy upgrade its …
tomkane-dls Jun 16, 2026
36734f2
increment tutorial numbers, and add a new tutorial 0 'getting started…
tomkane-dls Jun 16, 2026
e523494
update package name
tomkane-dls Jun 16, 2026
24868aa
docs: small corrections on several how-to documents
EmilioPeJu Jun 16, 2026
92693b5
docs: remove useless details from quickstart
EmilioPeJu Jun 16, 2026
4dcebfe
Merge branch 'docs' into upgrade-via-ssh
adedamola-sode Jun 17, 2026
9e62116
Merge pull request #24 from PandABlocks/upgrade-via-ssh
adedamola-sode Jun 17, 2026
bd42ca3
add missing file extension
tomkane-dls Jun 17, 2026
b34989f
update tutorial links in myst.yml
tomkane-dls Jun 17, 2026
b1dfefe
updated dead links to markdown doc links
tomkane-dls Jun 17, 2026
4293494
change power cycle reccomendation to web interface reboot
tomkane-dls Jun 17, 2026
fb92c26
updated upgrade guide links to markdown doc links
tomkane-dls Jun 17, 2026
dd734c5
change power cycle reccomendation to web interface reboot
tomkane-dls Jun 17, 2026
96bba8a
Merge remote-tracking branch 'origin/docs' into getting-started
tomkane-dls Jun 17, 2026
81fbf5d
remove legacy upgrade (reintegrated with other upgrade how tos
tomkane-dls Jun 17, 2026
a5b2804
fixed firmware upgrade guide
tomkane-dls Jun 17, 2026
96cade7
Merge pull request #26 from PandABlocks/getting-started
tomkane-dls Jun 17, 2026
ece4ac8
docs: cross-repo xref links and folder-hierarchy URLs
coretl Jun 18, 2026
e08ef3e
docs: convert internal {doc} roles to markdown links
coretl Jun 18, 2026
ef6b8f2
Merge remote-tracking branch 'origin/docs' into docs
coretl Jun 18, 2026
7792763
docs: fix references to renamed tutorial/how-to pages
coretl Jun 18, 2026
6af40d3
docs: drop remaining {doc} roles and make CI build --strict
coretl Jun 18, 2026
2050bca
docs: enforce link quality + add documentation-standards reference
coretl Jun 18, 2026
a52a729
docs: consolidate cross-linking material into the standards reference
coretl Jun 19, 2026
4c506c6
separated working in a container from the build doc
adedamola-sode Jun 16, 2026
94d0385
removed working-in-a-container; added link for FPGA docs
adedamola-sode Jun 19, 2026
71f9c83
Merge pull request #25 from PandABlocks/separate-container-from-build
adedamola-sode Jun 22, 2026
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
11 changes: 11 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Devcontainer for meta-panda Yocto/kas builds.
# Unlike the other PandABlocks repos (which use ubuntu-devcontainer), this is
# based on the kas image, matching KAS_IMAGE_VERSION in build.sh.
FROM ghcr.io/siemens/kas/kas:4.8 AS developer

USER root

# Add any system dependencies for the developer environment here
# RUN apt-get update -y && apt-get install -y --no-install-recommends \
# some-tool \
# && apt-get clean
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// For format details, see https://containers.dev/implementors/json_reference/
{
"name": "meta-panda Developer Container",
"build": {
"dockerfile": "Dockerfile",
"target": "developer"
},
"customizations": {
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"redhat.vscode-yaml"
]
}
},
"runArgs": [
"--net=host",
// Make sure SELinux does not disable access to host filesystems like tmp
"--security-opt=label=disable"
],
// Mount the parent as /workspaces so peer repos are visible alongside
// this one, and bitbake build output can live outside the repo
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind"
}
18 changes: 18 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Contributing

Contributions and issues are most welcome! All issues and pull requests are handled
through [GitHub](https://github.com/PandABlocks/meta-panda/issues). Please check for any
existing issues before filing a new one.

## Issue or Pull Request?

Raise an issue if you want to report a bug or request a feature. Open a pull request if
you already have a change ready to propose. If you are unsure, raise an issue first to
discuss the change.

## Documentation

Documentation is built with [MyST](https://mystmd.org) and published to GitHub Pages.
The docs follow the [Diátaxis](https://diataxis.fr) framework — tutorials, how-to
guides, reference and explanations. See `how-to/contribute` for the documentation
authoring conventions and the cross-repository link setup.
12 changes: 7 additions & 5 deletions .github/pages/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Redirecting to master branch</title>

<head>
<title>Redirecting to main branch</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./rel-v2023.2/index.html">
<link rel="canonical" href="rel-v2023.2/index.html">
</head>
<meta http-equiv="refresh" content="0; url=./main/index.html">
<link rel="canonical" href="main/index.html">
</head>

</html>
96 changes: 96 additions & 0 deletions .github/pages/make_switcher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
"""Make switcher.json to allow docs to switch between different versions."""

import json
import logging
from argparse import ArgumentParser
from pathlib import Path
from subprocess import CalledProcessError, check_output


def report_output(stdout: bytes, label: str) -> list[str]:
"""Print and return something received frm stdout."""
ret = stdout.decode().strip().split("\n")
print(f"{label}: {ret}")
return ret


def get_branch_contents(ref: str) -> list[str]:
"""Get the list of directories in a branch."""
stdout = check_output(["git", "ls-tree", "-d", "--name-only", ref])
return report_output(stdout, "Branch contents")


def get_sorted_tags_list() -> list[str]:
"""Get a list of sorted tags in descending order from the repository."""
stdout = check_output(["git", "tag", "-l", "--sort=-v:refname"])
return report_output(stdout, "Tags list")


def get_versions(ref: str, add: str | None) -> list[str]:
"""Generate the file containing the list of all GitHub Pages builds."""
# Get the directories (i.e. builds) from the GitHub Pages branch
try:
builds = set(get_branch_contents(ref))
except CalledProcessError:
builds = set()
logging.warning(f"Cannot get {ref} contents")

# Add and remove from the list of builds
if add:
builds.add(add)

# Get a sorted list of tags
tags = get_sorted_tags_list()

# Make the sorted versions list from main branches and tags
versions: list[str] = []
for version in ["master", "main"] + tags:
if version in builds:
versions.append(version)
builds.remove(version)

# Add in anything that is left to the bottom
versions += sorted(builds)
print(f"Sorted versions: {versions}")
return versions


def write_json(path: Path, repository: str, versions: list[str]):
"""Write the JSON switcher to path."""
org, repo_name = repository.split("/")
struct = [
{"version": version, "url": f"https://{org}.github.io/{repo_name}/{version}/"}
for version in versions
]
text = json.dumps(struct, indent=2)
print(f"JSON switcher:\n{text}")
path.write_text(text, encoding="utf-8")


def main(args=None):
"""Parse args and write switcher."""
parser = ArgumentParser(
description="Make a versions.json file from gh-pages directories"
)
parser.add_argument(
"--add",
help="Add this directory to the list of existing directories",
)
parser.add_argument(
"repository",
help="The GitHub org and repository name: ORG/REPO",
)
parser.add_argument(
"output",
type=Path,
help="Path of write switcher.json to",
)
args = parser.parse_args(args)

# Write the versions file
versions = get_versions("origin/gh-pages", args.add)
write_json(args.output, args.repository, versions)


if __name__ == "__main__":
main()
89 changes: 63 additions & 26 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,84 @@ name: Docs CI

on:
push:
branches:
- main
- docs
tags:
- '*'
pull_request:

permissions:
contents: write

jobs:
make_docs:
build:
runs-on: ubuntu-latest
container:
# TODO: use panda sdk image when available
image: ghcr.io/pandablocks/pandablocks-dev-container:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
volumes:
- ${{ github.workspace }}:/repos
- ${{ github.workspace }}/build:/build

steps:
# Git repositories
- name: Checkout Source
uses: actions/checkout@v2
- name: Avoid git conflicts when tag and branch pushed at same time
if: github.ref_type == 'tag'
run: sleep 60

- name: Checkout
uses: actions/checkout@v5
with:
path: meta-panda
# require history to get back to last tag for version number of branches
# Need this to get version number from last tag
fetch-depth: 0

# Build docs
- name: Make docs
# meta-panda is a Yocto layer, not a Python/uv project, so we install
# mystmd directly with npm rather than via `uv run tox -e docs`. The build
# command itself (`cd docs && myst build --html --strict`) matches the
# template. --strict makes the build exit non-zero on any error-severity
# message (e.g. an unresolved cross-repo xref), failing CI rather than
# publishing broken links.
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install MyST
run: npm install -g mystmd@1.10.1

- name: Sanitize ref name for docs version
run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV

# BASE_URL is required so assets/links resolve under the versioned Pages
# sub-path (https://pandablocks.github.io/meta-panda/$DOCS_VERSION/). This
# is the one deviation from the template, whose mystmd migration does not
# yet set it.
- name: Build docs
env:
BASE_URL: /meta-panda/${{ env.DOCS_VERSION }}
run: |
cd meta-panda
python3 -m sphinx -M html docs /build/
cd docs
myst build --html --strict

# Drop the ~135 MB templates/ dir (downloaded book-theme node sources, a
# build-time cache) before uploading. We keep docs/_build as the artifact
# root so the archive retains the intermediate html/ directory; this trims
# the zip ~7x (51 MB -> ~7 MB) without changing its layout.
- name: Remove build cache from artifact
run: rm -rf docs/_build/templates

- name: Upload built docs artifact
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/_build

- name: Move to versioned directory
# e.g. master or 0.1.2
run: mv /build/html "meta-panda/.github/pages/${GITHUB_REF##*/}"
run: mv docs/_build/html .github/pages/$DOCS_VERSION

- name: Write switcher.json
run: python3 .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json

- name: Publish Docs to gh-pages
# Only master and tags are published
if: "${{ github.repository_owner == 'PandABlocks' && (startsWith(github.ref, 'refs/heads/rel-') || startsWith(github.ref, 'refs/tags')) }}"
if: github.ref_type == 'tag' || github.ref_name == 'main' || github.ref_name == 'docs'
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: meta-panda/.github/pages
publish_dir: .github/pages
keep_files: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
build/
sources/

# MyST build output
docs/_build/
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# meta-panda

PandA is a programmable logic box for synchronised triggering and position
capture in scientific experiments. You configure it by wiring together
functional blocks in its FPGA — from a web browser or over a simple TCP
protocol — and capture timestamped position data from it at high speed.

This site is the root of the PandABlocks documentation: it covers getting a
PandA on the network, using the Web Control, capturing data, administering and
upgrading a PandA, and building its firmware and software. Documentation for
the individual components (FPGA framework, TCP server, Python client, EPICS /
Tango integration) is linked throughout.

This repository itself is the `meta-panda` layer: the Yocto recipes and
configuration for building the Linux system that runs on a PandA.

- Machines provided: `pandabox`, `pandabox2`, `pandabrick`
- Distro provided: `panda-petalinux`
- Image provided: `panda-image`

The Linux system brings up the network from a `config.txt` file on the SD card, runs an
SSH server for debugging access, programs the FPGA and runs services such as the TCP
server and Web Control, and serves a Web Admin interface on port 80 for installing and
removing packages and adding SSH keys.

<!-- README only content. Anything below this line will be excluded from the index page -->

## Where to find things

| | |
|---|---|
| Source code | <https://github.com/PandABlocks/meta-panda> |
| Documentation | <https://PandABlocks.github.io/meta-panda> |
| Releases | <https://github.com/PandABlocks/meta-panda/releases> |
Loading
Loading