Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.52 KB

README.adoc

File metadata and controls

51 lines (37 loc) · 1.52 KB

Documentation Generator Example

Demonstrates how to generate documentation for Pkl modules.

To run this example, type ../gradlew build (requires JDK 17 or higher).

Walkthrough

Let’s generate documentation for module Bird.pkl.

Each documented module belongs to a package described by a doc-package-info.pkl file:

doc-package-info.pkl
/// Animals are living creatures inhabiting the planet Earth.
amends "pkl:DocPackageInfo"

name = "animal"
version = "1.2.3"
importUri = "modulepath:/animals/"
authors {
  "[email protected]"
}
sourceCode = "https://www.example.com/my/source"
issueTracker = "https://www.example.com/my/issues"

For more information on doc-package-info.pkl, see the pkl.DocPackageInfo standard library module.

Run the documentation generator:

$ java -cp <classpath-for-pkl-doc> \
    -jar pkl-doc.jar \
    -o build/pkldoc/pkldoc \
    Bird.pkl doc-package-info.pkl
Note
build.gradle.kts demonstrates how to generate documentation with the Gradle plugin.

Open build/pkldoc/pkldoc/index.html to browse the generated documentation.

Further Resources