Skip to content

Commit 5d80e83

Browse files
committed
Automatically generate Doc list
After each release, run `mvn site` from biojava. Copy `target/site/apidocs` to this repository, `docs/api<version>`. Update docs/api to link to the most recent release. The version list at `/wiki/Documentation` will automatically reflect all versions in the docs folder.
1 parent 75968ff commit 5d80e83

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

_wiki/documentation.md

+24-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,27 @@ The Javadoc APIs
2424

2525
And finally the collection of Javadoc APIs. The link will take you to the generated HTML version of the Javadoc. You can choose from the following versions:
2626

27-
- [Javadoc API for BioJava 5.0.0]({{site.baseurl}}/docs/api5.0.0/index.html)
28-
- [Javadoc API for BioJava 4.2.9]({{site.baseurl}}/docs/api4.2.9/index.html)
29-
- [Javadoc API for BioJava 4.2.1]({{site.baseurl}}/docs/api4.2.1/index.html)
30-
- [Javadoc API for BioJava 4.2.0]({{site.baseurl}}/docs/api4.2.0/index.html)
31-
- [Javadoc API for BioJava legacy 1.9.1]({{site.baseurl}}/docs/api1.9.1/index.html)
27+
{% comment %}
28+
List all biojava versions.
29+
30+
Relies on site.static_files, which lists all static files. Matches /docs/api<version>/*
31+
32+
Note that the split starts with an empty "", so the api is in position 2. Directories are not
33+
enumerated, so we get it from each file and then get a unique list as a second step.
34+
35+
Adds about 40s to the build time.
36+
{% endcomment %}
37+
{%- capture versions -%}
38+
{%- for file in site.static_files-%}
39+
{%- assign splitpath = file.path | split: '/' -%}
40+
{%- if splitpath.size == 4 and splitpath[1] == "docs" and splitpath[2] contains "api" -%}
41+
{{splitpath[2]|replace_first:"api", ""}},
42+
{%- endif -%}
43+
{%- endfor %}
44+
{%- endcapture -%}
45+
{%- assign uniq_versions = versions | split: "," | uniq | sort_natural | reverse-%}
46+
{% for version in uniq_versions %}
47+
{%- if version != "" -%}
48+
* [Javadoc API for BioJava {% if version < "3.0.0" %}legacy {% endif %}{{version}}]({{site.baseurl}}/docs/api{{version}}/index.html)
49+
{% endif -%}
50+
{% endfor %}

0 commit comments

Comments
 (0)