Skip to content

docs: migrate admonitions to GFM alerts#5886

Open
njzjz wants to merge 6 commits into
deepmodeling:masterfrom
njzjz:docs/migrate-gfm-alerts
Open

docs: migrate admonitions to GFM alerts#5886
njzjz wants to merge 6 commits into
deepmodeling:masterfrom
njzjz:docs/migrate-gfm-alerts

Conversation

@njzjz

@njzjz njzjz commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

  • enable the MyST alert extension and require MyST-Parser 5.1.0 with Sphinx 8+
  • migrate 83 fenced admonitions across 54 Markdown files to GitHub-style alerts while preserving nested directives
  • map the former danger admonitions to GFM CAUTION alerts
  • align the documentation Python environment with the MyST-Parser 5.1 requirement

Validation

  • ruff check .
  • ruff format --check .
  • mdformat pre-commit hook
  • representative Sphinx HTML build with MyST-Parser 5.1.0 and myst-nb 1.4.0
  • TOML and YAML parsing
  • alert migration count and legacy directive checks
  • git diff --check

Reference:

Coding agent: Codex
Codex version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning effort: xhigh

Summary by CodeRabbit

  • Documentation
    • Standardized notes, warnings, cautions, and important notices across the documentation for clearer, more consistent rendering.
    • Expanded DPA-2 guidance for graph-based inference, evaluation, training, legacy routing, and cutoff smoothness.
    • Clarified documentation build requirements, including Python 3.11+, Sphinx 8, MyST-Parser 5.1, and Doxygen.
  • Chores
    • Updated the documentation environment and tooling requirements to current supported versions.

Enable MyST-Parser alert support and use the native Read the Docs uv pip installer.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
Copilot AI review requested due to automatic review settings July 21, 2026 04:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates DeePMD-kit’s documentation toolchain and Markdown authoring style by enabling MyST’s alert extension, bumping the doc build dependencies (Sphinx/MyST-Parser), and migrating MyST fenced admonitions (:::{note} / :::{warning} / ::::{danger}) to GitHub-flavored Markdown (GFM) alert blocks (> [!NOTE], > [!WARNING], > [!CAUTION], etc.), including cases with nested directives.

Changes:

  • Enable MyST alert and migrate many doc admonitions from colon-fenced directives to GFM alerts (including mapping former danger blocks to CAUTION).
  • Bump doc build requirements to sphinx>=8 and myst-parser>=5.1.0 (and align doc/requirements.txt).
  • Update Read the Docs config to use native uv install configuration and remove the prior post-install steps / Inkscape dependency.

Reviewed changes

Copilot reviewed 59 out of 59 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Raises doc extra requirements (sphinx>=8, myst-parser>=5.1.0) to support MyST alerts on Sphinx 8+.
doc/requirements.txt Aligns docs requirements with sphinx>=8.
doc/conf.py Enables MyST alert extension for GFM alert parsing.
.readthedocs.yml Switches RTD installs to native uv configuration and removes previous job hooks / apt packages.
doc/environment.yml Updates the docs conda environment to Python 3.11.
doc/env.md Converts a note admonition to a GFM alert block.
doc/backend.md Converts a note admonition to a GFM alert block.
doc/train/training.md Converts a warning admonition to a GFM alert block.
doc/train/tensorboard.md Converts a supported-backends note to a GFM alert block.
doc/train/parallel-training.md Converts note admonitions (including multi-paragraph content) to GFM alert blocks.
doc/train/multi-task-training.md Converts note/warning admonitions to GFM alert blocks.
doc/train/finetuning.md Converts warning/note admonitions (including code-fence content) to GFM alert blocks.
doc/third-party/nvalchemi.md Converts a supported-backends note to a GFM alert block.
doc/third-party/lammps-command.md Converts multiple notes to GFM alert blocks.
doc/third-party/jaxmd.md Converts a note admonition to a GFM alert block.
doc/third-party/ipi.md Converts a note admonition to a GFM alert block.
doc/third-party/gromacs.md Converts an important admonition (with nested deprecated) to a GFM alert block.
doc/third-party/dpdata.md Converts a note admonition to a GFM alert block.
doc/third-party/ase.md Converts a note admonition to a GFM alert block.
doc/nvnmd/nvnmd.md Converts a supported-backends note to a GFM alert block.
doc/model/train-se-e3.md Converts a supported-backends note to a GFM alert block.
doc/model/train-se-e3-tebd.md Converts a supported-backends note to a GFM alert block.
doc/model/train-se-e2-r.md Converts a supported-backends note to a GFM alert block.
doc/model/train-se-e2-a.md Converts a supported-backends note to a GFM alert block.
doc/model/train-se-e2-a-tebd.md Converts a supported-backends note to a GFM alert block.
doc/model/train-se-atten.md Converts supported-backends and other notes to GFM alert blocks.
doc/model/train-se-a-mask.md Converts a supported-backends note to a GFM alert block.
doc/model/train-hybrid.md Converts a supported-backends note to a GFM alert block.
doc/model/train-fitting-tensor.md Converts a supported-backends note to a GFM alert block.
doc/model/train-fitting-property.md Converts a supported-backends note to a GFM alert block.
doc/model/train-fitting-population.md Converts a supported-backends note to a GFM alert block.
doc/model/train-fitting-dos.md Converts a supported-backends note to a GFM alert block.
doc/model/train-energy.md Converts supported-backends notes to GFM alert blocks.
doc/model/train-energy-spin.md Converts warning/note admonitions (including list content) to GFM alert blocks.
doc/model/train-energy-hessian.md Converts note/warning admonitions to GFM alert blocks.
doc/model/pairtab.md Converts notes to GFM alert blocks.
doc/model/overall.md Converts a warning admonition to a GFM alert block.
doc/model/linear.md Converts a supported-backends note to a GFM alert block.
doc/model/dprc.md Converts supported-backends notes to GFM alert blocks.
doc/model/dplr.md Converts a supported-backends note to a GFM alert block.
doc/model/dpa4.md Converts notes/important admonitions to GFM alert blocks.
doc/model/dpa3.md Converts a supported-backends note to a GFM alert block.
doc/model/dpa2.md Converts two long notes (with lists) to GFM alert blocks.
doc/model/change-bias.md Converts a supported-backends note to a GFM alert block.
doc/install/install-lammps.md Converts a note (with code example) to a GFM alert block.
doc/install/install-gromacs.md Converts a former danger admonition (with nested deprecated) to a CAUTION GFM alert block.
doc/install/install-from-source.md Converts a warning admonition to a GFM alert block.
doc/install/install-from-c-library.md Converts a supported-backends note to a GFM alert block.
doc/install/easy-install.md Converts multiple notes/danger/warning admonitions to GFM alert blocks (CAUTION for former danger).
doc/install/easy-install-dev.md Converts a supported-backends note to a GFM alert block.
doc/install/build-conda.md Converts a former danger admonition (deprecated notice) to a CAUTION GFM alert block.
doc/inference/python.md Converts multiple notes to GFM alert blocks.
doc/inference/nodejs.md Converts a note admonition to a GFM alert block.
doc/inference/embedding.md Converts a supported-backends note to a GFM alert block.
doc/inference/cxx.md Converts a note admonition to a GFM alert block.
doc/freeze/compress.md Converts a supported-backends note to a GFM alert block.
doc/development/type-embedding.md Converts a note admonition to a GFM alert block.
doc/development/create-a-model-pt.md Converts a supported-backends note (multi-paragraph) to a GFM alert block.
doc/data/system.md Converts a note admonition to a GFM alert block.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread doc/train/finetuning.md Outdated
Comment thread doc/model/pairtab.md Outdated
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a2f720f8-72fd-4f50-b5d8-79128a4393a4

📥 Commits

Reviewing files that changed from the base of the PR and between 72fcaa0 and f762945.

📒 Files selected for processing (2)
  • doc/README
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml

📝 Walkthrough

Walkthrough

The documentation build now targets Python 3.11 with Sphinx 8 and MyST Parser 5.1. Documentation notes, warnings, cautions, and important notices are converted to Markdown alert syntax across the documentation, with expanded DPA-2 routing guidance.

Changes

Documentation build and general alerts

Layer / File(s) Summary
Documentation build toolchain
doc/environment.yml, doc/requirements.txt, pyproject.toml, doc/README, doc/conf.py
Documentation prerequisites and dependency minimums are updated, and MyST alert support is enabled.
General and interface documentation alerts
doc/backend.md, doc/data/*, doc/development/*, doc/env.md, doc/freeze/*, doc/inference/*
Existing note blocks are converted to Markdown alert callouts while preserving their documented content.

Installation documentation alerts

Layer / File(s) Summary
Installation documentation alerts
doc/install/*
Installation notes, warnings, cautions, and deprecation notices are converted to the new alert format without changing their instructions or references.

Model documentation alerts

Layer / File(s) Summary
Model and descriptor documentation alerts
doc/model/*
Model and descriptor callouts are reformatted as Markdown alerts. DPA-2 documentation additionally expands pt_expt routing and legacy-route instructions.

Training and third-party documentation alerts

Layer / File(s) Summary
Training and third-party documentation alerts
doc/train/*, doc/third-party/*
Training and third-party notes, warnings, important notices, and deprecation callouts are converted to Markdown alert syntax while retaining their documented guidance.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested labels: Python, build

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: migrating documentation admonitions to GitHub-style alerts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@doc/install/easy-install.md`:
- Around line 10-11: In the Markdown alert block around the second [!NOTE],
remove the blockquote marker from the blank separator line so it is an unquoted
empty line, keeping the two alerts as separate blocks.

In `@doc/model/dpa2.md`:
- Around line 104-113: Remove the blank blockquote line between the two
paragraphs in the alert note, keeping the surrounding `> [!NOTE]` content and
paragraph text unchanged so the blockquote has no empty line and satisfies
MD028.

In `@doc/third-party/gromacs.md`:
- Around line 3-7: Resolve the MD028 alert-spacing violations by removing the
empty quoted line inside the IMPORTANT alert at doc/third-party/gromacs.md lines
3-7 and removing the blank line between the NOTE and WARNING alerts at
doc/train/multi-task-training.md lines 3-7; only suppress MD028 at either site
if the separator is required for the nested directive or intentional alert
separation.

In `@doc/train/finetuning.md`:
- Around line 250-255: In the Paddle fine-tuning note, update the misspelled
word “refering” to “referring” while leaving the surrounding documentation
unchanged.
- Around line 106-111: Remove the leading “$ ” shell prompt from the command in
the migrated alert snippets, including the command near the multi-task
pre-trained model note and the corresponding snippet around the other referenced
section. Keep the fenced bash commands otherwise unchanged so they remain
directly copyable and satisfy markdownlint MD014.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: afd02458-3681-44c4-8741-bd0a0e64e0e6

📥 Commits

Reviewing files that changed from the base of the PR and between 83e7245 and d3487c7.

📒 Files selected for processing (59)
  • .readthedocs.yml
  • doc/backend.md
  • doc/conf.py
  • doc/data/system.md
  • doc/development/create-a-model-pt.md
  • doc/development/type-embedding.md
  • doc/env.md
  • doc/environment.yml
  • doc/freeze/compress.md
  • doc/inference/cxx.md
  • doc/inference/embedding.md
  • doc/inference/nodejs.md
  • doc/inference/python.md
  • doc/install/build-conda.md
  • doc/install/easy-install-dev.md
  • doc/install/easy-install.md
  • doc/install/install-from-c-library.md
  • doc/install/install-from-source.md
  • doc/install/install-gromacs.md
  • doc/install/install-lammps.md
  • doc/model/change-bias.md
  • doc/model/dpa2.md
  • doc/model/dpa3.md
  • doc/model/dpa4.md
  • doc/model/dplr.md
  • doc/model/dprc.md
  • doc/model/linear.md
  • doc/model/overall.md
  • doc/model/pairtab.md
  • doc/model/train-energy-hessian.md
  • doc/model/train-energy-spin.md
  • doc/model/train-energy.md
  • doc/model/train-fitting-dos.md
  • doc/model/train-fitting-population.md
  • doc/model/train-fitting-property.md
  • doc/model/train-fitting-tensor.md
  • doc/model/train-hybrid.md
  • doc/model/train-se-a-mask.md
  • doc/model/train-se-atten.md
  • doc/model/train-se-e2-a-tebd.md
  • doc/model/train-se-e2-a.md
  • doc/model/train-se-e2-r.md
  • doc/model/train-se-e3-tebd.md
  • doc/model/train-se-e3.md
  • doc/nvnmd/nvnmd.md
  • doc/requirements.txt
  • doc/third-party/ase.md
  • doc/third-party/dpdata.md
  • doc/third-party/gromacs.md
  • doc/third-party/ipi.md
  • doc/third-party/jaxmd.md
  • doc/third-party/lammps-command.md
  • doc/third-party/nvalchemi.md
  • doc/train/finetuning.md
  • doc/train/multi-task-training.md
  • doc/train/parallel-training.md
  • doc/train/tensorboard.md
  • doc/train/training.md
  • pyproject.toml

Comment thread doc/install/easy-install.md
Comment thread doc/model/dpa2.md
Comment thread doc/third-party/gromacs.md
Comment thread doc/train/finetuning.md
Comment thread doc/train/finetuning.md
njzjz-bot added 2 commits July 21, 2026 13:18
Fix command prompts and wording issues identified during review.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
Install documentation requirements with the Python executable from the Read the Docs virtual environment so the subsequent uv run can find Sphinx.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.62%. Comparing base (83e7245) to head (f762945).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5886      +/-   ##
==========================================
- Coverage   78.87%   78.62%   -0.26%     
==========================================
  Files        1054     1054              
  Lines      121770   121756      -14     
  Branches     4413     4403      -10     
==========================================
- Hits        96046    95730     -316     
- Misses      24159    24454     +295     
- Partials     1565     1572       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Restore the Read the Docs configuration to the master version so this pull request remains focused on GFM alerts.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
@njzjz
njzjz requested a review from wanghan-iapcm July 21, 2026 11:59

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clean, lossless migration. Verified: the full 83-admonition count reconciles (the 7-vs-8 warning gap is a capitalized :::{Warning} in easy-install.md), a bag-of-lines diff across all 58 files shows no dropped or added body text, danger->CAUTION is the only non-identity mapping, and nested :::{deprecated} inside > [!CAUTION] renders correctly under a real MyST-Parser 5.1 build. Config is consistent: the alert extension requires myst-parser>=5.1.0 (which is published on PyPI and requires python>=3.11, matching the environment.yml 3.11 bump and RTD's existing 3.11), and .readthedocs.yml nets to no change. Minor optional follow-ups: bump the myst-nb floor to >=1.4.0 to pin the validated pairing, and note that the [docs] extra now needs python>=3.11 while the package declares >=3.10 (no real impact since doc builds already use 3.11).

Pin myst-nb to the version validated with MyST-Parser 5.1 and document that the docs extra requires Python 3.11 or newer.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
Copilot AI review requested due to automatic review settings July 23, 2026 13:12
@njzjz

njzjz commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Addressed both optional follow-ups from #5886 (review) in f762945b:

  • raised the myst-nb floor to >=1.4.0, matching the pairing validated with MyST-Parser 5.1;
  • documented in doc/README that installing/building the docs extra requires Python 3.11 or newer, while the main package continues to support Python 3.10.

Validation: full-repository Ruff formatting/checks pass, the TOML pre-commit hook passes, and dependency resolution selects myst-nb 1.4.0 with myst-parser 5.1.0.

Coding agent: Codex
Codex version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning effort: xhigh

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 59 out of 59 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

doc/train/finetuning.md:1

  • This migration dropped the $ shell prompt from the command example (previously shown as $ dp ...). If the docs use prompts elsewhere for shell commands, consider restoring it here for consistency, or consistently removing prompts across the docs if that’s the new convention.
    doc/train/finetuning.md:1
  • Same as the earlier note: the $ shell prompt was removed during conversion. Consider keeping the prompt if that’s the established style for shell snippets in this documentation set, or standardize on prompt-free commands everywhere.

Comment thread doc/README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants