Skip to content

Commit e38cbd6

Browse files
authored
Merge pull request #18 from sbliven/master
Automatically generate Doc list
2 parents 75968ff + 5d80e83 commit e38cbd6

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

_wiki/documentation.md

Lines changed: 24 additions & 5 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy