Skip to content
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
8 changes: 4 additions & 4 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ An practical example is class [LCAO_Deepks](https://github.com/deepmodeling/abac

ABACUS includes a built-in help system that allows users to query INPUT parameters directly from the command line (e.g., `abacus -h ecutwfc`). Parameter metadata is defined inline in the C++ source files (`source/source_io/module_parameter/read_input_item_*.cpp`) using `Input_Item` registrations.

A checked-in file `docs/parameters.yaml` contains a YAML dump of all parameter metadata, generated from the binary itself. This file is used by Sphinx to produce the online documentation page `input-main.md`.
The C++ `Input_Item` registrations are the source of truth for parameter metadata. The checked-in `docs/parameters.yaml` and `docs/advanced/input_files/input-main.md` files are generated artifacts: do not edit either file manually. `parameters.yaml` is generated from the binary and is used by Sphinx to produce `input-main.md`.

### When to Update `docs/parameters.yaml`

Expand All @@ -198,13 +198,13 @@ Then verify the YAML is valid:
python3 -c "import yaml; d=yaml.safe_load(open('docs/parameters.yaml')); print(len(d['parameters']), 'parameters')"
```

You can also regenerate the markdown documentation locally:
Then regenerate the markdown documentation locally:

```bash
python3 docs/generate_input_main.py docs/parameters.yaml --output docs/advanced/input_files/input-main.md
```

**Important:** Include the updated `docs/parameters.yaml` and `input-main.md` in your commit when submitting a PR that modifies INPUT parameters. Reviewers should verify the YAML changes match the C++ source changes and the `input-main.md` is updated.
**Important:** Include the updated `docs/parameters.yaml` and `input-main.md` in your commit when submitting a PR that modifies INPUT parameters. CI regenerates both files from the built binary and rejects any mismatch. Do not fix a documentation mismatch by editing either generated file; update the C++ `Input_Item` registration and regenerate them instead.

### Parameter Documentation Format

Expand All @@ -218,7 +218,7 @@ When adding or modifying INPUT parameters in C++ source, set the following field
item.description = "Description of what this parameter does.";
item.default_value = "0";
item.unit = "Ry"; // Optional, empty string if no unit
item.availability = ""; // Optional, empty string if always available
item.set_availability("basis_type==pw"); // Optional; omit if always available
// ... read_value, reset_value, check_value functions ...
this->add_item(item);
}
Expand Down
359 changes: 179 additions & 180 deletions docs/advanced/input_files/input-main.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/developers_guide/agent_governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ or parsing behavior should include both:
- `docs/parameters.yaml`
- `docs/advanced/input_files/input-main.md`

These files are generated artifacts, not additional sources of truth. Update
the C++ `Input_Item` registrations and regenerate both files; do not edit the
YAML or Markdown output by hand.

If the diff touches parameter internals but does not change user-visible INPUT
behavior, the PR should state why no documentation update is required. Missing
documentation updates trigger a governance warning (not a block), but maintainers
Expand Down
Loading
Loading