Skip to content

Commit

Permalink
docs: produce documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TendTo committed Jun 12, 2024
1 parent 66c0ef5 commit 2e7ad1c
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ The build will fail with an error message containing the correct SHA256.
Download from https://github.com/doxygen/doxygen/releases/download/Release_1_10_0/doxygen-1.10.0.windows.x64.bin.zip failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Checksum was 2135c1d5bdd6e067b3d0c40a4daac5d63d0fee1b3f4d6ef1e4f092db0d632d5b but wanted 0000000000000000000000000000000000000000000000000000000000000000
```

> [!Note]
> See [the documentation](docs/extensions_doc.md) for more information.
## Use

The main macro exposed by this module is `doxygen`.
Expand Down Expand Up @@ -78,7 +81,7 @@ Use the [Doxygen documentation](https://www.doxygen.nl/manual/config.html) or ge
They will simply be appended at the end of the file, overriding the default values.

> [!Note]
> See the [examples](examples) directory for examples of how to use the rules.
> See the [documentation](docs/doxygen_doc.md) for more information or the [examples](examples) directory for examples of how to use the rules.
## Build

Expand Down
52 changes: 52 additions & 0 deletions docs/doxygen_doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->

Doxygen rule for Bazel.

<a id="doxygen"></a>

## doxygen

<pre>
doxygen(<a href="#doxygen-name">name</a>, <a href="#doxygen-srcs">srcs</a>, <a href="#doxygen-project_name">project_name</a>, <a href="#doxygen-project_brief">project_brief</a>, <a href="#doxygen-configurations">configurations</a>, <a href="#doxygen-outs">outs</a>)
</pre>

Generates documentation using Doxygen.

### Example

```starlark
# MODULE.bazel file
bazel_dep(name = "rules_doxygen", dev_dependency = True)
doxygen_extension = use_extension("@rules_doxygen//:extensions.bzl", "doxygen_extension")
use_repo(doxygen_extension, "doxygen")
```

```starlark
# BUILD.bazel file
load("@doxygen//:doxygen.bzl", "doxygen")

doxygen(
name = "doxygen",
srcs = glob([
"*.h",
"*.cpp",
]),
project_brief = "Example project for doxygen",
project_name = "example",
)
```


**PARAMETERS**


| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="doxygen-name"></a>name | A name for the target. | none |
| <a id="doxygen-srcs"></a>srcs | A list of source files to generate documentation for. | none |
| <a id="doxygen-project_name"></a>project_name | The name of the project. | `None` |
| <a id="doxygen-project_brief"></a>project_brief | A brief description of the project. | `None` |
| <a id="doxygen-configurations"></a>configurations | A list of additional configuration parameters to pass to Doxygen. | `[]` |
| <a id="doxygen-outs"></a>outs | The output folders bazel will keep. If only the html outputs is of interest, the default value will do. otherwise, a list of folders to keep is expected (e.g. ["html", "latex"]). | `["html"]` |


48 changes: 48 additions & 0 deletions docs/extensions_doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->

Repository rule for downloading the correct version of doxygen using module extensions.

<a id="doxygen_extension"></a>

## doxygen_extension

<pre>
doxygen_extension = use_extension("@rules_doxygen//:extensions.bzl", "doxygen_extension")
doxygen_extension.version(<a href="#doxygen_extension.version-sha256">sha256</a>, <a href="#doxygen_extension.version-version">version</a>)
</pre>

Module extension for declaring the doxygen version to use.

The resulting repository will have the following targets:
- `@doxygen//:doxygen.bzl`, containing the doxygen macro used to generate the documentation.
- `@doxygen//:Doxyfile` Doxyfile configuration file to use.
- `@doxygen//:Doxyfile.template`, Doxyfile template used to generate the Doxyfile.

### Example

```starlark
bazel_dep(name = "rules_doxygen", version = "...", dev_dependency = True)

doxygen_extension = use_extension("@rules_doxygen//:extensions.bzl", "doxygen_extension")

# Using the 1.10.0 version of Doxygen on Windows instead of the default 1.11.0
doxygen_extension.version(version = "1.10.0", sha256 = "2135c1d5bdd6e067b3d0c40a4daac5d63d0fee1b3f4d6ef1e4f092db0d632d5b")

use_repo(doxygen_extension, "doxygen")
```


**TAG CLASSES**

<a id="doxygen_extension.version"></a>

### version

**Attributes**

| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="doxygen_extension.version-sha256"></a>sha256 | The sha256 hash of the doxygen archive. If not specified, an all-zero hash will be used. | String | optional | `""` |
| <a id="doxygen_extension.version-version"></a>version | The version of doxygen to use | String | required | |


0 comments on commit 2e7ad1c

Please sign in to comment.