@ca-plant-list/ca-plant-list 0.4.44 → 0.4.45

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.
package/lib/tools/fna.js CHANGED
@@ -14,10 +14,18 @@ export class FNA {
14
14
  * @param {string} toolsDataDir
15
15
  * @param {string} dataDir
16
16
  * @param {import("../types.js").Taxa} taxa
17
+ * @param {import("../exceptions.js").Exceptions} exceptions
17
18
  * @param {import("../errorlog.js").ErrorLog} errorLog
18
19
  * @param {boolean} update
19
20
  */
20
- static async analyze(toolsDataDir, dataDir, taxa, errorLog, update) {
21
+ static async analyze(
22
+ toolsDataDir,
23
+ dataDir,
24
+ taxa,
25
+ exceptions,
26
+ errorLog,
27
+ update,
28
+ ) {
21
29
  const toolsDataPath = path.join(toolsDataDir, "fna");
22
30
  const fnaTaxa = await getFNATaxa(toolsDataPath);
23
31
 
@@ -25,9 +33,12 @@ export class FNA {
25
33
 
26
34
  for (const taxon of taxa.getTaxonList()) {
27
35
  const fnaName = getFNAName(taxon, fnaTaxa) ?? "";
36
+ const name = taxon.getName();
28
37
  const taxonFNAName = taxon.getFNAName();
29
- if (fnaName !== taxonFNAName) {
30
- const name = taxon.getName();
38
+ if (
39
+ fnaName !== taxonFNAName &&
40
+ !exceptions.hasException(name, "fna", "notintaxondata")
41
+ ) {
31
42
  errorLog.log(
32
43
  name,
33
44
  "FNA name does not match name from FNA data",
@@ -156,7 +156,7 @@ export class PageTaxon extends GenericPage {
156
156
  );
157
157
  html += "</div>";
158
158
 
159
- html += HTMLTaxon.getFooterHTML(this.#taxon);
159
+ html += HTMLTaxon.getFooterHTML(this.#taxon, "data");
160
160
 
161
161
  const photos = this.#taxon.getPhotos().slice(0, 5);
162
162
  if (photos.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ca-plant-list/ca-plant-list",
3
- "version": "0.4.44",
3
+ "version": "0.4.45",
4
4
  "description": "Tools to create files for a website listing plants in an area of California.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -77,7 +77,7 @@ async function buildBook(outputDir, dataDir, showFlowerErrors, maxTaxa) {
77
77
  );
78
78
 
79
79
  const config = new Config(dataDir);
80
- const ebook = new PlantBook(outputDir, config, taxa, maxTaxa);
80
+ const ebook = new PlantBook(outputDir, dataDir, config, taxa, maxTaxa);
81
81
  await ebook.create();
82
82
  errorLog.write();
83
83
  }
@@ -117,6 +117,7 @@ async function build(program, options) {
117
117
  TOOLS_DATA_DIR,
118
118
  options.datadir,
119
119
  taxa,
120
+ exceptions,
120
121
  errorLog,
121
122
  !!options.update,
122
123
  );