@ca-plant-list/ca-plant-list 0.2.7 → 0.2.9

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/synonyms.csv CHANGED
@@ -924,7 +924,6 @@ Jussiaea repens var. peploides,Ludwigia peploides subsp. peploides
924
924
  Kali australis,Salsola australis
925
925
  Keckiella breviflora subsp. breviflora,Keckiella breviflora var. breviflora
926
926
  Koeleria cristata var. longifolia,Koeleria macrantha
927
- Koeleria gerardii,Koeleria gerardi,INAT
928
927
  Koeleria nitida,Koeleria macrantha
929
928
  Kohlrauschia velutina,Petrorhagia dubia
930
929
  Lachnagrostis filiformis,Agrostis avenacea,INAT
@@ -1102,6 +1101,7 @@ Mahonia dictyota,Berberis aquifolium var. dictyota
1102
1101
  Mahonia nervosa var. mendocinensis,Berberis nervosa
1103
1102
  Mahonia pinnata subsp. pinnata,Berberis pinnata subsp. pinnata
1104
1103
  Maianthemum racemosum subsp. amplexicaule,Maianthemum racemosum
1104
+ Malacothamnus arcuatus var. elmeri,Malacothamnus hallii,INAT
1105
1105
  Malacothamnus fremontii subsp. cercophorus,Malacothamnus fremontii
1106
1106
  Malacothamnus helleri,Malacothamnus fremontii
1107
1107
  Malacothamnus howellii,Malacothamnus fremontii
@@ -1146,6 +1146,7 @@ Milla laxa,Triteleia laxa
1146
1146
  Milla maritima,Muilla maritima
1147
1147
  Milla peduncularis,Triteleia peduncularis
1148
1148
  Mimulus androsaceus,Erythranthe androsacea
1149
+ Mimulus arvensis,Erythranthe arvensis
1149
1150
  Mimulus aurantiacus,Diplacus aurantiacus
1150
1151
  Mimulus bakeri,Erythranthe nasuta
1151
1152
  Mimulus bolanderi,Diplacus bolanderi
@@ -1164,9 +1165,15 @@ Mimulus glabratus var. adscendens,Erythranthe guttata
1164
1165
  Mimulus glareosus,Erythranthe microphylla
1165
1166
  Mimulus glutinosus,Diplacus aurantiacus
1166
1167
  Mimulus grandiflorus,Erythranthe guttata
1168
+ Mimulus grandis,Erythranthe grandis
1169
+ Mimulus guttatus subsp. arvensis,Erythranthe arvensis
1167
1170
  Mimulus guttatus subsp. haidensis,Erythranthe guttata
1171
+ Mimulus guttatus subsp. litoralis,Erythranthe grandis
1172
+ Mimulus guttatus subsp. micranthus,Erythranthe arvensis
1173
+ Mimulus guttatus var. arvensis,Erythranthe arvensis
1168
1174
  Mimulus guttatus var. depauperatus,Erythranthe microphylla
1169
1175
  Mimulus guttatus var. gracilis,Erythranthe nasuta
1176
+ Mimulus guttatus var. grandis,Erythranthe grandis
1170
1177
  Mimulus guttatus var. insignis,Erythranthe microphylla
1171
1178
  Mimulus guttatus var. microphyllus,Erythranthe microphylla
1172
1179
  Mimulus guttatus var. nasutus,Erythranthe nasuta
@@ -1178,7 +1185,9 @@ Mimulus inconspicuus,Erythranthe inconspicua
1178
1185
  Mimulus kelloggii,Diplacus kelloggii
1179
1186
  Mimulus laciniatus,Erythranthe laciniata
1180
1187
  Mimulus langsdorffii var. argutus,Erythranthe guttata
1188
+ Mimulus langsdorffii var. arvensis,Erythranthe arvensis
1181
1189
  Mimulus langsdorffii var. californicus,Erythranthe guttata
1190
+ Mimulus langsdorffii var. grandis,Erythranthe grandis
1182
1191
  Mimulus langsdorffii var. guttatus,Erythranthe guttata
1183
1192
  Mimulus langsdorffii var. insignis,Erythranthe microphylla
1184
1193
  Mimulus langsdorffii var. microphyllus,Erythranthe microphylla
@@ -1188,10 +1197,12 @@ Mimulus langsdorffii var. platyphyllus,Erythranthe guttata
1188
1197
  Mimulus langsdorffii,Erythranthe guttata
1189
1198
  Mimulus latidens,Erythranthe latidens
1190
1199
  Mimulus laxus,Erythranthe microphylla
1200
+ Mimulus longulus,Erythranthe arvensis
1191
1201
  Mimulus luteus var. depauperatus,Erythranthe microphylla
1192
1202
  Mimulus luteus var. gracilis,Erythranthe nasuta
1193
1203
  Mimulus lyratus,Erythranthe guttata
1194
1204
  Mimulus membranaceus,Erythranthe floribunda
1205
+ Mimulus micranthus,Erythranthe arvensis
1195
1206
  Mimulus microphyllus,Erythranthe microphylla
1196
1207
  Mimulus nasutus var. insignis,Erythranthe microphylla
1197
1208
  Mimulus nasutus,Erythranthe nasuta
@@ -1203,6 +1214,7 @@ Mimulus pilosus,Mimetanthe pilosa
1203
1214
  Mimulus platycalyx,Erythranthe microphylla
1204
1215
  Mimulus platylaemus,Diplacus bolanderi
1205
1216
  Mimulus prionophyllus,Erythranthe guttata
1217
+ Mimulus procerus,Erythranthe grandis
1206
1218
  Mimulus puberulus,Erythranthe guttata
1207
1219
  Mimulus puncticalyx,Erythranthe nasuta
1208
1220
  Mimulus rattanii subsp. decurtatus,Diplacus rattanii
@@ -1606,6 +1618,7 @@ Rorippa palustris var. occidentalis,Rorippa palustris subsp. palustris
1606
1618
  Rosa eglanteria,Rosa rubiginosa
1607
1619
  Rosa spithamea var. sonomensis,Rosa spithamea
1608
1620
  Rostraria cristata,Koeleria gerardi
1621
+ Rostraria cristata,Koeleria gerardi,INAT
1609
1622
  Rottboellia cylindrica,Hainardia cylindrica
1610
1623
  Rubacer parviflorum,Rubus parviflorus
1611
1624
  Rubus almus,Rubus pensilvanicus
@@ -1787,6 +1800,7 @@ Smilacina racemosa var. glabra,Maianthemum racemosum
1787
1800
  Smilacina racemosa,Maianthemum racemosum
1788
1801
  Smilacina stellata var. sessilifolia,Maianthemum stellatum
1789
1802
  Smilacina stellata,Maianthemum stellatum
1803
+ Solanum nitidibaccatum,Solanum physalifolium var. nitidibaccatum,INAT
1790
1804
  Solanum nodiflorum,Solanum americanum
1791
1805
  Solanum tenuilobatum,Solanum xanti
1792
1806
  Solanum umbelliferum var. glabrescens,Solanum umbelliferum
package/data/taxa.csv CHANGED
@@ -412,7 +412,7 @@ Citrullus lanatus var. citroides,watermelon,X,56575,9813,841204
412
412
  Clarkia affinis,chaparral clarkia,N,19563,2159,58943
413
413
  Clarkia biloba subsp. biloba,twolobe clarkia,N,49891,2168,51857
414
414
  Clarkia breweri,Brewer's clarkia,N,19571,2174,56067,,,,159,4.2,,,S4,G4
415
- Clarkia concinna subsp. automixa,Santa Clara red ribbons,N,49895,2176,51856,,,,1629,4.3,,,S3,G5
415
+ Clarkia concinna subsp. automixa,Santa Clara red ribbons,N,49895,2176,51856,,,,1629,4.3,,,S3,G5?T3
416
416
  Clarkia concinna subsp. concinna,red ribbons,N,49896,2177,51855
417
417
  Clarkia epilobioides,,N,19577,2185,58945
418
418
  Clarkia franciscana,Presidio clarkia,N,19579,2187,61899,,,,162,1B.1,CE,FE,S1,G1
@@ -710,14 +710,16 @@ Eryngium vaseyi var. vallicola,,N,58851,11675,80888
710
710
  Erysimum capitatum var. angustatum,Contra Costa wallflower,N,58866,9942,119564,,,,790,1B.1,CE,FE,S1,G5T1
711
711
  Erysimum capitatum var. capitatum,western wallflower,N,58866,9943,50627
712
712
  Erythranthe androsacea,,N,99088,13487,771845
713
- Erythranthe cardinalis,,N,25147,13490,319974
714
- Erythranthe floribunda,,N,99122,13492,701582
715
- Erythranthe guttata,,N,99131,13493,470643
716
- Erythranthe inconspicua,small-flowered monkeyflower,N,99135,13416,771882,,,,1092,4.3,,,S4,G4
713
+ Erythranthe arvensis,"villous-bracted monkeyflower,field monkeyflower",N,99091,13552,771848,yellow,4,7
714
+ Erythranthe cardinalis,scarlet monkeyflower,N,25147,13490,319974,red,5,9
715
+ Erythranthe floribunda,many-flowered monkeyflower,N,99122,13492,701582,yellow,4,8
716
+ Erythranthe grandis,magnificent seep monkeyflower,N,99129,13560,771876,yellow,5,7
717
+ Erythranthe guttata,seep monkeyflower,N,99131,13493,470643,yellow,4,9
718
+ Erythranthe inconspicua,small-flowered monkeyflower,N,99135,13416,771882,pink,4,7,1092,4.3,,,S4,G4
717
719
  Erythranthe laciniata,,N,99142,13417,546557,,,,1093,4.3,,,S4,G4
718
- Erythranthe latidens,,N,99144,13495,771886
720
+ Erythranthe latidens,broad-tooth monkeyflower,N,99144,13495,771886,"white,pink",4,6
719
721
  Erythranthe microphylla,small leaved monkeyflower,N,99152,13498,453717
720
- Erythranthe nasuta,shy monkeyflower,N,99158,13637,545973
722
+ Erythranthe nasuta,shy monkeyflower,N,99158,13637,545973,yellow,3,7
721
723
  Eschscholzia caespitosa,tufted poppy,N,25205,3511,58954
722
724
  Eschscholzia californica,California poppy,N,25206,3512,48225
723
725
  Eschscholzia rhombipetala,,N,25218,3527,77087,,,,806,1B.1,,,S1,G1
@@ -938,7 +940,7 @@ Keckiella corymbosa,,N,29883,4523,62043
938
940
  Kickxia elatine,fluellin,X,29898,4532,64332
939
941
  Kickxia spuria,fluellin,X,29899,4533,64191
940
942
  Kniphofia uvaria,,X,29921,8635,56035
941
- Koeleria gerardi,annual junegrass,X,29957,13237,77610
943
+ Koeleria gerardi,annual junegrass,X,29957,13237,167999
942
944
  Koeleria macrantha,junegrass,N,29951,4539,57183
943
945
  Kopsiopsis strobilacea,California ground-cone,N,93802,11786,77612
944
946
  Lactuca saligna,,X,3688,4549,53105
@@ -1048,7 +1050,7 @@ Lomatium macrocarpum,,N,31433,4974,56826
1048
1050
  Lomatium nudicaule,,N,31441,4983,77818
1049
1051
  Lomatium utriculatum,,N,31473,4999,56827
1050
1052
  Lonicera hispidula,California honeysuckle,N,31505,10075,53416,pink,5,6
1051
- Lonicera interrupta,chaparral honeysuckle,N,31506,,60878,"yellow,white",4,5
1053
+ Lonicera interrupta,chaparral honeysuckle,N,31506,5009,60878,"yellow,white",4,5
1052
1054
  Lonicera involucrata var. ledebourii,black twinberry,N,61081,5012,60990
1053
1055
  Lonicera japonica,Japanese honeysuckle,X,31508,5013,77835
1054
1056
  Lonicera subspicata var. denudata,moronel,N,61089,5015,58872,yellow,6,7
@@ -1099,7 +1101,7 @@ Madia sativa,coast tarweed,N,4055,5298,53143,yellow
1099
1101
  Maianthemum racemosum,false Solomon's seal,N,32495,10096,51062
1100
1102
  Maianthemum stellatum,,N,32497,9629,53268
1101
1103
  Malacothamnus fremontii,white-coat mallow,N,32524,5312,70397
1102
- Malacothamnus hallii,Hall's bush mallow,N,32519,5314,77930,,,,1065,1B.2,,,S2,G2
1104
+ Malacothamnus hallii,Hall's bush mallow,N,32519,5314,1497404,,,,1065,1B.2,,,S2,G2
1103
1105
  Malacothrix californica,,N,4059,5325,58026
1104
1106
  Malacothrix clevelandii,Cleveland's malacothrix,N,4060,5326,58841
1105
1107
  Malacothrix coulteri,snake's-head,N,4061,5327,58027
@@ -1620,7 +1622,7 @@ Solanum elaeagnifolium,white horse-nettle,X,44852,7654,79137
1620
1622
  Solanum furcatum,,X,44856,7655,79138
1621
1623
  Solanum lanceolatum,lanceleaf nightshade,X,44872,7656,79139
1622
1624
  Solanum nigrum,black nightshade,X,44883,7658,79141
1623
- Solanum physalifolium var. nitidibaccatum,nightshade,X,66519,11086,81374
1625
+ Solanum physalifolium var. nitidibaccatum,nightshade,X,66519,11086,406080
1624
1626
  Solanum umbelliferum,blue witch,N,44919,7664,50639
1625
1627
  Solanum xanti,,N,77308,7666,79146
1626
1628
  Soleirolia soleirolii,baby's tears,X,44928,7667,79147
@@ -0,0 +1 @@
1
+ Stems not hairy.
@@ -0,0 +1 @@
1
+ Corolla tube extends 10-15 mm beyond calyx.
@@ -0,0 +1 @@
1
+ Corolla tube extends 3–5 mm beyond calyx.
@@ -2,6 +2,11 @@
2
2
  font-family: Georgia, 'Times New Roman', Times, serif;
3
3
  }
4
4
 
5
+ div.flr {
6
+ display: flex;
7
+ align-items: center;
8
+ }
9
+
5
10
  img {
6
11
  width: 100%;
7
12
  }
@@ -20,6 +20,10 @@
20
20
  background-color: var(--pl-navbar-bg);
21
21
  }
22
22
 
23
+ p {
24
+ margin-bottom: .5rem;
25
+ }
26
+
23
27
  span.label {
24
28
  font-weight: 600;
25
29
  padding-right: .5rem;
@@ -126,6 +130,11 @@ div.section ul.indent {
126
130
  padding-left: 1rem;
127
131
  }
128
132
 
133
+ img.flower-color {
134
+ margin-bottom: .2rem;
135
+ margin-right: .5rem;
136
+ }
137
+
129
138
  /* Forms */
130
139
  input {
131
140
  margin-right: .5em;
@@ -0,0 +1,43 @@
1
+ const MONTH_NAMES = [
2
+ "January",
3
+ "February",
4
+ "March",
5
+ "April",
6
+ "May",
7
+ "June",
8
+ "July",
9
+ "August",
10
+ "September",
11
+ "October",
12
+ "November",
13
+ "December",
14
+ ];
15
+
16
+ class DateUtils {
17
+
18
+ static getMonthName( monthNum ) {
19
+ return MONTH_NAMES[ monthNum - 1 ];
20
+ }
21
+
22
+ static monthRangesOverlap( r1, r2 ) {
23
+
24
+ function contains( r1, r2 ) {
25
+ function inRange( v, r ) {
26
+ return v >= r[ 0 ] && v <= r[ 1 ];
27
+ }
28
+ return inRange( r1[ 0 ], r2 ) || inRange( r1[ 1 ], r2 );
29
+ }
30
+
31
+ // If ranges cross into next year, split them in 2.
32
+ if ( r1[ 0 ] > r1[ 1 ] ) {
33
+ return this.monthRangesOverlap( [ r1[ 0 ], 12 ], r2 ) || this.monthRangesOverlap( [ 1, r1[ 1 ] ], r2 );
34
+ }
35
+ if ( r2[ 0 ] > r2[ 1 ] ) {
36
+ return this.monthRangesOverlap( r1, [ r2[ 0 ], 12 ] ) || this.monthRangesOverlap( r1, [ 1, r2[ 1 ] ] );
37
+ }
38
+ return contains( r1, r2 ) || contains( r2, r1 );
39
+ }
40
+
41
+ }
42
+
43
+ export { DateUtils };
@@ -0,0 +1,108 @@
1
+ import { EBookPage } from "../ebookpage.js";
2
+ import { XHTML } from "../xhtml.js";
3
+ import { DateUtils } from "../../dateutils.js";
4
+ import { EBook } from "../ebook.js";
5
+ import { Taxa } from "../../taxa.js";
6
+
7
+ const FN_FLOWER_TIME_INDEX = "fm.html";
8
+
9
+ class PageListFlowers {
10
+
11
+ static createPages( contentDir ) {
12
+ new PageListFlowerTimeIndex( contentDir ).create();
13
+ for ( let m1 = 1; m1 < 13; m1++ ) {
14
+ new PageListFlowerTime( contentDir, m1 ).create();
15
+ }
16
+ }
17
+
18
+ static getManifestEntries() {
19
+
20
+ const manifestEntries = [];
21
+
22
+ manifestEntries.push( EBook.getManifestEntry( "fm0", FN_FLOWER_TIME_INDEX ) );
23
+ for ( let m1 = 1; m1 < 13; m1++ ) {
24
+ manifestEntries.push( EBook.getManifestEntry( "fm" + m1, PageListFlowerTime.getFileNameBloomTime( m1 ) ) );
25
+ }
26
+
27
+ return manifestEntries.join( "" );
28
+ }
29
+
30
+ static getSpineEntries() {
31
+
32
+ const spineEntries = [];
33
+
34
+ spineEntries.push( EBook.getSpineEntry( "fm0" ) );
35
+ for ( let m1 = 1; m1 < 13; m1++ ) {
36
+ spineEntries.push( EBook.getSpineEntry( "fm" + m1 ) );
37
+ }
38
+
39
+ return spineEntries.join( "" );
40
+
41
+ }
42
+
43
+ static renderMonthLinks() {
44
+ const links = [];
45
+ for ( let m1 = 1; m1 < 13; m1++ ) {
46
+ links.push(
47
+ XHTML.getLink(
48
+ PageListFlowerTime.getFileNameBloomTime( m1 ),
49
+ DateUtils.getMonthName( m1 ) + " - " + DateUtils.getMonthName( ( m1 ) % 12 + 1 )
50
+ )
51
+ );
52
+ }
53
+ return XHTML.wrap( "ol", XHTML.arrayToLI( links ) );
54
+ }
55
+
56
+ }
57
+
58
+ class PageListFlowerTimeIndex extends EBookPage {
59
+
60
+ constructor( outputDir ) {
61
+ super( outputDir + "/" + FN_FLOWER_TIME_INDEX, "Flowering Times" );
62
+ }
63
+
64
+ renderPageBody() {
65
+ const html = XHTML.textElement( "h1", this.getTitle() );
66
+ return html + PageListFlowers.renderMonthLinks();
67
+ }
68
+
69
+ }
70
+
71
+ class PageListFlowerTime extends EBookPage {
72
+
73
+ #m1;
74
+ #m2;
75
+
76
+ constructor( outputDir, month ) {
77
+ super(
78
+ outputDir + "/" + PageListFlowerTime.getFileNameBloomTime( month ),
79
+ "Flowering in " + DateUtils.getMonthName( month ) + " - " + DateUtils.getMonthName( month % 12 + 1 )
80
+ );
81
+ this.#m1 = month;
82
+ this.#m2 = month % 12 + 1;
83
+ }
84
+
85
+ static getFileNameBloomTime( m1 ) {
86
+ return "list_fm_" + m1 + ".html";
87
+ }
88
+
89
+ renderPageBody() {
90
+
91
+ const html = XHTML.textElement( "h1", this.getTitle() );
92
+
93
+ const range = [ this.#m1, this.#m2 ];
94
+ const links = [];
95
+ for ( const taxon of Taxa.getTaxa() ) {
96
+ const m1 = taxon.getBloomStart();
97
+ const m2 = taxon.getBloomEnd();
98
+ if ( m1 && DateUtils.monthRangesOverlap( range, [ m1, m2 ] ) ) {
99
+ links.push( XHTML.getLink( taxon.getFileName(), taxon.getName() ) );
100
+ }
101
+ }
102
+
103
+ return html + XHTML.wrap( "ol", XHTML.arrayToLI( links ) );
104
+ }
105
+
106
+ }
107
+
108
+ export { PageListFlowers, PageListFlowerTime };
@@ -3,6 +3,7 @@ import { Config, Files } from "@ca-plant-list/ca-plant-list";
3
3
  import { EBookPage } from "../ebookpage.js";
4
4
  import { XHTML } from "../xhtml.js";
5
5
  import { Markdown } from "../../markdown.js";
6
+ import { DateUtils } from "../../dateutils.js";
6
7
 
7
8
  class TaxonPage extends EBookPage {
8
9
 
@@ -19,16 +20,22 @@ class TaxonPage extends EBookPage {
19
20
 
20
21
  renderPageBody() {
21
22
 
22
- function renderColors( colors ) {
23
- if ( !colors ) {
23
+ function renderBloomInfo( taxon ) {
24
+ const colors = taxon.getFlowerColors();
25
+ const monthStart = taxon.getBloomStart();
26
+ const monthEnd = taxon.getBloomEnd();
27
+ if ( !colors && !monthStart ) {
24
28
  return "";
25
29
  }
26
30
  let html = "";
27
31
  for ( const color of colors ) {
28
- // html += XHTML.textElement( "span", "", { class: "color " + color } );
29
32
  html += XHTML.textElement( "img", "", { src: "./i/f-" + color + ".svg", class: "flr" } );
30
33
  }
31
- return html;
34
+ if ( monthStart ) {
35
+ html += XHTML.textElement( "div", DateUtils.getMonthName( monthStart ) + "-" + DateUtils.getMonthName( monthEnd ) );
36
+
37
+ }
38
+ return XHTML.wrap( "div", html, { class: "flr" } );
32
39
  }
33
40
 
34
41
 
@@ -53,7 +60,7 @@ class TaxonPage extends EBookPage {
53
60
  html += XHTML.textElement( "p", cn.join( ", " ) );
54
61
  }
55
62
 
56
- html += renderColors( this.#taxon.getFlowerColors() );
63
+ html += renderBloomInfo( this.#taxon );
57
64
 
58
65
  html += renderCustomText( this.#taxon.getBaseFileName() );
59
66
 
@@ -1,6 +1,7 @@
1
1
  import { EBookPage } from "../ebookpage.js";
2
2
  import { XHTML } from "../xhtml.js";
3
3
  import { FLOWER_COLOR_NAMES } from "../../taxa.js";
4
+ import { PageListFlowers } from "./page_list_flowers.js";
4
5
 
5
6
  class TOCPage extends EBookPage {
6
7
 
@@ -15,6 +16,7 @@ class TOCPage extends EBookPage {
15
16
 
16
17
  const mainLinks = [];
17
18
  mainLinks.push( this.#getFlowerColorLinks() );
19
+ mainLinks.push( this.#getFlowerTimeLinks() );
18
20
  mainLinks.push( XHTML.getLink( "./list_families.html", "All Families" ) );
19
21
  mainLinks.push( XHTML.getLink( "./list_species.html", "All Species" ) );
20
22
  mainLinks.push( XHTML.getLink( "./glossary.html", "Glossary" ) );
@@ -33,6 +35,12 @@ class TOCPage extends EBookPage {
33
35
  }
34
36
  return html + XHTML.wrap( "ol", XHTML.arrayToLI( links ) );
35
37
  }
38
+
39
+ #getFlowerTimeLinks() {
40
+ const html = XHTML.getLink( "fm.html", "Flowering Times" );
41
+ return html + PageListFlowers.renderMonthLinks();
42
+ }
43
+
36
44
  }
37
45
 
38
46
  export { TOCPage };
@@ -4,6 +4,7 @@ import { GlossaryPages } from "./glossarypages.js";
4
4
  import { Images } from "./images.js";
5
5
  import { PageListFamilies } from "./pages/page_list_families.js";
6
6
  import { PageListFlowerColor } from "./pages/page_list_flower_color.js";
7
+ import { PageListFlowers } from "./pages/page_list_flowers.js";
7
8
  import { PageListSpecies } from "./pages/page_list_species.js";
8
9
  import { TaxonPage } from "./pages/taxonpage.js";
9
10
  import { TOCPage } from "./pages/tocpage.js";
@@ -44,6 +45,9 @@ class PlantBook extends EBook {
44
45
  for ( const colorName of FLOWER_COLOR_NAMES ) {
45
46
  new PageListFlowerColor( contentDir, Taxa.getFlowerColor( colorName ) ).create();
46
47
  }
48
+
49
+ PageListFlowers.createPages( contentDir );
50
+
47
51
  new PageListFamilies( contentDir ).create();
48
52
  for ( const family of Families.getFamilies() ) {
49
53
  const taxa = family.getTaxa();
@@ -89,6 +93,7 @@ class PlantBook extends EBook {
89
93
  xml += "<item id=\"t" + index + "\" href=\"" + taxon.getFileName() + "\" media-type=\"application/xhtml+xml\" />";
90
94
  }
91
95
 
96
+ xml += PageListFlowers.getManifestEntries();
92
97
  xml += this.#glossary.getManifestEntries();
93
98
  xml += this.#images.getManifestEntries();
94
99
 
@@ -103,6 +108,8 @@ class PlantBook extends EBook {
103
108
  const color = Taxa.getFlowerColor( colorName );
104
109
  xml += "<itemref idref=\"l" + color.getColorName() + "\"/>";
105
110
  }
111
+ xml += PageListFlowers.getSpineEntries();
112
+
106
113
  xml += "<itemref idref=\"lfamilies\"/>";
107
114
  xml += "<itemref idref=\"lspecies\"/>";
108
115
 
@@ -20,11 +20,20 @@ class GenericPage {
20
20
  }
21
21
 
22
22
  getDefaultIntro() {
23
+ let html = this.getFrontMatter();
24
+ return html + this.getMarkdown();
25
+ }
23
26
 
24
- let html = this.#getFrontMatter();
27
+ getFrontMatter() {
28
+ return "---\n"
29
+ + "title: \"" + this.#title + "\"\n"
30
+ + ( this.#js ? ( "js: " + this.#js + "\n" ) : "" )
31
+ + "---\n";
32
+ }
25
33
 
34
+ getMarkdown() {
26
35
  // Include site-specific markdown.
27
- html += this.#getMarkdown( "intros" );
36
+ let html = this.#getMarkdown( "intros" );
28
37
 
29
38
  // Include package markdown.
30
39
  const mdPath = Config.getPackageDir() + "/data/text/" + this.#baseFileName + ".md";
@@ -35,13 +44,6 @@ class GenericPage {
35
44
  return html;
36
45
  }
37
46
 
38
- #getFrontMatter() {
39
- return "---\n"
40
- + "title: \"" + this.#title + "\"\n"
41
- + ( this.#js ? ( "js: " + this.#js + "\n" ) : "" )
42
- + "---\n";
43
- }
44
-
45
47
  #getMarkdown( path ) {
46
48
  const textPath = path + "/" + this.#baseFileName + ".md";
47
49
  if ( !Jekyll.hasInclude( this.#outputDir, textPath ) ) {
package/lib/index.d.ts CHANGED
@@ -27,6 +27,10 @@ export class DataLoader {
27
27
  static init(taxaDir: any): void;
28
28
  static load(options: any): void;
29
29
  }
30
+ export class DateUtils {
31
+ static getMonthName(monthNum: any): string;
32
+ static monthRangesOverlap(r1: any, r2: any): any;
33
+ }
30
34
  export class ErrorLog {
31
35
  static "__#8@#errors": any[];
32
36
  static log(...args: any[]): void;
@@ -83,6 +87,8 @@ export class GenericPage {
83
87
  constructor(outputDir: any, title: any, baseFileName: any, js: any);
84
88
  getBaseFileName(): any;
85
89
  getDefaultIntro(): string;
90
+ getFrontMatter(): string;
91
+ getMarkdown(): any;
86
92
  getOutputDir(): any;
87
93
  getTitle(): any;
88
94
  writeFile(html: any): void;
@@ -216,6 +222,8 @@ export namespace TAXA_LIST_COLS {
216
222
  }
217
223
  import { Taxon } from "./taxon.js";
218
224
  export namespace TAXA_COLNAMES {
225
+ const BLOOM_START: string;
226
+ const BLOOM_END: string;
219
227
  const COMMON_NAME: string;
220
228
  const FLOWER_COLOR: string;
221
229
  }
@@ -223,6 +231,8 @@ export class Taxon {
223
231
  constructor(data: any);
224
232
  addSynonym(syn: any, type: any): void;
225
233
  getBaseFileName(): any;
234
+ getBloomEnd(): any;
235
+ getBloomStart(): any;
226
236
  getCalfloraName(): any;
227
237
  getCalfloraID(): any;
228
238
  getCalfloraTaxonLink(): string;
package/lib/taxon.js CHANGED
@@ -4,6 +4,8 @@ import { HTML } from "./html.js";
4
4
  import { RarePlants } from "./rareplants.js";
5
5
 
6
6
  const TAXA_COLNAMES = {
7
+ BLOOM_START: "bloom_start",
8
+ BLOOM_END: "bloom_end",
7
9
  COMMON_NAME: "common name",
8
10
  FLOWER_COLOR: "flower_color",
9
11
  };
@@ -20,6 +22,8 @@ class Taxon {
20
22
  #iNatID;
21
23
  #iNatSyn;
22
24
  #flowerColors;
25
+ #bloomStart;
26
+ #bloomEnd;
23
27
  #rpiID;
24
28
  #rankRPI;
25
29
  #cesa;
@@ -44,6 +48,8 @@ class Taxon {
44
48
  this.#iNatID = data[ "inat id" ];
45
49
  const colors = data[ TAXA_COLNAMES.FLOWER_COLOR ];
46
50
  this.#flowerColors = colors ? colors.split( "," ) : undefined;
51
+ this.#bloomStart = data[ TAXA_COLNAMES.BLOOM_START ];
52
+ this.#bloomEnd = data[ TAXA_COLNAMES.BLOOM_END ];
47
53
  this.#rpiID = data[ "RPI ID" ];
48
54
  this.#rankRPI = data[ "CRPR" ];
49
55
  this.#cesa = cesa ? cesa : undefined;
@@ -72,6 +78,14 @@ class Taxon {
72
78
  return this.#name.replaceAll( " ", "-" ).replaceAll( ".", "" );
73
79
  }
74
80
 
81
+ getBloomEnd() {
82
+ return this.#bloomEnd;
83
+ }
84
+
85
+ getBloomStart() {
86
+ return this.#bloomStart;
87
+ }
88
+
75
89
  getCalfloraName() {
76
90
  if ( this.#cfSyn ) {
77
91
  return this.#cfSyn;
@@ -4,6 +4,7 @@ import { Config } from "../config.js";
4
4
  import { RarePlants } from "../rareplants.js";
5
5
  import { GenericPage } from "../genericpage.js";
6
6
  import { ExternalSites } from "../externalsites.js";
7
+ import { DateUtils } from "../dateutils.js";
7
8
 
8
9
  class PageTaxon extends GenericPage {
9
10
 
@@ -14,6 +15,28 @@ class PageTaxon extends GenericPage {
14
15
  this.#taxon = taxon;
15
16
  }
16
17
 
18
+ getFlowerInfo() {
19
+
20
+ const colors = this.#taxon.getFlowerColors();
21
+ const monthStart = this.#taxon.getBloomStart();
22
+ const monthEnd = this.#taxon.getBloomEnd();
23
+
24
+ if ( !colors && !monthStart ) {
25
+ return "";
26
+ }
27
+
28
+ let html = "Flowers: ";
29
+ if ( colors ) {
30
+ for ( const color of colors ) {
31
+ html += HTML.textElement( "img", "", { src: "/i/f-" + color + ".svg", alt: color + " flowers", title: color, class: "flower-color" } );
32
+ }
33
+ }
34
+ if ( monthStart ) {
35
+ html += DateUtils.getMonthName( monthStart ) + "-" + DateUtils.getMonthName( monthEnd );
36
+ }
37
+ return HTML.wrap( "div", html, { class: "section" } );
38
+ }
39
+
17
40
  #getInfoLinks() {
18
41
  const links = [];
19
42
  const jepsonID = this.#taxon.getJepsonID();
@@ -131,7 +154,7 @@ class PageTaxon extends GenericPage {
131
154
 
132
155
  render() {
133
156
 
134
- let html = this.getDefaultIntro();
157
+ let html = this.getFrontMatter();
135
158
 
136
159
  html += "<div class=\"wrapper\">";
137
160
 
@@ -153,6 +176,10 @@ class PageTaxon extends GenericPage {
153
176
 
154
177
  html += "</div>";
155
178
 
179
+ html += this.getFlowerInfo();
180
+
181
+ html += this.getMarkdown();
182
+
156
183
  html += "<div class=\"grid borders\">";
157
184
  html += this.#getListSectionHTML( this.#getInfoLinks(), "References", "info" );
158
185
  html += this.#getListSectionHTML( this.#getObsLinks(), "Observations", "obs" );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ca-plant-list/ca-plant-list",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Tools to create Jekyll files for a website listing plants in an area of California.",
5
5
  "license": "MIT",
6
6
  "repository": {