Skip to content

Commit b569e58

Browse files
jimisolaJimisola Laursen
andauthored
docs: documentation overhaul (#78)
* docs: documentation overhaul - Standardize README.md with consistent badges and structure - Add CONTRIBUTING.md with repo-specific dev setup - Add/update Antora docs structure - Remove per-repo GitHub Pages workflow - Point documentation badge to central site Signed-off-by: jimisola <jimisola@jimisola.com> * docs: rewrite Antora docs using unified plugin template - Add description with features, quick start, minimal setup, prerequisites - Add configuration reference with complete example and individual params - Rewrite usage with basic usage, decorator dependency, lifecycle - Simplify license to uniform format - Remove separate installation.adoc (merged into description) - Simplify nav to single Start entry Signed-off-by: jimisola <jimisola@jimisola.com> * docs: streamline nav and page structure - Separate nav items instead of single include-based page - Merge description.adoc content into index.adoc - Remove license.adoc, add inline license to index.adoc - Change nav label from Start to Overview Signed-off-by: jimisola <jimisola@jimisola.com> * docs: fix Python prerequisite 3.10 → 3.13 Signed-off-by: jimisola <jimisola@jimisola.com> * docs: use lowercase reqstool consistently Signed-off-by: jimisola <jimisola@jimisola.com> --------- Signed-off-by: jimisola <jimisola@jimisola.com> Co-authored-by: Jimisola Laursen <jimisola.laursen@resurs.se>
1 parent 66472d6 commit b569e58

File tree

11 files changed

+206
-115
lines changed

11 files changed

+206
-115
lines changed

.github/workflows/publish_gh_pages.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing to reqstool-python-hatch-plugin
2+
3+
Thank you for your interest in contributing!
4+
5+
For DCO sign-off, commit conventions, and code review process, see the organization-wide [CONTRIBUTING.md](https://github.com/reqstool/.github/blob/main/CONTRIBUTING.md).
6+
7+
## Prerequisites
8+
9+
- Python 3.13+
10+
- [Hatch](https://hatch.pypa.io/) (`pip install hatch`)
11+
12+
## Setup
13+
14+
```bash
15+
git clone https://github.com/reqstool/reqstool-python-hatch-plugin.git
16+
cd reqstool-python-hatch-plugin
17+
hatch env create
18+
```
19+
20+
## Build & Test
21+
22+
```bash
23+
hatch build
24+
hatch run test
25+
```

README.md

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,28 @@
1-
21
[![Commit Activity](https://img.shields.io/github/commit-activity/m/reqstool/reqstool-python-hatch-plugin?label=commits&style=for-the-badge)](https://github.com/reqstool/reqstool-python-hatch-plugin/pulse)
32
[![GitHub Issues](https://img.shields.io/github/issues/reqstool/reqstool-python-hatch-plugin?style=for-the-badge&logo=github)](https://github.com/reqstool/reqstool-python-hatch-plugin/issues)
43
[![License](https://img.shields.io/github/license/reqstool/reqstool-python-hatch-plugin?style=for-the-badge&logo=opensourceinitiative)](https://opensource.org/license/mit/)
54
[![Build](https://img.shields.io/github/actions/workflow/status/reqstool/reqstool-python-hatch-plugin/build.yml?style=for-the-badge&logo=github)](https://github.com/reqstool/reqstool-python-hatch-plugin/actions/workflows/build.yml)
6-
[![Static Badge](https://img.shields.io/badge/Documentation-blue?style=for-the-badge&link=docs)](https://reqstool.github.io/reqstool-python-hatch-plugin/reqstool-python-hatch-plugin/0.0.2/index.html)
7-
8-
5+
[![Documentation](https://img.shields.io/badge/Documentation-blue?style=for-the-badge&link=docs)](https://reqstool.github.io)
96

10-
## Description
7+
# Reqstool Python Hatch Plugin
118

12-
This documentation provides information on how to use the Reqstool Hatch Plugin. The plugin is designed to be used with the Hatch build tool and facilitates the integration of the Reqstool Decorators in your project.
9+
Hatch build hook plugin for [reqstool](https://github.com/reqstool/reqstool-client) that collects decorated code and generates `annotations.yml` during `hatch build`.
1310

1411
## Installation
1512

16-
To use the Reqstool Hatch Plugin, follow these steps:
17-
18-
- Update your project dependencies in the `pyproject.toml` file and
19-
ensure that the Reqstool Decorators' dependency is listed as follows;
13+
Add to your `pyproject.toml`:
2014

2115
```toml
22-
dependencies = ["reqstool-python-decorators==<version>"]
16+
[build-system]
17+
requires = [
18+
"hatchling",
19+
"reqstool-python-hatch-plugin==<version>",
20+
]
2321
```
2422

25-
When you declare this in the pyproject.toml file, you are specifying the required versions for the dependency of the Reqstool Decorators. This ensures that the correct version of the dependencies are used when installing and running your project.
26-
27-
28-
2923
## Usage
3024

31-
### Configuration
32-
33-
The plugin can be configured through the `pyproject.toml` file. Configure plugin in `pyproject.toml`as follows;
25+
Configure the plugin in `pyproject.toml`:
3426

3527
```toml
3628
[tool.hatch.build.hooks.reqstool]
@@ -40,17 +32,16 @@ dataset_directory = "docs/reqstool"
4032
output_directory = "build/reqstool"
4133
```
4234

43-
And under `requires` in `[build-system]` you need to add the plugin with the version, see example;
35+
The plugin uses [reqstool-python-decorators](https://github.com/reqstool/reqstool-python-decorators) for processing.
4436

45-
```toml
46-
[build-system]
47-
requires = [
48-
"hatchling",
49-
"reqstool-python-hatch-plugin==<version>",
50-
]
51-
```
37+
## Documentation
38+
39+
Full documentation can be found [here](https://reqstool.github.io).
40+
41+
## Contributing
5242

43+
See the organization-wide [CONTRIBUTING.md](https://github.com/reqstool/.github/blob/main/CONTRIBUTING.md).
5344

54-
It specifies that the reqstool-python-hatch-plugin is a dependency for the build process, and it should be of a specific version.
45+
## License
5546

56-
Further it defines the paths where the plugin should be applied. In this case, it specifies that the plugin should be applied to files in the src and tests directories.
47+
MIT License.

docs/antora-playbook.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# yaml-language-server: $schema=https://raw.githubusercontent.com/asciidoctor/asciidoctor-intellij-plugin/main/src/main/resources/jsonSchemas/antoraPlaybookSchema.json
2+
# For local development only. Published site: https://reqstool.github.io
23

34
site:
45
title: Reqstool Hatch Plugin Documentation

docs/modules/ROOT/nav.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
* xref:index.adoc[Start]
2-
* xref:usage.adoc[Usage]
1+
* xref:index.adoc[Overview]
2+
* xref:configuration.adoc[Configuration]
3+
* xref:usage.adoc[Usage]
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
== Configuration
2+
3+
The plugin is configured in your `pyproject.toml` file under `[tool.hatch.build.hooks.reqstool]`.
4+
5+
=== Complete Configuration Example
6+
7+
[source,toml]
8+
----
9+
[tool.hatch.build.hooks.reqstool]
10+
# Build hook dependency
11+
dependencies = ["reqstool-python-hatch-plugin"]
12+
13+
# Directories to scan for decorators
14+
# Default: ["src", "tests"]
15+
sources = ["src", "tests"]
16+
17+
# Test result file pattern(s)
18+
# Default: "build/junit.xml"
19+
test_results = "build/junit.xml"
20+
21+
# Directory containing requirements.yml and optional files
22+
# Default: "docs/reqstool"
23+
dataset_directory = "docs/reqstool"
24+
25+
# Output directory for generated annotations
26+
# Default: "build/reqstool"
27+
output_directory = "build/reqstool"
28+
----
29+
30+
=== Configuration Parameters
31+
32+
==== sources
33+
34+
Directories to scan for `@Requirements` and `@SVCs` decorators.
35+
Defaults to `["src", "tests"]`.
36+
37+
[source,toml]
38+
----
39+
sources = ["src", "tests"]
40+
----
41+
42+
==== test_results
43+
44+
Path or pattern for test result files (JUnit XML).
45+
Defaults to `"build/junit.xml"`.
46+
47+
[source,toml]
48+
----
49+
test_results = "build/junit.xml"
50+
----
51+
52+
==== dataset_directory
53+
54+
Directory containing `requirements.yml` and optional reqstool files (`software_verification_cases.yml`, `manual_verification_results.yml`).
55+
Defaults to `"docs/reqstool"`.
56+
57+
[source,toml]
58+
----
59+
dataset_directory = "docs/reqstool"
60+
----
61+
62+
==== output_directory
63+
64+
Output directory for the generated `annotations.yml`.
65+
Defaults to `"build/reqstool"`.
66+
67+
[source,toml]
68+
----
69+
output_directory = "build/reqstool"
70+
----

docs/modules/ROOT/pages/description.adoc

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/modules/ROOT/pages/index.adoc

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,57 @@
1-
= Reqstool Python Hatch Plugin
1+
= reqstool Python Hatch Plugin
22

3-
include::description.adoc[]
3+
This Hatch build hook generates annotations and assembles reqstool data during `hatch build`. It collects decorated code using https://github.com/reqstool/reqstool-python-decorators[reqstool-python-decorators] and packages everything for consumption by the reqstool CLI.
44

5-
include::installation.adoc[]
5+
== Features
66

7-
include::license.adoc[]
7+
* *Hatch integration*: Runs automatically as a build hook during `hatch build`
8+
* *Combines annotations*: Collects `@Requirements` and `@SVCs` decorators from source and test code
9+
* *Assembles package data*: Includes requirements, test results, and annotations in the built package
10+
* *Generates config*: Creates a `reqstool_config.yml` with correct paths for the package structure
11+
12+
== Quick Start
13+
14+
== Add the Plugin
15+
16+
Add the build hook dependency to your `pyproject.toml`:
17+
18+
[source,toml]
19+
----
20+
[tool.hatch.build.hooks.reqstool]
21+
dependencies = ["reqstool-python-hatch-plugin"]
22+
----
23+
24+
== Default Behavior
25+
26+
The plugin automatically:
27+
28+
1. Runs during `hatch build`
29+
2. Scans source and test directories for `@Requirements` and `@SVCs` decorators
30+
3. Generates an `annotations.yml` file in `build/reqstool/`
31+
4. Creates a `reqstool_config.yml` with paths for the package structure
32+
5. Includes reqstool data in the built package (sdist/wheel)
33+
34+
== Minimal Setup
35+
36+
[source]
37+
----
38+
my-project/
39+
├── pyproject.toml
40+
├── docs/
41+
│ └── reqstool/
42+
│ └── requirements.yml (mandatory)
43+
├── src/
44+
└── tests/
45+
----
46+
47+
Run `hatch build` and the annotations will be generated automatically.
48+
49+
== Prerequisites
50+
51+
* Python 3.13+
52+
* https://hatch.pypa.io/[Hatch]
53+
* https://github.com/reqstool/reqstool-python-decorators[reqstool-python-decorators] as a project dependency
54+
55+
== License
56+
57+
MIT License.

docs/modules/ROOT/pages/installation.adoc

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/modules/ROOT/pages/license.adoc

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)