@ca-plant-list/ca-plant-list 0.4.18 → 0.4.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/data/genera.json +36 -32
  2. package/data/inattaxonphotos.csv +4 -0
  3. package/data/synonyms.csv +2 -0
  4. package/data/taxa.csv +6 -5
  5. package/data/text/Polypodium-calirhiza.md +1 -0
  6. package/data/text/Polypodium-scouleri.md +1 -0
  7. package/data/text/Rumex-conglomeratus.md +1 -0
  8. package/data/text/Rumex-obtusifolius.md +1 -0
  9. package/data/text/Rumex-pulcher.md +1 -0
  10. package/data/text/Rumex-salicifolius.md +1 -0
  11. package/lib/basepagerenderer.js +3 -3
  12. package/lib/ebook/glossarypages.js +3 -3
  13. package/lib/ebook/images.js +7 -7
  14. package/lib/ebook/pages/page_list_families.js +1 -1
  15. package/lib/ebook/pages/page_list_flower_color.js +2 -2
  16. package/lib/ebook/pages/page_list_flowers.js +8 -8
  17. package/lib/ebook/pages/page_list_species.js +1 -1
  18. package/lib/ebook/pages/taxonpage.js +2 -2
  19. package/lib/ebook/pages/tocpage.js +2 -2
  20. package/lib/ebook/plantbook.js +3 -3
  21. package/lib/externalsites.js +20 -15
  22. package/lib/families.js +14 -14
  23. package/lib/flowercolor.js +2 -2
  24. package/lib/genera.js +3 -3
  25. package/lib/htmltaxon.js +16 -7
  26. package/lib/index.d.ts +46 -1
  27. package/lib/pagerenderer.js +223 -220
  28. package/lib/photo.js +52 -31
  29. package/lib/plants/glossary.js +2 -4
  30. package/lib/program.js +10 -2
  31. package/lib/sitegenerator.js +13 -3
  32. package/lib/taxa.js +16 -12
  33. package/lib/taxon.js +12 -6
  34. package/lib/tools/calflora.js +41 -8
  35. package/lib/tools/calscape.js +4 -4
  36. package/lib/tools/inat.js +7 -7
  37. package/lib/tools/jepsoneflora.js +28 -4
  38. package/lib/tools/jepsonfamilies.js +102 -0
  39. package/lib/tools/rpi.js +8 -9
  40. package/lib/tools/supplementaltext.js +43 -0
  41. package/lib/tools/taxacsv.js +2 -2
  42. package/lib/utils/inat-tools.js +39 -2
  43. package/lib/web/glossarypages.js +6 -6
  44. package/lib/web/pagetaxon.js +4 -6
  45. package/package.json +10 -8
  46. package/scripts/cpl-photos.js +2 -2
  47. package/scripts/cpl-tools.js +11 -3
  48. package/scripts/inatobsphotos.js +10 -1
  49. package/scripts/inattaxonphotos.js +45 -43
  50. package/lib/inat_photo.js +0 -43
  51. package/types/classes.d.ts +0 -232
package/lib/genera.js CHANGED
@@ -6,7 +6,7 @@ class Genera {
6
6
  #genera;
7
7
 
8
8
  /**
9
- * @param {Families} families
9
+ * @param {import("./families.js").Families} families
10
10
  */
11
11
  constructor(families) {
12
12
  const dataDir = Config.getPackageDir() + "/data";
@@ -15,7 +15,7 @@ class Genera {
15
15
  }
16
16
 
17
17
  /**
18
- * @param {Taxon} taxon
18
+ * @param {import("./taxon.js").Taxon} taxon
19
19
  */
20
20
  addTaxon(taxon) {
21
21
  const genusName = taxon.getGenusName();
@@ -46,7 +46,7 @@ class Genus {
46
46
  #data;
47
47
 
48
48
  /**
49
- * @param {{family:string,familyObj:Family,taxa:Taxon[]}} data
49
+ * @param {{family:string,familyObj:import("./families.js").Family,taxa:import("./taxon.js").Taxon[]}} data
50
50
  */
51
51
  constructor(data) {
52
52
  this.#data = data;
package/lib/htmltaxon.js CHANGED
@@ -6,7 +6,15 @@ import { RarePlants } from "./rareplants.js";
6
6
  import { TextUtils } from "./textutils.js";
7
7
 
8
8
  /**
9
- * @type {Record<string,{title:string,data:function (Taxon):string}>}
9
+ * @typedef {{
10
+ class?: string;
11
+ data: (taxon: import("./taxon.js").Taxon) => string;
12
+ title: string;
13
+ }} TaxaColDef
14
+ */
15
+
16
+ /**
17
+ * @type {Record<string,TaxaColDef>}
10
18
  */
11
19
  const TAXA_LIST_COLS = {
12
20
  CESA: {
@@ -39,6 +47,7 @@ const TAXA_LIST_COLS = {
39
47
  },
40
48
  };
41
49
 
50
+ /** @type {TaxaColDef[]} */
42
51
  const DEFAULT_TAXA_COLUMNS = [
43
52
  TAXA_LIST_COLS.SPECIES,
44
53
  TAXA_LIST_COLS.COMMON_NAME,
@@ -46,7 +55,7 @@ const DEFAULT_TAXA_COLUMNS = [
46
55
 
47
56
  class HTMLTaxon {
48
57
  /**
49
- * @param {Taxon} taxon
58
+ * @param {import("./taxon.js").Taxon} taxon
50
59
  * @returns {string|undefined}
51
60
  */
52
61
  static getCalscapeLink(taxon) {
@@ -88,7 +97,7 @@ class HTMLTaxon {
88
97
  }
89
98
 
90
99
  /**
91
- * @param {Taxon} taxon
100
+ * @param {import("./taxon.js").Taxon} taxon
92
101
  * @param {string} classNames
93
102
  * @param {boolean} [includeColorLink=true]
94
103
  */
@@ -129,7 +138,7 @@ class HTMLTaxon {
129
138
  }
130
139
 
131
140
  /**
132
- * @param {Taxon} taxon
141
+ * @param {import("./taxon.js").Taxon} taxon
133
142
  * @returns {string}
134
143
  */
135
144
  static getFooterHTML(taxon) {
@@ -142,7 +151,7 @@ class HTMLTaxon {
142
151
  }
143
152
 
144
153
  /**
145
- * @param {Taxon} taxon
154
+ * @param {import("./taxon.js").Taxon} taxon
146
155
  */
147
156
  static getLink(taxon) {
148
157
  return (
@@ -182,8 +191,8 @@ class HTMLTaxon {
182
191
  }
183
192
 
184
193
  /**
185
- * @param {Taxon[]} taxa
186
- * @param {TaxaCol[]} [columns]
194
+ * @param {import("./taxon.js").Taxon[]} taxa
195
+ * @param {TaxaColDef[]} [columns]
187
196
  */
188
197
  static getTaxaTable(taxa, columns = DEFAULT_TAXA_COLUMNS) {
189
198
  let html = "<table><thead>";
package/lib/index.d.ts CHANGED
@@ -1,5 +1,29 @@
1
1
  import { Command } from "commander";
2
2
 
3
+ // Types
4
+
5
+ export type TaxonData = {
6
+ bloom_end: string;
7
+ bloom_start: string;
8
+ calrecnum: string;
9
+ calscape_cn?: string;
10
+ CESA: string;
11
+ "common name": string;
12
+ CRPR: string;
13
+ FESA: string;
14
+ flower_color: string;
15
+ GRank: string;
16
+ "inat id": string;
17
+ "jepson id": string;
18
+ life_cycle: string;
19
+ "RPI ID": string;
20
+ SRank: string;
21
+ status: "N" | "NC" | "U" | "X";
22
+ taxon_name: string;
23
+ };
24
+
25
+ // Classes
26
+
3
27
  export class Config {
4
28
  constructor(dataDir: string);
5
29
  getConfigValue(
@@ -79,11 +103,27 @@ export class Jekyll {
79
103
  static include(fileName: string): string;
80
104
  }
81
105
 
106
+ type PhotoRights = "CC0" | "CC BY" | "CC BY-NC" | "C" | null;
107
+
108
+ export class Photo {
109
+ getAttribution(): string;
110
+ getExt(): string;
111
+ getId(): number;
112
+ getSourceUrl(): string;
113
+ getUrl(): string;
114
+ }
115
+
82
116
  export class Program {
83
117
  static getIncludeList(dataDir: string): string[];
84
118
  static getProgram(): Command;
85
119
  }
86
120
 
121
+ export class Family {}
122
+
123
+ export class Genera {}
124
+
125
+ export class Genus {}
126
+
87
127
  export class Taxa {
88
128
  constructor(
89
129
  inclusionList: Record<string, TaxonData> | true,
@@ -91,7 +131,7 @@ export class Taxa {
91
131
  showFlowerErrors: boolean,
92
132
  taxonFactory?: (td: TaxonData, g: Genera) => Taxon,
93
133
  extraTaxa?: TaxonData[],
94
- extraSynonyms?: SynonymData[],
134
+ extraSynonyms?: Record<string, string>[],
95
135
  );
96
136
  getTaxon(name: string): Taxon;
97
137
  getTaxonList(): Taxon[];
@@ -101,14 +141,19 @@ export class Taxon {
101
141
  getBaseFileName(): string;
102
142
  getCalfloraID(): string;
103
143
  getCalfloraTaxonLink(): string;
144
+ getCESA(): string | undefined;
145
+ getCNDDBRank(): string | undefined;
104
146
  getCommonNames(): string[];
105
147
  getFamily(): Family;
148
+ getFESA(): string | undefined;
106
149
  getGenus(): Genus;
107
150
  getGenusName(): string;
151
+ getGlobalRank(): string | undefined;
108
152
  getINatID(): string;
109
153
  getINatTaxonLink(): string;
110
154
  getJepsonID(): string;
111
155
  getName(): string;
156
+ getPhotos(): Photo[];
112
157
  getRPIRankAndThreat(): string;
113
158
  getRPITaxonLink(): string;
114
159
  getSynonyms(): string[];
@@ -7,259 +7,262 @@ import { HTML } from "./html.js";
7
7
  import { HTMLTaxon, TAXA_LIST_COLS } from "./htmltaxon.js";
8
8
 
9
9
  const ENDANGERED_COLS = [
10
- TAXA_LIST_COLS.SPECIES,
11
- TAXA_LIST_COLS.COMMON_NAME,
12
- TAXA_LIST_COLS.CESA,
13
- TAXA_LIST_COLS.FESA,
10
+ TAXA_LIST_COLS.SPECIES,
11
+ TAXA_LIST_COLS.COMMON_NAME,
12
+ TAXA_LIST_COLS.CESA,
13
+ TAXA_LIST_COLS.FESA,
14
14
  ];
15
15
  const RPI_COLUMNS = [
16
- TAXA_LIST_COLS.SPECIES_BARE,
17
- TAXA_LIST_COLS.COMMON_NAME,
18
- TAXA_LIST_COLS.CNPS_RANK,
16
+ TAXA_LIST_COLS.SPECIES_BARE,
17
+ TAXA_LIST_COLS.COMMON_NAME,
18
+ TAXA_LIST_COLS.CNPS_RANK,
19
19
  ];
20
20
 
21
21
  class PageRenderer extends BasePageRenderer {
22
- /**
23
- * @param {string} outputDir
24
- * @param {import('./config.js').Config} config
25
- * @param {Taxa} taxa
26
- */
27
- static render(outputDir, config, taxa) {
28
- super.renderBasePages(outputDir, taxa);
22
+ /**
23
+ * @param {string} outputDir
24
+ * @param {import('./config.js').Config} config
25
+ * @param {import("./taxa.js").Taxa} taxa
26
+ */
27
+ static render(outputDir, config, taxa) {
28
+ super.renderBasePages(outputDir, taxa);
29
29
 
30
- this.renderLists(outputDir, config, taxa);
30
+ this.renderLists(outputDir, config, taxa);
31
31
 
32
- const taxonList = taxa.getTaxonList();
33
- for (const taxon of taxonList) {
34
- new PageTaxon(outputDir, config, taxon).render();
32
+ const taxonList = taxa.getTaxonList();
33
+ for (const taxon of taxonList) {
34
+ new PageTaxon(outputDir, config, taxon).render();
35
+ }
35
36
  }
36
- }
37
37
 
38
- /**
39
- * @param {string} outputDir
40
- * @param {Config} config
41
- * @param {Taxa} taxa
42
- */
43
- static renderLists(outputDir, config, taxa) {
44
38
  /**
45
- * @param {ListInfo[]} listInfo
46
- * @param {Object<string,string>} attributes
47
- * @param {TaxaCol[]} [columns]
48
- * @returns {string}
39
+ * @param {string} outputDir
40
+ * @param {import('./config.js').Config} config
41
+ * @param {import("./taxa.js").Taxa} taxa
49
42
  */
50
- function getListArray(listInfo, attributes = {}, columns) {
51
- const listArray = [];
52
- for (const list of listInfo) {
53
- const listTaxa = [];
54
- const calfloraTaxa = [];
55
- const iNatTaxa = [];
56
- for (const taxon of taxa.getTaxonList()) {
57
- if (list.include(taxon)) {
58
- listTaxa.push(taxon);
59
- calfloraTaxa.push(taxon.getCalfloraName());
60
- iNatTaxa.push(taxon.getINatName());
61
- }
62
- }
43
+ static renderLists(outputDir, config, taxa) {
44
+ /**
45
+ * @param {ListInfo[]} listInfo
46
+ * @param {Object<string,string>} attributes
47
+ * @param {import("./htmltaxon.js").TaxaColDef[]} [columns]
48
+ * @returns {string}
49
+ */
50
+ function getListArray(listInfo, attributes = {}, columns) {
51
+ const listArray = [];
52
+ for (const list of listInfo) {
53
+ const listTaxa = [];
54
+ const calfloraTaxa = [];
55
+ const iNatTaxa = [];
56
+ for (const taxon of taxa.getTaxonList()) {
57
+ if (list.include(taxon)) {
58
+ listTaxa.push(taxon);
59
+ calfloraTaxa.push(taxon.getCalfloraName());
60
+ iNatTaxa.push(taxon.getINatName());
61
+ }
62
+ }
63
63
 
64
- if (listTaxa.length === 0) {
65
- continue;
66
- }
64
+ if (listTaxa.length === 0) {
65
+ continue;
66
+ }
67
67
 
68
- Files.write(
69
- outputDir + "/calflora_" + list.filename + ".txt",
70
- calfloraTaxa.join("\n")
71
- );
72
- Files.write(
73
- outputDir + "/inat_" + list.filename + ".txt",
74
- iNatTaxa.join("\n")
75
- );
68
+ Files.write(
69
+ outputDir + "/calflora_" + list.filename + ".txt",
70
+ calfloraTaxa.join("\n"),
71
+ );
72
+ Files.write(
73
+ outputDir + "/inat_" + list.filename + ".txt",
74
+ iNatTaxa.join("\n"),
75
+ );
76
76
 
77
- const cols = columns ? columns : list.columns;
78
- new PageTaxonList(outputDir, list.name, list.filename).render(
79
- listTaxa,
80
- cols
81
- );
77
+ const cols = columns ? columns : list.columns;
78
+ new PageTaxonList(outputDir, list.name, list.filename).render(
79
+ listTaxa,
80
+ cols,
81
+ );
82
82
 
83
- // Check for sublists.
84
- const subListHTML = list.listInfo
85
- ? getListArray(list.listInfo, { class: "indent" }, cols)
86
- : "";
83
+ // Check for sublists.
84
+ const subListHTML = list.listInfo
85
+ ? getListArray(list.listInfo, { class: "indent" }, cols)
86
+ : "";
87
87
 
88
- listArray.push(
89
- HTML.getLink("./" + list.filename + ".html", list.name) +
90
- " (" +
91
- listTaxa.length +
92
- ")" +
93
- subListHTML
94
- );
95
- }
88
+ listArray.push(
89
+ HTML.getLink("./" + list.filename + ".html", list.name) +
90
+ " (" +
91
+ listTaxa.length +
92
+ ")" +
93
+ subListHTML,
94
+ );
95
+ }
96
96
 
97
- return renderList(listArray, attributes);
98
- }
97
+ return renderList(listArray, attributes);
98
+ }
99
99
 
100
- /**
101
- * @param {string[]} listsHTML
102
- * @param {Object<string,string>} attributes
103
- */
104
- function renderList(listsHTML, attributes = {}) {
105
- return HTML.wrap("ul", HTML.arrayToLI(listsHTML), attributes);
106
- }
100
+ /**
101
+ * @param {string[]} listsHTML
102
+ * @param {Object<string,string>} attributes
103
+ */
104
+ function renderList(listsHTML, attributes = {}) {
105
+ return HTML.wrap("ul", HTML.arrayToLI(listsHTML), attributes);
106
+ }
107
107
 
108
- /**
109
- * @param {string} title
110
- * @param {string} listsHTML
111
- */
112
- function renderSection(title, listsHTML) {
113
- let html = '<div class="section nobullet">';
114
- html += HTML.textElement("h2", title);
115
- html += listsHTML;
116
- html += "</div>";
117
- return html;
118
- }
108
+ /**
109
+ * @param {string} title
110
+ * @param {string} listsHTML
111
+ */
112
+ function renderSection(title, listsHTML) {
113
+ let html = '<div class="section nobullet">';
114
+ html += HTML.textElement("h2", title);
115
+ html += listsHTML;
116
+ html += "</div>";
117
+ return html;
118
+ }
119
119
 
120
- /** @typedef {{name:string,filename:string,include:function(Taxon):boolean,columns?:TaxaCol[],listInfo?:ListInfo[]}} ListInfo */
121
- /** @type {{title:string,listInfo:ListInfo[]}[]} */
122
- const sections = [
123
- {
124
- title: "All Species",
125
- listInfo: [
126
- {
127
- name: config.getLabel("native", "Native"),
128
- filename: "list_native",
129
- include: (t) => t.isNative(),
130
- },
131
- {
132
- name: config.getLabel("introduced", "Introduced"),
133
- filename: "list_introduced",
134
- include: (t) => !t.isNative(),
135
- },
136
- {
137
- name: "All Plants",
138
- filename: "list_all",
139
- include: () => true,
140
- },
141
- ],
142
- },
143
- {
144
- title: "Rare Plants",
145
- listInfo: [
146
- {
147
- name: "CNPS Ranked Plants",
148
- filename: "list_rpi",
149
- include: (t) => t.getRPIRank() !== undefined,
150
- columns: RPI_COLUMNS,
151
- listInfo: [
152
- {
153
- name: RarePlants.getRPIRankDescription("1A"),
154
- filename: "list_rpi_1a",
155
- include: (t) => t.getRPIRank() === "1A",
156
- },
157
- {
158
- name: RarePlants.getRPIRankDescription("1B"),
159
- filename: "list_rpi_1b",
160
- include: (t) => t.getRPIRank() === "1B",
161
- },
162
- {
163
- name: RarePlants.getRPIRankDescription("2A"),
164
- filename: "list_rpi_2a",
165
- include: (t) => t.getRPIRank() === "2A",
166
- },
167
- {
168
- name: RarePlants.getRPIRankDescription("2B"),
169
- filename: "list_rpi_2b",
170
- include: (t) => t.getRPIRank() === "2B",
171
- },
172
- {
173
- name: RarePlants.getRPIRankDescription("3"),
174
- filename: "list_rpi_3",
175
- include: (t) => t.getRPIRank() === "3",
176
- },
177
- {
178
- name: RarePlants.getRPIRankDescription("4"),
179
- filename: "list_rpi_4",
180
- include: (t) => t.getRPIRank() === "4",
181
- },
182
- ],
183
- },
184
- {
185
- name: "Endangered Species",
186
- filename: "list_endangered",
187
- include: (t) =>
188
- t.getCESA() !== undefined || t.getFESA() !== undefined,
189
- columns: ENDANGERED_COLS,
190
- },
191
- ],
192
- },
193
- ];
120
+ /** @typedef {{name:string,filename:string,include:function(import("./taxon.js").Taxon):boolean,columns?:import("./htmltaxon.js").TaxaColDef[],listInfo?:ListInfo[]}} ListInfo */
121
+ /** @type {{title:string,listInfo:ListInfo[]}[]} */
122
+ const sections = [
123
+ {
124
+ title: "All Species",
125
+ listInfo: [
126
+ {
127
+ name: config.getLabel("native", "Native"),
128
+ filename: "list_native",
129
+ include: (t) => t.isNative(),
130
+ },
131
+ {
132
+ name: config.getLabel("introduced", "Introduced"),
133
+ filename: "list_introduced",
134
+ include: (t) => !t.isNative(),
135
+ },
136
+ {
137
+ name: "All Plants",
138
+ filename: "list_all",
139
+ include: () => true,
140
+ },
141
+ ],
142
+ },
143
+ {
144
+ title: "Rare Plants",
145
+ listInfo: [
146
+ {
147
+ name: "CNPS Ranked Plants",
148
+ filename: "list_rpi",
149
+ include: (t) => t.getRPIRank() !== undefined,
150
+ columns: RPI_COLUMNS,
151
+ listInfo: [
152
+ {
153
+ name: RarePlants.getRPIRankDescription("1A"),
154
+ filename: "list_rpi_1a",
155
+ include: (t) => t.getRPIRank() === "1A",
156
+ },
157
+ {
158
+ name: RarePlants.getRPIRankDescription("1B"),
159
+ filename: "list_rpi_1b",
160
+ include: (t) => t.getRPIRank() === "1B",
161
+ },
162
+ {
163
+ name: RarePlants.getRPIRankDescription("2A"),
164
+ filename: "list_rpi_2a",
165
+ include: (t) => t.getRPIRank() === "2A",
166
+ },
167
+ {
168
+ name: RarePlants.getRPIRankDescription("2B"),
169
+ filename: "list_rpi_2b",
170
+ include: (t) => t.getRPIRank() === "2B",
171
+ },
172
+ {
173
+ name: RarePlants.getRPIRankDescription("3"),
174
+ filename: "list_rpi_3",
175
+ include: (t) => t.getRPIRank() === "3",
176
+ },
177
+ {
178
+ name: RarePlants.getRPIRankDescription("4"),
179
+ filename: "list_rpi_4",
180
+ include: (t) => t.getRPIRank() === "4",
181
+ },
182
+ ],
183
+ },
184
+ {
185
+ name: "Endangered Species",
186
+ filename: "list_endangered",
187
+ include: (t) =>
188
+ t.getCESA() !== undefined ||
189
+ t.getFESA() !== undefined,
190
+ columns: ENDANGERED_COLS,
191
+ },
192
+ ],
193
+ },
194
+ ];
194
195
 
195
- let html = '<div class="wrapper">';
196
- for (const section of sections) {
197
- const listHTML = getListArray(section.listInfo);
196
+ let html = '<div class="wrapper">';
197
+ for (const section of sections) {
198
+ const listHTML = getListArray(section.listInfo);
198
199
 
199
- if (listHTML.length > 0) {
200
- html += renderSection(section.title, listHTML);
201
- }
202
- }
203
- html += renderSection(
204
- "Taxonomy",
205
- renderList([HTML.getLink("./list_families.html", "Plant Families")])
206
- );
200
+ if (listHTML.length > 0) {
201
+ html += renderSection(section.title, listHTML);
202
+ }
203
+ }
204
+ html += renderSection(
205
+ "Taxonomy",
206
+ renderList([
207
+ HTML.getLink("./list_families.html", "Plant Families"),
208
+ ]),
209
+ );
207
210
 
208
- html += "</div>";
211
+ html += "</div>";
209
212
 
210
- // Write lists to includes directory so it can be inserted into pages.
211
- Files.write(outputDir + "/_includes/plantlists.html", html);
212
- }
213
+ // Write lists to includes directory so it can be inserted into pages.
214
+ Files.write(outputDir + "/_includes/plantlists.html", html);
215
+ }
213
216
  }
214
217
 
215
218
  class PageTaxonList extends GenericPage {
216
- /**
217
- * @param {string} outputDir
218
- * @param {string} title
219
- * @param {string} baseName
220
- */
221
- constructor(outputDir, title, baseName) {
222
- super(outputDir, title, baseName);
223
- }
219
+ /**
220
+ * @param {string} outputDir
221
+ * @param {string} title
222
+ * @param {string} baseName
223
+ */
224
+ constructor(outputDir, title, baseName) {
225
+ super(outputDir, title, baseName);
226
+ }
224
227
 
225
- /**
226
- *
227
- * @param {Taxon[]} taxa
228
- * @param {TaxaCol[]|undefined} columns
229
- */
230
- render(taxa, columns) {
231
- let html = this.getDefaultIntro();
228
+ /**
229
+ *
230
+ * @param {import("./taxon.js").Taxon[]} taxa
231
+ * @param {import("./htmltaxon.js").TaxaColDef[]|undefined} columns
232
+ */
233
+ render(taxa, columns) {
234
+ let html = this.getDefaultIntro();
232
235
 
233
- html += '<div class="wrapper">';
236
+ html += '<div class="wrapper">';
234
237
 
235
- html += '<div class="section">';
236
- html += HTMLTaxon.getTaxaTable(taxa, columns);
237
- html += "</div>";
238
+ html += '<div class="section">';
239
+ html += HTMLTaxon.getTaxaTable(taxa, columns);
240
+ html += "</div>";
238
241
 
239
- html += '<div class="section nobullet">';
240
- html += HTML.textElement("h2", "Download");
241
- html += "<ul>";
242
- html +=
243
- "<li>" +
244
- HTML.getLink(
245
- "./calflora_" + this.getBaseFileName() + ".txt",
246
- "Calflora List"
247
- ) +
248
- "</li>";
249
- html +=
250
- "<li>" +
251
- HTML.getLink(
252
- "./inat_" + this.getBaseFileName() + ".txt",
253
- "iNaturalist List"
254
- ) +
255
- "</li>";
256
- html += "</ul>";
257
- html += "</div>";
242
+ html += '<div class="section nobullet">';
243
+ html += HTML.textElement("h2", "Download");
244
+ html += "<ul>";
245
+ html +=
246
+ "<li>" +
247
+ HTML.getLink(
248
+ "./calflora_" + this.getBaseFileName() + ".txt",
249
+ "Calflora List",
250
+ ) +
251
+ "</li>";
252
+ html +=
253
+ "<li>" +
254
+ HTML.getLink(
255
+ "./inat_" + this.getBaseFileName() + ".txt",
256
+ "iNaturalist List",
257
+ ) +
258
+ "</li>";
259
+ html += "</ul>";
260
+ html += "</div>";
258
261
 
259
- html += "</div>";
262
+ html += "</div>";
260
263
 
261
- this.writeFile(html);
262
- }
264
+ this.writeFile(html);
265
+ }
263
266
  }
264
267
 
265
268
  export { PageRenderer };