Skip to content

fix: resolve MyST build warnings - #11

Merged
mmmarinho merged 2 commits into
mainfrom
fix/myst-build-warnings
Aug 18, 2026
Merged

fix: resolve MyST build warnings#11
mmmarinho merged 2 commits into
mainfrom
fix/myst-build-warnings

Conversation

@mmmarinho

Copy link
Copy Markdown
Contributor

Summary

Running myst build produced three warnings. This PR fixes all of them, so the build is now clean.

This PR was created by an AI agent (OpenHands) on behalf of the maintainer.

The three warnings and their fixes

# Warning File Root cause Fix
1 missing heading depth 2 basic_lessons/README.md Page title is depth 1, but "Using this book" and "Contents" jumped straight to depth 3, skipping depth 2 (MyST warns on any gap in the heading-depth sequence). Demote both to ##.
2 Language is not defined for code block basic_lessons/lesson0_tutorial.md The "Verifying the installation" {code-cell} had no language tag, so the rendered code node had no lang. Add python to the directive → {code-cell} python. Verified MyST records this as the code language (all other fenced blocks keep their own).
3 textEnv, Too few columns specified in the {array} column argument (×4, two math blocks) basic_lessons/lesson2_tutorial.md The two 4×4 homogeneous transformation matrices H_a and H_a_b declared {array}{ccc} (3 columns) but actually have 4 columns. Change both to {array}{cccc}.

Verification

  • Ran a full myst build --execute --html (all 17 pages, all code cells executed) before the fix → the three warnings above were present.
  • Ran the same build after the fix → no warnings remain.
  • I scanned every lesson for the same class of bug:
    • No other {array} block declares fewer columns than it actually contains (the 2×2 and 3×3 blocks are fine — 3 ≥ their column count, which is why they never warned).
    • No other README/page has a heading-depth gap.
    • No other code block is missing a language.

Notes

  • The build's exit code in my sandbox is 1 either way, but that is only the local live-preview server (Server started on port 3000) failing to connect in a headless environment — it happens on main too and is unrelated to these warnings. The actual site build succeeds and emits the pages.
  • No runtime/Python code was changed; only Markdown/LaTeX markup.

Related: #10 (merged).

Three warnings appear when running `myst build`:

1. basic_lessons/README.md "missing heading depth 2" — the page title is
   depth 1 but "Using this book" and "Contents" jumped straight to depth 3,
   skipping depth 2. Demote them to `##`.

2. lesson0_tutorial.md "Language is not defined for code block" — the
   verification {code-cell} had no language. Add `python` to the directive
   (``{code-cell} python``), which MyST records as the code language.

3. lesson2_tutorial.md "textEnv, Too few columns specified in the {array}
   column argument" — the 4x4 homogeneous transformation matrices H_a and
   H_a_b declared {array}{ccc} (3 columns) but have 4. Change to {cccc}.

Verified with a full `myst build --execute --html`: no warnings remain.

Co-authored-by: openhands <openhands@all-hands.dev>
@mmmarinho mmmarinho self-assigned this Aug 18, 2026

@mmmarinho mmmarinho left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍

AGENTS.md content was already accurate against the current repo state;
no corrections were needed. Added a short "Keeping the build warning-free"
note under Building & Testing documenting the three MyST warning classes
fixed in this PR, including the non-obvious point that a bare {code-cell}
only warns for lessons referenced as .md (lesson 0) — lessons 1-5 are
.ipynb-referenced and Jupyter carries the Python language.

Co-authored-by: openhands <openhands@all-hands.dev>
@mmmarinho

Copy link
Copy Markdown
Contributor Author

AGENTS.md review + small addition

As requested, I audited AGENTS.md against the current repository state (post-migration to MyST text notebooks). The file was already accurate — every section checked out against the actual files:

  • Repository Structurebasic_lessons/ as canonical .md source, basic_lessons/.gitignore excluding generated .ipynb, and the absence of unstable/ / convert_to_myst.py all match reality (no stale references left over).
  • Building & Testing — the build_html.sh steps (install jupyter-book --pre, BASE_URL, python -m jupyter book build --html --execute) and the CI steps (jupytext conversion → ./build_html.sh → Pages) match the script and .github/workflows/notebook_to_html.yml exactly.
  • Git Workflow — correctly states there is intentionally no root .gitignore (verified: only basic_lessons/.gitignore exists) and how venv/ / _build/ are kept out.

So no corrections were needed. I made one focused addition — a short "Keeping the build warning-free" subsection under Building & Testing — that captures the three MyST warning classes fixed in this PR so they don't regress:

  1. missing heading depth N — skipping a heading level (fix: use consecutive depths).
  2. textEnv, Too few columns specified in the {array} column argument — an \begin{array}{ccc} with a 4-column row (fix: match the spec, e.g. {cccc}).
  3. Language is not defined for code block — a bare {code-cell} (fix: {code-cell} python).

The third bullet records a non-obvious nuance I verified while debugging: only lesson 0 warns about bare {code-cell} directives, because it is the only lesson referenced in myst.yml as .md (built directly from Markdown). Lessons 1–5 are referenced as .ipynb (generated by jupytext), and Jupyter itself carries the Python language on every code cell — I confirmed the generated .ipynb files have Jupyter's default Python language on all code cells. So those bare directives are fine and needed no change; "fixing" them would have been ~150 needless line edits.

This comment was created by an AI agent (OpenHands) on behalf of the maintainer.

@mmmarinho mmmarinho left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍

@mmmarinho
mmmarinho marked this pull request as ready for review August 18, 2026 11:29
@mmmarinho
mmmarinho merged commit 5d28279 into main Aug 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants