Skip to content

Commit 27dfeee

Browse files
committed
more work on automatic generation of documentation
1 parent dc5ce72 commit 27dfeee

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

src/main/java/splitstree6/xtra/latex/AlgorithmsToLaTeX.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public static void main(String[] args) {
7474

7575
var options = OptionIO.optionsUsage(algorithm);
7676
if (!options.isBlank()) {
77+
buf.append("The algorithm has the following options:\n");
7778
buf.append("\n{\\footnotesize\\obeylines\n");
7879
for (var line : StringUtils.toList(options)) {
7980
var pos = line.indexOf("-");
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* AlgorithmsToLaTeX.java Copyright (C) 2024 Daniel H. Huson
3+
*
4+
* (Some files contain contributions from other authors, who are then mentioned separately.)
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
package splitstree6.xtra.latex;
21+
22+
import splitstree6.algorithms.AlgorithmList;
23+
import splitstree6.workflow.DataTaxaFilter;
24+
import splitstree6.workflow.interfaces.DoNotLoadThisAlgorithm;
25+
26+
import java.util.TreeSet;
27+
28+
/**
29+
* outputs a LaTeX document containing a description of all algorithms
30+
* Daniel Huson, 3.2024
31+
*/
32+
public class ExtractReferences {
33+
public static void main(String[] args) {
34+
var set = new TreeSet<String>();
35+
36+
for (var algorithm : AlgorithmList.list()) {
37+
if (!(algorithm instanceof DataTaxaFilter || algorithm instanceof DoNotLoadThisAlgorithm)) {
38+
39+
40+
var citations = algorithm.getCitation();
41+
if (citations != null && !citations.isBlank()) {
42+
var pos = citations.indexOf(";");
43+
if (pos > 0)
44+
citations = citations.substring(pos + 1);
45+
set.add(citations);
46+
}
47+
}
48+
}
49+
50+
for (var line : set) {
51+
System.out.println("\n- " + line);
52+
}
53+
54+
55+
}
56+
}

0 commit comments

Comments
 (0)