@ca-plant-list/ca-plant-list 0.3.3 → 0.3.4
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/data/glossary/calyx.md +1 -0
- package/data/glossary/pedicel.md +1 -0
- package/data/glossary/sepal.md +1 -0
- package/data/synonyms.csv +0 -1
- package/data/taxa.csv +23 -20
- package/data/text/Calochortus-argillosus.md +1 -0
- package/data/text/Calochortus-luteus.md +1 -0
- package/data/text/Calochortus-venustus.md +1 -0
- package/data/text/Claytonia-parviflora.md +1 -0
- package/data/text/Claytonia-perfoliata.md +1 -0
- package/data/text/Collinsia-heterophylla-var-heterophylla.md +1 -0
- package/data/text/Leptosiphon-ambiguus.md +1 -0
- package/data/text/Leptosiphon-androsaceus.md +1 -0
- package/data/text/Leptosiphon-bicolor.md +1 -1
- package/data/text/Leptosiphon-parviflorus.md +1 -0
- package/lib/basepagerenderer.js +1 -2
- package/lib/ebook/pages/page_list_families.js +15 -9
- package/lib/ebook/plantbook.js +82 -48
- package/lib/families.js +5 -8
- package/lib/genera.js +40 -26
- package/lib/index.js +1 -1
- package/lib/taxa.js +12 -2
- package/lib/taxon.js +10 -5
- package/package.json +1 -1
- package/scripts/build-ebook.js +3 -0
@@ -0,0 +1 @@
|
|
1
|
+
The collection of [sepals](./sepal.html) on a flower.
|
@@ -0,0 +1 @@
|
|
1
|
+
A stalk supporting a single flower.
|
@@ -0,0 +1 @@
|
|
1
|
+
A leaf-like or petal-like part of the flower, generally just below the petals.
|
package/data/synonyms.csv
CHANGED
@@ -25,7 +25,6 @@ Achnatherum lemmonii subsp. lemmonii,Stipa lemmonii var. lemmonii
|
|
25
25
|
Acmispon strigosus var. hirtellus,Acmispon strigosus
|
26
26
|
Acroptilon repens,Rhaponticum repens
|
27
27
|
Actaea rubra subsp. arguta,Actaea rubra
|
28
|
-
Adelinia grandis,Adelinia grandis,INAT
|
29
28
|
Adiantum boreale,Adiantum aleuticum
|
30
29
|
Adiantum pedatum subsp. calderi,Adiantum aleuticum
|
31
30
|
Adiantum pedatum var. aleuticum,Adiantum aleuticum
|
package/data/taxa.csv
CHANGED
@@ -22,7 +22,8 @@ Acmispon americanus var. americanus,Spanish-clover,N,91832,11269,57053,"white,pi
|
|
22
22
|
Acmispon brachycarpus,woolly trefoil,N,91705,11276,57047
|
23
23
|
Acmispon denticulatus,meadow trefoil,N,91708,11279,60194
|
24
24
|
Acmispon glaber var. glaber,California broom,N,91825,11282,58900,yellow,3,8
|
25
|
-
Acmispon junceus var. biolettii,,N,91830,11290,80314
|
25
|
+
Acmispon junceus var. biolettii,,N,91830,11290,80314,yellow,4,7
|
26
|
+
Acmispon junceus var. junceus,,N,91831,11291,80315,yellow,4,7
|
26
27
|
Acmispon parviflorus,least trefoil,N,91717,11299,57048
|
27
28
|
Acmispon strigosus,,N,91722,11305,75281
|
28
29
|
Acmispon wrangelianus,common trefoil,N,82483,11306,57050
|
@@ -108,8 +109,8 @@ Anthoxanthum occidentale,,N,13521,11332,75474
|
|
108
109
|
Anthriscus caucalis,bur-chervil,X,13523,396,52846,white
|
109
110
|
Antirrhinum kelloggii,,N,13568,401,165675
|
110
111
|
Antirrhinum majus,snapdragon,X,13557,404,48969
|
111
|
-
Antirrhinum thompsonii,Sierra snapdragon,N,108978,14286,168306
|
112
|
-
Antirrhinum vexillocalyculatum subsp. vexillocalyculatum,,N,88873,10499,840919
|
112
|
+
Antirrhinum thompsonii,Sierra snapdragon,N,108978,14286,168306,pink,4,8
|
113
|
+
Antirrhinum vexillocalyculatum subsp. vexillocalyculatum,,N,88873,10499,840919,purple,6,8
|
113
114
|
Aphanes occidentalis,,N,13608,420,866483
|
114
115
|
Aphyllon californicum subsp. jepsonii,,N,103325,13438,802459
|
115
116
|
Aphyllon epigalium subsp. epigalium,,N,103327,13527,809377
|
@@ -265,16 +266,16 @@ Callitriche heterophylla var. bolanderi,,N,55448,1257,60158
|
|
265
266
|
Callitriche longipedunculata,,N,16691,11443,75936
|
266
267
|
Callitriche marginata,water-starwort,N,16692,1259,58093
|
267
268
|
Callitriche trochlearis,,N,16702,1261,69994
|
268
|
-
Calochortus albus,white globe lily,N,16710,1264,51315,white
|
269
|
-
Calochortus argillosus,clay mariposa lily,N,76542,1268,64330,"white,pink"
|
269
|
+
Calochortus albus,white globe lily,N,16710,1264,51315,white,4,6
|
270
|
+
Calochortus argillosus,clay mariposa lily,N,76542,1268,64330,"white,pink",4,6
|
270
271
|
Calochortus clavatus var. pallidus,,N,55455,1275,58360
|
271
272
|
Calochortus invenustus,,N,16733,1284,64432
|
272
273
|
Calochortus leichtlinii,,N,16735,1288,52542
|
273
|
-
Calochortus luteus,yellow mariposa lily,N,16737,1290,51077,yellow
|
274
|
+
Calochortus luteus,yellow mariposa lily,N,16737,1290,51077,yellow,4,6
|
274
275
|
Calochortus pulchellus,Mt. Diablo fairy lantern,N,16755,1303,47326,,,,50,1B.2,,,S2,G2
|
275
276
|
Calochortus splendens,,N,16759,1306,58361
|
276
|
-
Calochortus umbellatus,Oakland star-tulip,N,16769,1311,51054
|
277
|
-
Calochortus venustus
|
277
|
+
Calochortus umbellatus,Oakland star-tulip,N,16769,1311,51054,white,,,55,4.2,,,S3?,G3?
|
278
|
+
Calochortus venustus,butterfly mariposa lily,N,16772,1313,53902,"white,red",5,7
|
278
279
|
Caltha palustris,marsh-marigold,X,16802,8708,56224
|
279
280
|
Calycadenia multiglandulosa,,N,1875,1324,56863
|
280
281
|
Calycadenia truncata,rosin weed,N,1884,1328,62567
|
@@ -402,13 +403,13 @@ Cicuta douglasii,water hemlock,N,19447,2109,76338
|
|
402
403
|
Cicuta maculata var. bolanderi,water hemlock,N,56538,2111,60118,,,,2178,2B.1,,,S2?,G5T4T5
|
403
404
|
Cirsium andrewsii,Franciscan thistle,N,2094,2116,55294,,,,479,1B.2,,,S3,G3
|
404
405
|
Cirsium brevistylum,Indian thistle,N,2110,2119,52993
|
405
|
-
Cirsium cymosum var. cymosum,peregrine thistle,N,85528,11529,80584
|
406
|
+
Cirsium cymosum var. cymosum,peregrine thistle,N,85528,11529,80584,white,4,7
|
406
407
|
Cirsium douglasii var. douglasii,swamp thistle,N,7046,2127,80586
|
407
408
|
Cirsium fontinale var. campylon,Hamilton thistle,N,77400,2129,59750,,,,480,1B.2,,,S2,G2T2
|
408
409
|
Cirsium occidentale var. californicum,California thistle,N,77401,2140,52622
|
409
410
|
Cirsium occidentale var. coulteri,,N,81843,11531,80593
|
410
411
|
Cirsium occidentale var. occidentale,cobweb thistle,N,7069,2143,52623
|
411
|
-
Cirsium occidentale var. venustum,venus thistle,N,56557,2144,52624
|
412
|
+
Cirsium occidentale var. venustum,venus thistle,N,56557,2144,52624,red,5,7
|
412
413
|
Cirsium quercetorum,brownie thistle,N,2232,2146,60954
|
413
414
|
Cirsium remotifolium var. odontolepis,,N,7076,11533,80596
|
414
415
|
Cirsium vulgare,bull thistle,X,2285,2151,52989
|
@@ -443,7 +444,7 @@ Clintonia andrewsiana,,N,19850,2265,51647
|
|
443
444
|
Collinsia bartsiifolia var. bartsiifolia,,N,56710,2272,80607
|
444
445
|
Collinsia bartsiifolia var. davidsonii,,N,56711,2273,58330
|
445
446
|
Collinsia bartsiifolia var. stricta,,N,56713,9818,80608
|
446
|
-
Collinsia heterophylla,Chinese houses,N,19994,2280,47325
|
447
|
+
Collinsia heterophylla var. heterophylla,Chinese houses,N,19994,2280,47325,"white,purple",3,6
|
447
448
|
Collinsia parviflora,blue-eyed mary,N,20000,2285,59013
|
448
449
|
Collinsia sparsiflora var. collina,,N,56722,2290,57290
|
449
450
|
Collinsia sparsiflora var. sparsiflora,,N,56723,2291,64295
|
@@ -1002,15 +1003,15 @@ Lepidium strictum,,N,30566,4710,58865
|
|
1002
1003
|
Lepidospartum squamatum,California broomsage,N,3776,4718,58010
|
1003
1004
|
Leptochloa fusca subsp. fascicularis,bearded sprangletop,N,80525,11795,1377298
|
1004
1005
|
Leptochloa fusca subsp. uninervia,Mexican sprangletop,N,80527,11796,1377299
|
1005
|
-
Leptosiphon ambiguus,serpentine linanthus,N,80953,8945,58970
|
1006
|
-
Leptosiphon androsaceus,,N,81151,9556,58969
|
1006
|
+
Leptosiphon ambiguus,serpentine linanthus,N,80953,8945,58970,pink,4,5,1717,4.2,,,S4,G4
|
1007
|
+
Leptosiphon androsaceus,,N,81151,9556,58969,"white,pink",4,6
|
1007
1008
|
Leptosiphon aureus,,N,84733,10055,854272,,,,1716,4.2,,,S4?,G4?
|
1008
|
-
Leptosiphon bicolor,bicolored linanthus,N,81148,9559,64245
|
1009
|
+
Leptosiphon bicolor,bicolored linanthus,N,81148,9559,64245,"pink,white",3,6
|
1009
1010
|
Leptosiphon bolanderi,,N,81742,9560,77682
|
1010
|
-
Leptosiphon ciliatus,whisker brush,N,81150,10056,77684
|
1011
|
-
Leptosiphon grandiflorus,large-flowered linanthus,N,80378,8948,77688
|
1011
|
+
Leptosiphon ciliatus,whisker brush,N,81150,10056,77684,"pink,white",3,7
|
1012
|
+
Leptosiphon grandiflorus,large-flowered linanthus,N,80378,8948,77688,"white,pink",4,7,1718,4.2,,,S3S4,G3G4
|
1012
1013
|
Leptosiphon liniflorus,,N,80375,9565,64244
|
1013
|
-
Leptosiphon parviflorus,,N,80366,9571,58965
|
1014
|
+
Leptosiphon parviflorus,,N,80366,9571,58965,"white,yellow,pink",3,6
|
1014
1015
|
Leptosiphon pygmaeus subsp. continentalis,,N,80364,9572,79984
|
1015
1016
|
Leptosyne calliopsidea,,N,89031,10950,77707
|
1016
1017
|
Leptosyne hamiltonii,Mt. Hamilton coreopsis,N,30648,10953,77710,,,,510,1B.2,,,S2,G2
|
@@ -1269,8 +1270,8 @@ Pennisetum clandestinum,Kikuyu grass,X,36818,6132,60298
|
|
1269
1270
|
Pennisetum setaceum,fountain grass,X,36827,6133,430581
|
1270
1271
|
Pennisetum villosum,,X,36829,6134,430578
|
1271
1272
|
Penstemon centranthifolius,scarlet bugler,N,36894,6146,56752
|
1272
|
-
Penstemon heterophyllus var. heterophyllus,chaparral penstemon,N,75906,6178,51852
|
1273
|
-
Penstemon heterophyllus var. purdyi,foothill penstemon,N,76773,6179,81205
|
1273
|
+
Penstemon heterophyllus var. heterophyllus,chaparral penstemon,N,75906,6178,51852,purple,4,7
|
1274
|
+
Penstemon heterophyllus var. purdyi,foothill penstemon,N,76773,6179,81205,purple,5,6
|
1274
1275
|
Pentachaeta alsinoides,tiny pygmy daisy,N,4273,6225,58844
|
1275
1276
|
Pentachaeta exilis subsp. exilis,meager pygmy daisy,N,6171,6230,58846
|
1276
1277
|
Pentagramma triangularis,goldback fern,N,77119,6234,52676
|
@@ -1326,6 +1327,7 @@ Pickeringia montana var. montana,chaparral pea,N,63765,6497,58908
|
|
1326
1327
|
Pilularia americana,pillwort,N,38232,6501,57885
|
1327
1328
|
Pinus attenuata,knobcone pine,N,38257,6504,64047
|
1328
1329
|
Pinus coulteri,Coulter pine,N,38266,6512,67330
|
1330
|
+
Pinus ponderosa var. pacifica,Ponderosa pine,N,93845,,48461
|
1329
1331
|
Pinus radiata,Monterey pine,N,38300,6523,53421,,,,1378,1B.1,,,S1,G1
|
1330
1332
|
Pinus sabiniana,"gray pine,foothill pine",N,38304,6524,58772
|
1331
1333
|
Piperia elegans subsp. elegans,coast piperia,N,74709,8857,840643
|
@@ -1469,7 +1471,7 @@ Ranunculus aquatilis var. aquatilis,,N,73500,10676,81320
|
|
1469
1471
|
Ranunculus aquatilis var. diffusus,water buttercup,N,80687,11969,486980
|
1470
1472
|
Ranunculus californicus,California buttercup,N,40867,7032,52173,yellow
|
1471
1473
|
Ranunculus canus var. canus,,N,73506,11972,81324
|
1472
|
-
Ranunculus hebecarpus
|
1474
|
+
Ranunculus hebecarpus,pubescent-fruited buttercup,N,40898,7044,57239,green,3,5
|
1473
1475
|
Ranunculus lobbii,Lobb's buttercup,N,40925,7046,68424,,,,1414,4.2,,,S3,G4
|
1474
1476
|
Ranunculus muricatus,spiny buttercup,X,40938,7048,57240
|
1475
1477
|
Ranunculus occidentalis var. occidentalis,,N,64947,11979,81335
|
@@ -1817,6 +1819,7 @@ Vinca major,greater periwinkle,X,48131,8280,53326
|
|
1817
1819
|
Viola adunca subsp. adunca,western blue violet,N,79074,11116,53339
|
1818
1820
|
Viola douglasii,Douglas violet,N,48202,8288,79508,yellow,2,7
|
1819
1821
|
Viola glabella,stream violet,N,48214,8289,71113
|
1822
|
+
Viola ocellata,western heart's ease,N,48259,,61782,white,3,7
|
1820
1823
|
Viola pedunculata,johnny-jump-up,N,48273,8300,50825,yellow,2,4
|
1821
1824
|
Viola purpurea subsp. purpurea,mountain violet,N,53409,8312,80281,yellow
|
1822
1825
|
Viola purpurea subsp. quercetorum,,N,53410,8313,80282,yellow,2,7
|
@@ -0,0 +1 @@
|
|
1
|
+
Nectary crescent-shaped and densely hairy. Generally a dark reddish spot surrounded by pale yellow at base of petals (above nectary).
|
@@ -0,0 +1 @@
|
|
1
|
+
Petals deep yellow, usually with brown streaking. Nectary generally crescent-shaped.
|
@@ -0,0 +1 @@
|
|
1
|
+
Nectary almost square. Generally a dark reddish spot at base of petals (above nectary) and a paler spot above.
|
@@ -0,0 +1 @@
|
|
1
|
+
Basal leaf blades at least 3 times longer than wide; base tapered gradually to petiole.
|
@@ -0,0 +1 @@
|
|
1
|
+
Basal leaf blades less than 3 times longer than wide; base not tapered gradually to petiole.
|
@@ -0,0 +1 @@
|
|
1
|
+
Flower whorls dense. [Pedicels](./g/pedicel.html) on lower flowers shorter than [calyx](./g/calyx.html).
|
@@ -0,0 +1 @@
|
|
1
|
+
Flowers pedicelled. Sepals just below lobes (throat is short). Throat of tube usually purple.
|
@@ -0,0 +1 @@
|
|
1
|
+
Flowers pedicelled. Corolla tube at least twice as long as [calyx](./g/calyx.html). Corolla lobes 8-14 mm. Calyx membrane much narrower than lobes. Calyx hairs sparse or not present (except on margins).
|
@@ -1 +1 @@
|
|
1
|
-
Flowers pedicelled. Corolla tube at least twice as long as calyx. Calyx membrane much narrower than lobes.
|
1
|
+
Flowers pedicelled. Corolla tube at least twice as long as [calyx](./g/calyx.html); threadlike - no sepals at base of lobes. Corolla lobes less than 4 mm. Calyx membrane much narrower than lobes. Calyx hairs sparse or not present (except on margins).
|
@@ -0,0 +1 @@
|
|
1
|
+
Corolla lobes at least 4 mm long, corolla tube at least 14 mm. Calyx hairs dense.
|
package/lib/basepagerenderer.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { Config } from "./config.js";
|
2
|
-
import { Families } from "./families.js";
|
3
2
|
import { Files } from "./files.js";
|
4
3
|
import { Jekyll } from "./jekyll.js";
|
5
4
|
import { Taxa } from "./taxa.js";
|
@@ -23,7 +22,7 @@ class BasePageRenderer {
|
|
23
22
|
// Copy illustrations.
|
24
23
|
siteGenerator.copyIllustrations(Taxa.getFlowerColors());
|
25
24
|
|
26
|
-
|
25
|
+
taxa.getFamilies().renderPages(outputDir, familyCols);
|
27
26
|
|
28
27
|
new GlossaryPages(siteGenerator).renderPages();
|
29
28
|
|
@@ -1,27 +1,33 @@
|
|
1
1
|
import { EBookPage } from "../ebookpage.js";
|
2
2
|
import { XHTML } from "../xhtml.js";
|
3
|
+
// eslint-disable-next-line no-unused-vars
|
3
4
|
import { Families } from "../../families.js";
|
4
5
|
|
5
6
|
class PageListFamilies extends EBookPage {
|
7
|
+
#families;
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
+
/**
|
10
|
+
* @param {string} outputDir
|
11
|
+
* @param {Families} families
|
12
|
+
*/
|
13
|
+
constructor(outputDir, families) {
|
14
|
+
super(outputDir + "/list_families.html", "All Families");
|
15
|
+
this.#families = families;
|
9
16
|
}
|
10
17
|
|
11
18
|
renderPageBody() {
|
12
|
-
|
13
|
-
const html = XHTML.textElement( "h1", this.getTitle() );
|
19
|
+
const html = XHTML.textElement("h1", this.getTitle());
|
14
20
|
|
15
21
|
const links = [];
|
16
|
-
for (
|
17
|
-
if (
|
22
|
+
for (const family of this.#families.getFamilies()) {
|
23
|
+
if (!family.getTaxa()) {
|
18
24
|
continue;
|
19
25
|
}
|
20
|
-
links.push(
|
26
|
+
links.push(XHTML.getLink(family.getFileName(), family.getName()));
|
21
27
|
}
|
22
28
|
|
23
|
-
return html + XHTML.wrap(
|
29
|
+
return html + XHTML.wrap("ol", XHTML.arrayToLI(links));
|
24
30
|
}
|
25
31
|
}
|
26
32
|
|
27
|
-
export { PageListFamilies };
|
33
|
+
export { PageListFamilies };
|
package/lib/ebook/plantbook.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import { Families } from "@ca-plant-list/ca-plant-list";
|
2
1
|
import { EBook } from "./ebook.js";
|
3
2
|
import { EBookSiteGenerator } from "./ebooksitegenerator.js";
|
4
3
|
import { GlossaryPages } from "./glossarypages.js";
|
@@ -12,89 +11,124 @@ import { TOCPage } from "./pages/tocpage.js";
|
|
12
11
|
import { Taxa } from "../taxa.js";
|
13
12
|
|
14
13
|
class PlantBook extends EBook {
|
15
|
-
|
16
14
|
#taxa;
|
17
15
|
#glossary;
|
18
16
|
#images;
|
19
17
|
|
20
|
-
|
21
|
-
|
18
|
+
/**
|
19
|
+
*
|
20
|
+
* @param {string} outputDir
|
21
|
+
* @param {*} config
|
22
|
+
* @param {Taxa} taxa
|
23
|
+
*/
|
24
|
+
constructor(outputDir, config, taxa) {
|
22
25
|
super(
|
23
26
|
outputDir,
|
24
|
-
config.getConfigValue(
|
25
|
-
config.getConfigValue(
|
26
|
-
config.getConfigValue(
|
27
|
+
config.getConfigValue("ebook", "filename"),
|
28
|
+
config.getConfigValue("ebook", "pub_id"),
|
29
|
+
config.getConfigValue("ebook", "title")
|
27
30
|
);
|
28
31
|
|
29
32
|
this.#taxa = taxa;
|
30
|
-
const generator = new EBookSiteGenerator(
|
31
|
-
this.#glossary = new GlossaryPages(
|
32
|
-
this.#images = new Images(
|
33
|
-
|
33
|
+
const generator = new EBookSiteGenerator(this.getContentDir());
|
34
|
+
this.#glossary = new GlossaryPages(generator);
|
35
|
+
this.#images = new Images(generator, this.getContentDir(), taxa);
|
34
36
|
}
|
35
37
|
|
36
38
|
async createPages() {
|
37
|
-
|
38
39
|
const contentDir = this.getContentDir();
|
39
40
|
|
40
|
-
await this.#images.createImages(
|
41
|
+
await this.#images.createImages();
|
41
42
|
|
42
|
-
console.log(
|
43
|
+
console.log("creating taxon pages");
|
43
44
|
const taxonList = this.#taxa.getTaxonList();
|
44
|
-
for (
|
45
|
+
for (const taxon of taxonList) {
|
45
46
|
const name = taxon.getName();
|
46
|
-
new TaxonPage(
|
47
|
+
new TaxonPage(
|
48
|
+
contentDir,
|
49
|
+
taxon,
|
50
|
+
this.#images.getTaxonImages(name)
|
51
|
+
).create();
|
47
52
|
}
|
48
53
|
|
49
54
|
// Create lists.
|
50
|
-
for (
|
51
|
-
new PageListFlowerColor(
|
55
|
+
for (const colorName of Taxa.getFlowerColorNames()) {
|
56
|
+
new PageListFlowerColor(
|
57
|
+
contentDir,
|
58
|
+
this.#taxa.getFlowerColor(colorName)
|
59
|
+
).create();
|
52
60
|
}
|
53
61
|
|
54
|
-
PageListFlowers.createPages(
|
62
|
+
PageListFlowers.createPages(contentDir, this.#taxa);
|
55
63
|
|
56
|
-
new PageListFamilies(
|
57
|
-
for (
|
64
|
+
new PageListFamilies(contentDir, this.#taxa.getFamilies()).create();
|
65
|
+
for (const family of this.#taxa.getFamilies().getFamilies()) {
|
58
66
|
const taxa = family.getTaxa();
|
59
|
-
if (
|
67
|
+
if (!taxa) {
|
60
68
|
continue;
|
61
69
|
}
|
62
70
|
const name = family.getName();
|
63
|
-
new PageListSpecies(
|
71
|
+
new PageListSpecies(
|
72
|
+
contentDir,
|
73
|
+
taxa,
|
74
|
+
name + ".html",
|
75
|
+
name
|
76
|
+
).create();
|
64
77
|
}
|
65
|
-
new PageListSpecies(
|
78
|
+
new PageListSpecies(
|
79
|
+
contentDir,
|
80
|
+
taxonList,
|
81
|
+
"list_species.html",
|
82
|
+
"All Species"
|
83
|
+
).create();
|
66
84
|
|
67
85
|
this.#glossary.renderPages();
|
68
86
|
|
69
|
-
new TOCPage(
|
87
|
+
new TOCPage(contentDir).create();
|
70
88
|
}
|
71
89
|
|
72
90
|
renderManifestEntries() {
|
73
|
-
|
74
91
|
let xml = "";
|
75
92
|
|
76
93
|
// Add lists.
|
77
|
-
xml +=
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
94
|
+
xml +=
|
95
|
+
'<item id="lspecies" href="list_species.html" media-type="application/xhtml+xml" />';
|
96
|
+
xml +=
|
97
|
+
'<item id="lfamilies" href="list_families.html" media-type="application/xhtml+xml" />';
|
98
|
+
for (const colorName of Taxa.getFlowerColorNames()) {
|
99
|
+
const color = this.#taxa.getFlowerColor(colorName);
|
100
|
+
xml +=
|
101
|
+
'<item id="l' +
|
102
|
+
color.getColorName() +
|
103
|
+
'" href="' +
|
104
|
+
color.getFileName() +
|
105
|
+
'" media-type="application/xhtml+xml" />';
|
82
106
|
}
|
83
107
|
|
84
108
|
// Add family pages.
|
85
|
-
for (
|
109
|
+
for (const family of this.#taxa.getFamilies().getFamilies()) {
|
86
110
|
const taxa = family.getTaxa();
|
87
|
-
if (
|
111
|
+
if (!taxa) {
|
88
112
|
continue;
|
89
113
|
}
|
90
|
-
xml +=
|
114
|
+
xml +=
|
115
|
+
'<item id="fam' +
|
116
|
+
family.getName() +
|
117
|
+
'" href="' +
|
118
|
+
family.getFileName() +
|
119
|
+
'" media-type="application/xhtml+xml" />';
|
91
120
|
}
|
92
121
|
|
93
122
|
// Add taxon pages.
|
94
123
|
const taxa = this.#taxa.getTaxonList();
|
95
|
-
for (
|
96
|
-
const taxon = taxa[
|
97
|
-
xml +=
|
124
|
+
for (let index = 0; index < taxa.length; index++) {
|
125
|
+
const taxon = taxa[index];
|
126
|
+
xml +=
|
127
|
+
'<item id="t' +
|
128
|
+
index +
|
129
|
+
'" href="' +
|
130
|
+
taxon.getFileName() +
|
131
|
+
'" media-type="application/xhtml+xml" />';
|
98
132
|
}
|
99
133
|
|
100
134
|
xml += PageListFlowers.getManifestEntries();
|
@@ -108,27 +142,27 @@ class PlantBook extends EBook {
|
|
108
142
|
let xml = "";
|
109
143
|
|
110
144
|
// Add lists.
|
111
|
-
for (
|
112
|
-
const color = this.#taxa.getFlowerColor(
|
113
|
-
xml +=
|
145
|
+
for (const colorName of Taxa.getFlowerColorNames()) {
|
146
|
+
const color = this.#taxa.getFlowerColor(colorName);
|
147
|
+
xml += '<itemref idref="l' + color.getColorName() + '"/>';
|
114
148
|
}
|
115
149
|
xml += PageListFlowers.getSpineEntries();
|
116
150
|
|
117
|
-
xml +=
|
118
|
-
xml +=
|
151
|
+
xml += '<itemref idref="lfamilies"/>';
|
152
|
+
xml += '<itemref idref="lspecies"/>';
|
119
153
|
|
120
154
|
// Add families.
|
121
|
-
for (
|
155
|
+
for (const family of this.#taxa.getFamilies().getFamilies()) {
|
122
156
|
const taxa = family.getTaxa();
|
123
|
-
if (
|
157
|
+
if (!taxa) {
|
124
158
|
continue;
|
125
159
|
}
|
126
|
-
xml +=
|
160
|
+
xml += '<itemref idref="fam' + family.getName() + '"/>';
|
127
161
|
}
|
128
162
|
|
129
163
|
// Add taxa.
|
130
|
-
for (
|
131
|
-
xml +=
|
164
|
+
for (let index = 0; index < this.#taxa.getTaxonList().length; index++) {
|
165
|
+
xml += '<itemref idref="t' + index + '"/>';
|
132
166
|
}
|
133
167
|
|
134
168
|
xml += this.#glossary.getSpineEntries();
|
@@ -137,4 +171,4 @@ class PlantBook extends EBook {
|
|
137
171
|
}
|
138
172
|
}
|
139
173
|
|
140
|
-
export { PlantBook };
|
174
|
+
export { PlantBook };
|
package/lib/families.js
CHANGED
@@ -57,9 +57,9 @@ class Family {
|
|
57
57
|
}
|
58
58
|
|
59
59
|
class Families {
|
60
|
-
|
60
|
+
#families;
|
61
61
|
|
62
|
-
|
62
|
+
constructor() {
|
63
63
|
const dataDir = Config.getPackageDir() + "/data";
|
64
64
|
|
65
65
|
this.#families = JSON.parse(Files.read(dataDir + "/families.json"));
|
@@ -68,7 +68,7 @@ class Families {
|
|
68
68
|
}
|
69
69
|
}
|
70
70
|
|
71
|
-
|
71
|
+
getFamilies() {
|
72
72
|
return Object.values(this.#families).sort((a, b) =>
|
73
73
|
a.getName().localeCompare(b.getName())
|
74
74
|
);
|
@@ -77,7 +77,7 @@ class Families {
|
|
77
77
|
/**
|
78
78
|
* @param {string} familyName
|
79
79
|
*/
|
80
|
-
|
80
|
+
getFamily(familyName) {
|
81
81
|
return this.#families[familyName];
|
82
82
|
}
|
83
83
|
|
@@ -85,7 +85,7 @@ class Families {
|
|
85
85
|
* @param {string} outputDir
|
86
86
|
* @param {import("./index.js").TaxaCol[]} taxaColumns
|
87
87
|
*/
|
88
|
-
|
88
|
+
renderPages(outputDir, taxaColumns) {
|
89
89
|
new PageFamilyList(outputDir, this.#families).render(taxaColumns);
|
90
90
|
|
91
91
|
const names = Object.keys(this.#families);
|
@@ -209,9 +209,6 @@ class PageSection extends GenericPage {
|
|
209
209
|
this.#taxa = taxa;
|
210
210
|
}
|
211
211
|
|
212
|
-
/**
|
213
|
-
* @param {import("./index.js").TaxaCol[]} columns
|
214
|
-
*/
|
215
212
|
render(columns) {
|
216
213
|
let html = this.getDefaultIntro();
|
217
214
|
|
package/lib/genera.js
CHANGED
@@ -1,62 +1,76 @@
|
|
1
1
|
import { Config } from "./config.js";
|
2
2
|
import { Families } from "./families.js";
|
3
3
|
import { Files } from "./files.js";
|
4
|
+
// eslint-disable-next-line no-unused-vars
|
5
|
+
import { Taxon } from "./taxon.js";
|
4
6
|
|
5
7
|
class Genera {
|
8
|
+
#families;
|
9
|
+
#genera;
|
6
10
|
|
7
|
-
|
8
|
-
|
9
|
-
|
11
|
+
/**
|
12
|
+
* @param {Families} families
|
13
|
+
*/
|
14
|
+
constructor(families) {
|
10
15
|
const dataDir = Config.getPackageDir() + "/data";
|
11
|
-
this.#genera = JSON.parse(
|
16
|
+
this.#genera = JSON.parse(Files.read(dataDir + "/genera.json"));
|
17
|
+
this.#families = families;
|
12
18
|
}
|
13
19
|
|
14
|
-
|
15
|
-
|
20
|
+
/**
|
21
|
+
* @param {Taxon} taxon
|
22
|
+
*/
|
23
|
+
addTaxon(taxon) {
|
16
24
|
const genusName = taxon.getGenusName();
|
17
|
-
const genusData = this.#genera[
|
18
|
-
if (
|
19
|
-
console.log(
|
25
|
+
const genusData = this.#genera[genusName];
|
26
|
+
if (!genusData) {
|
27
|
+
console.log(taxon.getName() + " genus not found");
|
20
28
|
return;
|
21
29
|
}
|
22
30
|
|
23
|
-
if (
|
31
|
+
if (genusData.taxa === undefined) {
|
24
32
|
genusData.taxa = [];
|
25
33
|
}
|
26
|
-
genusData.taxa.push(
|
34
|
+
genusData.taxa.push(taxon);
|
27
35
|
|
28
|
-
const family = this.getFamily(
|
29
|
-
if (
|
30
|
-
console.log(
|
36
|
+
const family = this.getFamily(genusName);
|
37
|
+
if (!family) {
|
38
|
+
console.log(taxon.getName() + " family not found");
|
31
39
|
return;
|
32
40
|
}
|
33
|
-
family.addTaxon(
|
41
|
+
family.addTaxon(taxon);
|
34
42
|
}
|
35
43
|
|
36
|
-
|
37
|
-
|
44
|
+
/**
|
45
|
+
* @param {string} genusName
|
46
|
+
*/
|
47
|
+
getGenus(genusName) {
|
48
|
+
return new Genus(this.#genera[genusName]);
|
38
49
|
}
|
39
50
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
51
|
+
/**
|
52
|
+
* @param {string} genusName
|
53
|
+
*/
|
54
|
+
getFamily(genusName) {
|
55
|
+
const genus = this.#genera[genusName];
|
56
|
+
if (genus) {
|
57
|
+
return this.#families.getFamily(genus.family);
|
44
58
|
}
|
45
59
|
}
|
46
|
-
|
47
60
|
}
|
48
61
|
|
49
62
|
class Genus {
|
50
|
-
|
51
63
|
#data;
|
52
64
|
|
53
|
-
constructor(
|
65
|
+
constructor(data) {
|
54
66
|
this.#data = data;
|
55
67
|
}
|
56
68
|
|
57
69
|
getTaxa() {
|
58
|
-
return this.#data.taxa.sort(
|
70
|
+
return this.#data.taxa.sort((a, b) =>
|
71
|
+
a.getName().localeCompare(b.getName())
|
72
|
+
);
|
59
73
|
}
|
60
74
|
}
|
61
75
|
|
62
|
-
export { Genera };
|
76
|
+
export { Genera };
|
package/lib/index.js
CHANGED
package/lib/taxa.js
CHANGED
@@ -2,7 +2,8 @@ import { Config } from "./config.js";
|
|
2
2
|
import { HTML } from "./html.js";
|
3
3
|
import { CSV } from "./csv.js";
|
4
4
|
import { RarePlants } from "./rareplants.js";
|
5
|
-
import { ErrorLog, Taxon } from "./index.js";
|
5
|
+
import { ErrorLog, Families, Taxon } from "./index.js";
|
6
|
+
import { Genera } from "./genera.js";
|
6
7
|
|
7
8
|
const FLOWER_COLORS = [
|
8
9
|
{ name: "white", color: "white" },
|
@@ -12,6 +13,7 @@ const FLOWER_COLORS = [
|
|
12
13
|
{ name: "yellow", color: "yellow" },
|
13
14
|
{ name: "blue", color: "blue" },
|
14
15
|
{ name: "purple", color: "purple" },
|
16
|
+
{ name: "green", color: "green" },
|
15
17
|
];
|
16
18
|
|
17
19
|
/**
|
@@ -85,6 +87,7 @@ class FlowerColor {
|
|
85
87
|
}
|
86
88
|
|
87
89
|
class Taxa {
|
90
|
+
#families;
|
88
91
|
#errorLog;
|
89
92
|
/** @type {Object<string,Taxon>} */
|
90
93
|
#taxa = {};
|
@@ -123,6 +126,8 @@ class Taxa {
|
|
123
126
|
|
124
127
|
const dataDir = Config.getPackageDir() + "/data";
|
125
128
|
|
129
|
+
this.#families = new Families();
|
130
|
+
|
126
131
|
const taxaCSV = CSV.parseFile(dataDir, "taxa.csv");
|
127
132
|
this.#loadTaxa(
|
128
133
|
taxaCSV,
|
@@ -186,6 +191,10 @@ class Taxa {
|
|
186
191
|
return html;
|
187
192
|
}
|
188
193
|
|
194
|
+
getFamilies() {
|
195
|
+
return this.#families;
|
196
|
+
}
|
197
|
+
|
189
198
|
/**
|
190
199
|
* @param {string} name
|
191
200
|
*/
|
@@ -257,6 +266,7 @@ class Taxa {
|
|
257
266
|
* @param {boolean} showFlowerErrors
|
258
267
|
*/
|
259
268
|
#loadTaxa(taxaCSV, inclusionList, taxaMeta, taxonClass, showFlowerErrors) {
|
269
|
+
const genera = new Genera(this.#families);
|
260
270
|
for (const row of taxaCSV) {
|
261
271
|
const name = row["taxon_name"];
|
262
272
|
|
@@ -276,7 +286,7 @@ class Taxa {
|
|
276
286
|
if (status !== undefined) {
|
277
287
|
row["status"] = status;
|
278
288
|
}
|
279
|
-
const taxon = new taxonClass(row, taxaMeta[name]);
|
289
|
+
const taxon = new taxonClass(row, genera, taxaMeta[name]);
|
280
290
|
this.#taxa[name] = taxon;
|
281
291
|
const colors = taxon.getFlowerColors();
|
282
292
|
if (colors) {
|
package/lib/taxon.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { HTML } from "./index.js";
|
2
|
-
import { Genera } from "./genera.js";
|
3
2
|
import { RarePlants } from "./rareplants.js";
|
3
|
+
// eslint-disable-next-line no-unused-vars
|
4
|
+
import { Genera } from "./genera.js";
|
4
5
|
|
5
6
|
const TAXA_COLNAMES = {
|
6
7
|
BLOOM_START: "bloom_start",
|
@@ -10,6 +11,8 @@ const TAXA_COLNAMES = {
|
|
10
11
|
};
|
11
12
|
|
12
13
|
class Taxon {
|
14
|
+
/** @type {Genera} */
|
15
|
+
#genera;
|
13
16
|
#name;
|
14
17
|
#genus;
|
15
18
|
#commonNames;
|
@@ -35,8 +38,10 @@ class Taxon {
|
|
35
38
|
|
36
39
|
/**
|
37
40
|
* @param {import("./index.js").TaxonData} data
|
41
|
+
* @param {Genera} genera
|
38
42
|
*/
|
39
|
-
constructor(data) {
|
43
|
+
constructor(data, genera) {
|
44
|
+
this.#genera = genera;
|
40
45
|
const name = data["taxon_name"];
|
41
46
|
const commonNames = data["common name"];
|
42
47
|
const cesa = data["CESA"];
|
@@ -66,7 +71,7 @@ class Taxon {
|
|
66
71
|
this.#fesa = fesa ? fesa : undefined;
|
67
72
|
this.#rankCNDDB = rankCNDDB ? rankCNDDB : undefined;
|
68
73
|
this.#rankGlobal = rankGlobal ? rankGlobal : undefined;
|
69
|
-
|
74
|
+
genera.addTaxon(this);
|
70
75
|
}
|
71
76
|
|
72
77
|
/**
|
@@ -144,7 +149,7 @@ class Taxon {
|
|
144
149
|
}
|
145
150
|
|
146
151
|
getFamily() {
|
147
|
-
return
|
152
|
+
return this.#genera.getFamily(this.#genus);
|
148
153
|
}
|
149
154
|
|
150
155
|
getFESA() {
|
@@ -160,7 +165,7 @@ class Taxon {
|
|
160
165
|
}
|
161
166
|
|
162
167
|
getGenus() {
|
163
|
-
return
|
168
|
+
return this.#genera.getGenus(this.#genus);
|
164
169
|
}
|
165
170
|
|
166
171
|
getGenusName() {
|
package/package.json
CHANGED