Skip to content

Commit 95b9418

Browse files
committed
Add Javadoc as static content to Hugo docs
Signed-off-by: Fabian Stäber <[email protected]>
1 parent 1d75a2d commit 95b9418

File tree

8 files changed

+98
-22
lines changed

8 files changed

+98
-22
lines changed

docs/README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,27 @@ Deploy to Github Pages
1717

1818
Changes to the `main` branch will be deployed automatically with Github actions.
1919

20-
Set-up Notes
21-
------------
20+
Update Javadoc
21+
--------------
22+
23+
Javadoc are not checked-in to the Github repository.
24+
They are generated on the fly by Github actions when the docs are updated.
25+
To view locally, run the following:
26+
27+
```
28+
# note that the 'compile' in the following command is necessary for Javadoc to detect the module structure
29+
./mvnw clean compile javadoc:javadoc javadoc:aggregate
30+
rm -r ./docs/static/api
31+
mv ./target/site/apidocs ./docs/static/api
32+
```
33+
34+
Update Geekdocs
35+
---------------
36+
37+
The docs use the [Geekdocs](https://geekdocs.de/) theme. The theme is checked in to Github in the `./docs/themes/hugo-geekdoc/` folder. To update [Geekdocs](https://geekdocs.de/), remove the current folder and create a new one with the latest [release](https://github.com/thegeeklab/hugo-geekdoc/releases). There are no local modifications in `./docs/themes/hugo-geekdoc/`.
38+
39+
Notes
40+
-----
2241

2342
Here's how the initial `docs/` folder was set up:
2443

@@ -30,8 +49,3 @@ curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/download/v0.41.1/hug
3049
```
3150

3251
Create the initial `hugo.toml` file as described in [https://geekdocs.de/usage/getting-started/](https://geekdocs.de/usage/getting-started/).
33-
34-
Update Geekdocs
35-
---------------
36-
37-
The docs use the [Geekdocs](https://geekdocs.de/) theme. The theme is checked in to Github in the `./docs/themes/hugo-geekdoc/` folder. To update [Geekdocs](https://geekdocs.de/), remove the current folder and create a new one with the latest [release](https://github.com/thegeeklab/hugo-geekdoc/releases). There are no local modifications in `./docs/themes/hugo-geekdoc/`.

docs/content/_index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
title: "client_java"
33
---
44

5+
This is the documentation for the upcoming `client_java` 1.0.0 release. These docs are currently in progress. Target for the release is end of September 2023.
6+
7+
<- the navigation on the left has the sections that are already available.
8+
59
Brainstorming of potential topics:
610

711
* Getting started
@@ -22,7 +26,7 @@ Brainstorming of potential topics:
2226
* Servlet filter
2327
* OpenTelemetry
2428
* OpenTelemetry exporter
25-
* Combining Prometheus `client_java` with the OpenTelemetry instrumentation agent.
29+
* Combining Prometheus client java with the OpenTelemetry instrumentation agent.
2630
* Trace sampling and Exemplars
2731
* API comparision: OpenTelemetry vs Prometheus
2832
* Performance comparison: OpenTelemetry vs Prometheus

docs/data/menu/extra.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
header:
3+
- name: GitHub
4+
ref: https://github.com/prometheus/client_java
5+
icon: gdoc_github
6+
external: true

docs/data/menu/more.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
more:
3+
- name: JavaDoc
4+
ref: "/api"
5+
external: true
6+
icon: "gdoc_bookmark"
7+
- name: Releases
8+
ref: "https://github.com/prometheus/client_java/releases"
9+
external: true
10+
icon: "gdoc_download"
11+
- name: Github
12+
ref: "https://github.com/prometheus/client_java"
13+
external: true
14+
icon: "gdoc_github"

docs/static/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
api

docs/static/custom.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Didn't find much time to create a theme yet,
3+
* so there are just a few non-default settings for now.
4+
*/
5+
:root,
6+
:root[color-theme="light"] {
7+
--header-background: #222222;
8+
--footer-background: #e6522c;
9+
--footer-link-color: #ffffff;
10+
--footer-link-color-visited: #ffffff;
11+
}
12+
13+
@media (prefers-color-scheme: light) {
14+
:root {
15+
--header-background: #222222;
16+
--footer-background: #e6522c;
17+
--footer-link-color: #ffffff;
18+
--footer-link-color-visited: #ffffff;
19+
}
20+
}
21+
22+
:root[color-theme="dark"]
23+
{
24+
--header-background: #111c24;
25+
--body-background: #1f1f21;
26+
--footer-background: #e6522c;
27+
--footer-link-color: #ffffff;
28+
--footer-link-color-visited: #ffffff;
29+
}
30+
31+
@media (prefers-color-scheme: dark) {
32+
:root {
33+
--header-background: #111c24;
34+
--body-background: #1f1f21;
35+
--footer-background: #e6522c;
36+
--footer-link-color: #ffffff;
37+
--footer-link-color-visited: #ffffff;
38+
}
39+
}

pom.xml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<packaging>pom</packaging>
45
<modelVersion>4.0.0</modelVersion>
56

@@ -224,25 +225,16 @@
224225
<artifactId>maven-surefire-plugin</artifactId>
225226
</plugin>
226227
<plugin>
227-
<groupId>org.apache.maven.plugins</groupId>
228228
<artifactId>maven-javadoc-plugin</artifactId>
229229
<configuration>
230230
<encoding>UTF-8</encoding>
231231
<docencoding>UTF-8</docencoding>
232232
<linksource>true</linksource>
233-
<source>8</source>
234-
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
235-
<sourcepath>src/main/java;src/main/generated</sourcepath>
233+
<noqualifier>all</noqualifier>
234+
<show>public</show>
235+
<skippedModules>benchmarks,examples,integration-tests,integration_tests,,simpleclient,simpleclient_bom,simpleclient_caffeine,simpleclient_common,simpleclient_dropwizard,simpleclient_graphite_bridge,simpleclient_guava,simpleclient_hibernate,simpleclient_hotspot,simpleclient_httpserver,simpleclient_jetty,simpleclient_jetty_jdk8,simpleclient_log4j,simpleclient_log4j2,simpleclient_logback,simpleclient_pushgateway,simpleclient_servlet,simpleclient_servlet_common,simpleclient_servlet_jakarta,simpleclient_spring_boot,simpleclient_spring_web,simpleclient_tracer,simpleclient_vertx,simpleclient_vertx4</skippedModules>
236+
<excludePackageNames>io.prometheus.metrics.expositionformats.generated.*</excludePackageNames>
236237
</configuration>
237-
<executions>
238-
<execution>
239-
<id>generate-javadoc-site-report</id>
240-
<phase>site</phase>
241-
<goals>
242-
<goal>aggregate</goal>
243-
</goals>
244-
</execution>
245-
</executions>
246238
</plugin>
247239
<plugin>
248240
<artifactId>maven-compiler-plugin</artifactId>

prometheus-metrics-exposition-formats/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@
7979
</execution>
8080
</executions>
8181
</plugin>
82+
<plugin>
83+
<artifactId>maven-javadoc-plugin</artifactId>
84+
<configuration>
85+
<sourcepath>src/main/java;src/main/generated</sourcepath>
86+
</configuration>
87+
</plugin>
8288
</plugins>
8389
</build>
8490
</project>

0 commit comments

Comments
 (0)