@ca-plant-list/ca-plant-list 0.1.17 → 0.1.19
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/families.json +788 -197
- package/data/genera.json +22 -26
- package/jekyll/assets/css/main.css +19 -0
- package/lib/families.js +85 -24
- package/lib/files.js +1 -1
- package/lib/genericpage.js +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/pagerenderer.js +5 -5
- package/lib/pagetaxon.js +0 -10
- package/lib/rareplants.js +19 -0
- package/lib/taxa.js +7 -2
- package/lib/taxon.js +13 -1
- package/package.json +1 -1
- package/lib/htmlpage.js +0 -21
package/data/genera.json
CHANGED
@@ -11,10 +11,6 @@
|
|
11
11
|
"family": "Lycopodiaceae",
|
12
12
|
"id": "9179"
|
13
13
|
},
|
14
|
-
"Rhinotropis": {
|
15
|
-
"family": "Polygalaceae",
|
16
|
-
"id": 99965
|
17
|
-
},
|
18
14
|
"Selaginella": {
|
19
15
|
"family": "Selaginellaceae",
|
20
16
|
"id": "8877"
|
@@ -2091,6 +2087,10 @@
|
|
2091
2087
|
"family": "Caryophyllaceae",
|
2092
2088
|
"id": "10424"
|
2093
2089
|
},
|
2090
|
+
"Atocion": {
|
2091
|
+
"family": "Caryophyllaceae",
|
2092
|
+
"id": "85146"
|
2093
|
+
},
|
2094
2094
|
"Agrostemma": {
|
2095
2095
|
"family": "Caryophyllaceae",
|
2096
2096
|
"id": "10425"
|
@@ -2107,6 +2107,10 @@
|
|
2107
2107
|
"family": "Caryophyllaceae",
|
2108
2108
|
"id": "10429"
|
2109
2109
|
},
|
2110
|
+
"Cherleria": {
|
2111
|
+
"family": "Caryophyllaceae",
|
2112
|
+
"id": "103805"
|
2113
|
+
},
|
2110
2114
|
"Dianthus": {
|
2111
2115
|
"family": "Caryophyllaceae",
|
2112
2116
|
"id": "10431"
|
@@ -2119,6 +2123,10 @@
|
|
2119
2123
|
"family": "Caryophyllaceae",
|
2120
2124
|
"id": "10434"
|
2121
2125
|
},
|
2126
|
+
"Hartmaniella": {
|
2127
|
+
"family": "Caryophyllaceae",
|
2128
|
+
"id": "82772"
|
2129
|
+
},
|
2122
2130
|
"Herniaria": {
|
2123
2131
|
"family": "Caryophyllaceae",
|
2124
2132
|
"id": "10435"
|
@@ -2135,10 +2143,6 @@
|
|
2135
2143
|
"family": "Caryophyllaceae",
|
2136
2144
|
"id": "10844"
|
2137
2145
|
},
|
2138
|
-
"Minuartia": {
|
2139
|
-
"family": "Caryophyllaceae",
|
2140
|
-
"id": "10845"
|
2141
|
-
},
|
2142
2146
|
"Moehringia": {
|
2143
2147
|
"family": "Caryophyllaceae",
|
2144
2148
|
"id": "10846"
|
@@ -2159,10 +2163,6 @@
|
|
2159
2163
|
"family": "Caryophyllaceae",
|
2160
2164
|
"id": "10841"
|
2161
2165
|
},
|
2162
|
-
"Pseudostellaria": {
|
2163
|
-
"family": "Caryophyllaceae",
|
2164
|
-
"id": "10842"
|
2165
|
-
},
|
2166
2166
|
"Sabulina": {
|
2167
2167
|
"family": "Caryophyllaceae",
|
2168
2168
|
"id": "69193"
|
@@ -2175,6 +2175,10 @@
|
|
2175
2175
|
"family": "Caryophyllaceae",
|
2176
2176
|
"id": "10855"
|
2177
2177
|
},
|
2178
|
+
"Schizotechium": {
|
2179
|
+
"family": "Caryophyllaceae",
|
2180
|
+
"id": "85148"
|
2181
|
+
},
|
2178
2182
|
"Scleranthus": {
|
2179
2183
|
"family": "Caryophyllaceae",
|
2180
2184
|
"id": "10857"
|
@@ -2199,14 +2203,6 @@
|
|
2199
2203
|
"family": "Caryophyllaceae",
|
2200
2204
|
"id": "10852"
|
2201
2205
|
},
|
2202
|
-
"Vaccaria": {
|
2203
|
-
"family": "Caryophyllaceae",
|
2204
|
-
"id": "10862"
|
2205
|
-
},
|
2206
|
-
"Velezia": {
|
2207
|
-
"family": "Caryophyllaceae",
|
2208
|
-
"id": "10863"
|
2209
|
-
},
|
2210
2206
|
"Euonymus": {
|
2211
2207
|
"family": "Celastraceae",
|
2212
2208
|
"id": "9802"
|
@@ -2275,10 +2271,6 @@
|
|
2275
2271
|
"family": "Chenopodiaceae",
|
2276
2272
|
"id": "11499"
|
2277
2273
|
},
|
2278
|
-
"Kochia": {
|
2279
|
-
"family": "Chenopodiaceae",
|
2280
|
-
"id": "11500"
|
2281
|
-
},
|
2282
2274
|
"Krascheninnikovia": {
|
2283
2275
|
"family": "Chenopodiaceae",
|
2284
2276
|
"id": "11501"
|
@@ -2291,6 +2283,10 @@
|
|
2291
2283
|
"family": "Chenopodiaceae",
|
2292
2284
|
"id": "11502"
|
2293
2285
|
},
|
2286
|
+
"Neokochia": {
|
2287
|
+
"family": "Chenopodiaceae",
|
2288
|
+
"id": "91852"
|
2289
|
+
},
|
2294
2290
|
"Salicornia": {
|
2295
2291
|
"family": "Chenopodiaceae",
|
2296
2292
|
"id": "11506"
|
@@ -3847,9 +3843,9 @@
|
|
3847
3843
|
"family": "Polemoniaceae",
|
3848
3844
|
"id": "80251"
|
3849
3845
|
},
|
3850
|
-
"
|
3846
|
+
"Rhinotropis": {
|
3851
3847
|
"family": "Polygalaceae",
|
3852
|
-
"id": "
|
3848
|
+
"id": "99965"
|
3853
3849
|
},
|
3854
3850
|
"Acanthoscyphus": {
|
3855
3851
|
"family": "Polygonaceae",
|
@@ -35,6 +35,25 @@ th {
|
|
35
35
|
vertical-align: bottom;
|
36
36
|
}
|
37
37
|
|
38
|
+
ul.listmenu {
|
39
|
+
display: flex;
|
40
|
+
padding: 0;
|
41
|
+
}
|
42
|
+
|
43
|
+
ul.listmenu li {
|
44
|
+
display: inline-block;
|
45
|
+
padding: 0;
|
46
|
+
padding-right: .25em;
|
47
|
+
}
|
48
|
+
|
49
|
+
ul.listmenu li::after {
|
50
|
+
content: " |";
|
51
|
+
}
|
52
|
+
|
53
|
+
ul.listmenu li:last-child:after {
|
54
|
+
content: "";
|
55
|
+
}
|
56
|
+
|
38
57
|
/* Lists */
|
39
58
|
|
40
59
|
span.native {
|
package/lib/families.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { GenericPage } from "./genericpage.js";
|
2
2
|
import { HTML } from "./html.js";
|
3
3
|
import { Jepson } from "./jepson.js";
|
4
4
|
import { Taxa } from "./taxa.js";
|
@@ -20,41 +20,54 @@ class Families {
|
|
20
20
|
|
21
21
|
this.#families = JSON.parse( Files.read( dataDir + "/families.json" ) );
|
22
22
|
for ( const [ k, v ] of Object.entries( this.#families ) ) {
|
23
|
-
this.#families[ k ] = new Family( k,
|
23
|
+
this.#families[ k ] = new Family( k, v );
|
24
24
|
}
|
25
25
|
|
26
26
|
Genera.init( dataDir );
|
27
27
|
|
28
28
|
}
|
29
29
|
|
30
|
-
static renderPages( outputDir,
|
31
|
-
new PageFamilyList(
|
30
|
+
static renderPages( outputDir, taxaColumns ) {
|
31
|
+
new PageFamilyList( outputDir, this.#families ).render( taxaColumns );
|
32
32
|
|
33
|
-
|
33
|
+
const names = Object.keys( this.#families );
|
34
|
+
for ( const name of names.sort() ) {
|
35
|
+
const family = this.#families[ name ];
|
34
36
|
if ( family.getTaxa() ) {
|
35
|
-
new PageFamily( family ).render(
|
37
|
+
new PageFamily( outputDir, family ).render( taxaColumns );
|
36
38
|
}
|
37
39
|
}
|
38
40
|
}
|
39
41
|
|
40
42
|
}
|
41
43
|
|
42
|
-
class PageFamilyList extends
|
44
|
+
class PageFamilyList extends GenericPage {
|
43
45
|
|
44
46
|
#families;
|
45
47
|
|
46
|
-
constructor( families ) {
|
47
|
-
super();
|
48
|
+
constructor( outputDir, families ) {
|
49
|
+
super( outputDir, "Families", "list_families" );
|
48
50
|
this.#families = families;
|
49
51
|
}
|
50
52
|
|
51
|
-
render(
|
53
|
+
render( taxaColumns ) {
|
52
54
|
|
53
|
-
|
55
|
+
let html = this.getDefaultIntro();
|
54
56
|
|
55
|
-
|
57
|
+
const sections = Sections.getSections();
|
58
|
+
const sectionLinks = [];
|
59
|
+
for ( const name of Object.keys( sections ).sort() ) {
|
56
60
|
|
57
|
-
|
61
|
+
const taxa = sections[ name ];
|
62
|
+
|
63
|
+
// Render the section page.
|
64
|
+
new PageSection( this.getOutputDir(), name, taxa ).render( taxaColumns );
|
65
|
+
|
66
|
+
// Render the link.
|
67
|
+
const href = "./" + name + ".html";
|
68
|
+
sectionLinks.push( HTML.getLink( href, name ) + " (" + taxa.length + ")" );
|
69
|
+
}
|
70
|
+
html += HTML.wrap( "ul", HTML.arrayToLI( sectionLinks ), { class: "listmenu" } );
|
58
71
|
|
59
72
|
html += "<table>";
|
60
73
|
html += "<thead>";
|
@@ -63,7 +76,9 @@ class PageFamilyList extends HTMLPage {
|
|
63
76
|
html += "</thead>";
|
64
77
|
|
65
78
|
html += "<tbody>";
|
66
|
-
|
79
|
+
const names = Object.keys( this.#families ).sort();
|
80
|
+
for ( const name of names ) {
|
81
|
+
const family = this.#families[ name ];
|
67
82
|
const taxa = family.getTaxa();
|
68
83
|
if ( !taxa ) {
|
69
84
|
continue;
|
@@ -76,24 +91,22 @@ class PageFamilyList extends HTMLPage {
|
|
76
91
|
|
77
92
|
html += "</table>";
|
78
93
|
|
79
|
-
this.writeFile(
|
94
|
+
this.writeFile( html );
|
80
95
|
}
|
81
96
|
}
|
82
97
|
|
83
|
-
class PageFamily extends
|
98
|
+
class PageFamily extends GenericPage {
|
84
99
|
|
85
100
|
#family;
|
86
101
|
|
87
|
-
constructor( family ) {
|
88
|
-
super();
|
102
|
+
constructor( outputDir, family ) {
|
103
|
+
super( outputDir, family.getName(), family.getBaseFileName() );
|
89
104
|
this.#family = family;
|
90
105
|
}
|
91
106
|
|
92
|
-
render(
|
93
|
-
|
94
|
-
let html = this.getFrontMatter( this.#family.getName() );
|
107
|
+
render( columns ) {
|
95
108
|
|
96
|
-
html
|
109
|
+
let html = this.getDefaultIntro();
|
97
110
|
|
98
111
|
html += HTML.wrap(
|
99
112
|
"div",
|
@@ -103,7 +116,27 @@ class PageFamily extends HTMLPage {
|
|
103
116
|
|
104
117
|
html += Taxa.getHTMLTable( this.#family.getTaxa(), columns );
|
105
118
|
|
106
|
-
this.writeFile(
|
119
|
+
this.writeFile( html );
|
120
|
+
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
class PageSection extends GenericPage {
|
125
|
+
|
126
|
+
#taxa;
|
127
|
+
|
128
|
+
constructor( outputDir, name, taxa ) {
|
129
|
+
super( outputDir, name, name );
|
130
|
+
this.#taxa = taxa;
|
131
|
+
}
|
132
|
+
|
133
|
+
render( columns ) {
|
134
|
+
|
135
|
+
let html = this.getDefaultIntro();
|
136
|
+
|
137
|
+
html += Taxa.getHTMLTable( this.#taxa, columns );
|
138
|
+
|
139
|
+
this.writeFile( html );
|
107
140
|
|
108
141
|
}
|
109
142
|
}
|
@@ -123,10 +156,15 @@ class Family {
|
|
123
156
|
this.#data.taxa = [];
|
124
157
|
}
|
125
158
|
this.#data.taxa.push( taxon );
|
159
|
+
Sections.addTaxon( this.getSectionName(), taxon );
|
160
|
+
}
|
161
|
+
|
162
|
+
getBaseFileName() {
|
163
|
+
return this.getName();
|
126
164
|
}
|
127
165
|
|
128
166
|
getFileName( ext = "html" ) {
|
129
|
-
return this.
|
167
|
+
return this.getBaseFileName() + "." + ext;
|
130
168
|
}
|
131
169
|
|
132
170
|
getJepsonID() {
|
@@ -137,10 +175,33 @@ class Family {
|
|
137
175
|
return this.#name;
|
138
176
|
}
|
139
177
|
|
178
|
+
getSectionName() {
|
179
|
+
return this.#data.section;
|
180
|
+
}
|
181
|
+
|
140
182
|
getTaxa() {
|
141
183
|
return this.#data.taxa;
|
142
184
|
}
|
143
185
|
|
144
186
|
}
|
145
187
|
|
188
|
+
class Sections {
|
189
|
+
|
190
|
+
static #sections = {};
|
191
|
+
|
192
|
+
static addTaxon( name, taxon ) {
|
193
|
+
let section = this.#sections[ name ];
|
194
|
+
if ( !section ) {
|
195
|
+
section = [];
|
196
|
+
this.#sections[ name ] = section;
|
197
|
+
}
|
198
|
+
section.push( taxon );
|
199
|
+
}
|
200
|
+
|
201
|
+
static getSections() {
|
202
|
+
return this.#sections;
|
203
|
+
}
|
204
|
+
|
205
|
+
}
|
206
|
+
|
146
207
|
export { Families };
|
package/lib/files.js
CHANGED
@@ -27,7 +27,7 @@ class Files {
|
|
27
27
|
* @param {string|URL} url
|
28
28
|
* @param {string|undefined} targetFileName If targetFileName is undefined, the data will be retrieved but not written to a file.
|
29
29
|
* @param {Object} [headers={}] Request Headers.
|
30
|
-
* @returns {Headers} The Response headers.
|
30
|
+
* @returns {Promise<Headers>} The Response headers.
|
31
31
|
*/
|
32
32
|
static async fetch( url, targetFileName, headers = {} ) {
|
33
33
|
const response = await fetch( url, headers );
|
package/lib/genericpage.js
CHANGED
@@ -21,7 +21,7 @@ class GenericPage {
|
|
21
21
|
getDefaultIntro() {
|
22
22
|
let html = this.#getFrontMatter();
|
23
23
|
html += HTML.textElement( "h1", this.#title );
|
24
|
-
const introPath = "
|
24
|
+
const introPath = "intros/" + this.#baseFileName + ".md";
|
25
25
|
if ( Jekyll.hasInclude( this.#outputDir, introPath ) ) {
|
26
26
|
html += HTML.wrap( "div", Jekyll.include( introPath ), { class: "section" } );
|
27
27
|
}
|
package/lib/index.d.ts
CHANGED
@@ -7,9 +7,9 @@ export class Files {
|
|
7
7
|
* @param {string|URL} url
|
8
8
|
* @param {string|undefined} targetFileName If targetFileName is undefined, the data will be retrieved but not written to a file.
|
9
9
|
* @param {Object} [headers={}] Request Headers.
|
10
|
-
* @returns {Headers} The Response headers.
|
10
|
+
* @returns {Promise<Headers>} The Response headers.
|
11
11
|
*/
|
12
|
-
static fetch(url: string | URL, targetFileName: string | undefined, headers?: any): Headers
|
12
|
+
static fetch(url: string | URL, targetFileName: string | undefined, headers?: any): Promise<Headers>;
|
13
13
|
static mkdir(path: any): void;
|
14
14
|
static read(path: any): string;
|
15
15
|
static rmDir(dir: any): void;
|
@@ -29,7 +29,7 @@ export class HTML {
|
|
29
29
|
* @deprecated
|
30
30
|
*/
|
31
31
|
static getElement(elName: any, text: any, attributes?: {}, options?: number): string;
|
32
|
-
static "__#
|
32
|
+
static "__#3@#getElement"(elName: any, text: any, attributes: any, escape: any): string;
|
33
33
|
/**
|
34
34
|
* Generate HTML for an <a> element.
|
35
35
|
* @param {string|undefined} href
|
package/lib/pagerenderer.js
CHANGED
@@ -7,7 +7,7 @@ import { BasePageRenderer } from "./basepagerenderer.js";
|
|
7
7
|
import { Files } from "./files.js";
|
8
8
|
import { GenericPage } from "./genericpage.js";
|
9
9
|
|
10
|
-
const
|
10
|
+
const ENDANGERED_COLS = [ TAXA_LIST_COLS.SPECIES, TAXA_LIST_COLS.COMMON_NAME, TAXA_LIST_COLS.CESA, TAXA_LIST_COLS.FESA ];
|
11
11
|
const RPI_COLUMNS = [ TAXA_LIST_COLS.SPECIES_BARE, TAXA_LIST_COLS.COMMON_NAME, TAXA_LIST_COLS.CNPS_RANK ];
|
12
12
|
|
13
13
|
class PageRenderer extends BasePageRenderer {
|
@@ -124,10 +124,10 @@ class PageRenderer extends BasePageRenderer {
|
|
124
124
|
]
|
125
125
|
},
|
126
126
|
{
|
127
|
-
name: "
|
128
|
-
filename: "
|
129
|
-
include: ( t ) => t.getCESA()
|
130
|
-
columns:
|
127
|
+
name: "Endangered Species",
|
128
|
+
filename: "list_endangered",
|
129
|
+
include: ( t ) => ( t.getCESA() || t.getFESA() ),
|
130
|
+
columns: ENDANGERED_COLS,
|
131
131
|
},
|
132
132
|
]
|
133
133
|
},
|
package/lib/pagetaxon.js
CHANGED
@@ -3,7 +3,6 @@ import { Jepson } from "./jepson.js";
|
|
3
3
|
import { Config } from "./config.js";
|
4
4
|
import { RarePlants } from "./rareplants.js";
|
5
5
|
import { GenericPage } from "./genericpage.js";
|
6
|
-
import { Files } from "./files.js";
|
7
6
|
|
8
7
|
class PageTaxon extends GenericPage {
|
9
8
|
|
@@ -138,15 +137,6 @@ class PageTaxon extends GenericPage {
|
|
138
137
|
|
139
138
|
html += "</div>";
|
140
139
|
|
141
|
-
const introName = "intros/" + this.#taxon.getFileName( "md" );
|
142
|
-
if ( Files.exists( "./jekyll/_includes/" + introName ) ) {
|
143
|
-
html += HTML.wrap(
|
144
|
-
"div",
|
145
|
-
"{% capture my_include %}{% include " + introName + "%}{% endcapture %}{{ my_include | markdownify }}",
|
146
|
-
{ class: "section" }
|
147
|
-
);
|
148
|
-
}
|
149
|
-
|
150
140
|
html += "<div class=\"grid\">";
|
151
141
|
html += this.#getListSectionHTML( this.#getInfoLinks(), "Information", "info" );
|
152
142
|
html += this.#getListSectionHTML( this.#getObsLinks(), "Observations", "obs" );
|
package/lib/rareplants.js
CHANGED
@@ -20,12 +20,31 @@ const CESA_DESCRIPS = {
|
|
20
20
|
"CT": "Threatened",
|
21
21
|
};
|
22
22
|
|
23
|
+
const FESA_DESCRIPS = {
|
24
|
+
"FE": "Endangered",
|
25
|
+
"FT": "Threatened",
|
26
|
+
"PE": "Proposed Endangered",
|
27
|
+
"PT": "Proposed Threatened",
|
28
|
+
"FC": "Candidate",
|
29
|
+
"FD": "Delisted",
|
30
|
+
};
|
31
|
+
|
23
32
|
class RarePlants {
|
24
33
|
|
25
34
|
static getCESADescription( cesa ) {
|
35
|
+
if ( !cesa ) {
|
36
|
+
return "";
|
37
|
+
}
|
26
38
|
return CESA_DESCRIPS[ cesa ];
|
27
39
|
}
|
28
40
|
|
41
|
+
static getFESADescription( fesa ) {
|
42
|
+
if ( !fesa ) {
|
43
|
+
return "";
|
44
|
+
}
|
45
|
+
return FESA_DESCRIPS[ fesa ];
|
46
|
+
}
|
47
|
+
|
29
48
|
static getRPIRankDescription( rank ) {
|
30
49
|
const pieces = rank.split( "." );
|
31
50
|
return RANK_DESCRIPS[ pieces[ 0 ] ];
|
package/lib/taxa.js
CHANGED
@@ -7,7 +7,7 @@ import { Exceptions } from "./exceptions.js";
|
|
7
7
|
|
8
8
|
const TAXA_LIST_COLS = {
|
9
9
|
CESA: {
|
10
|
-
title: "
|
10
|
+
title: "California",
|
11
11
|
data: ( t ) => RarePlants.getCESADescription( t.getCESA() )
|
12
12
|
},
|
13
13
|
COMMON_NAME: {
|
@@ -18,6 +18,10 @@ const TAXA_LIST_COLS = {
|
|
18
18
|
title: "CNPS Rank",
|
19
19
|
data: ( t ) => HTML.getToolTip( HTML.textElement( "span", t.getRPIRankAndThreat() ), t.getRPIRankAndThreatTooltip() )
|
20
20
|
},
|
21
|
+
FESA: {
|
22
|
+
title: "Federal",
|
23
|
+
data: ( t ) => RarePlants.getFESADescription( t.getFESA() )
|
24
|
+
},
|
21
25
|
SPECIES: {
|
22
26
|
title: "Species",
|
23
27
|
data: ( t ) => t.getHTMLLink( true, true )
|
@@ -94,7 +98,8 @@ class Taxa {
|
|
94
98
|
row[ "inat id" ],
|
95
99
|
row[ "RPI ID" ],
|
96
100
|
row[ "CRPR" ],
|
97
|
-
row[ "CESA" ]
|
101
|
+
row[ "CESA" ],
|
102
|
+
row[ "FESA" ]
|
98
103
|
);
|
99
104
|
if ( !jepsonID && !Exceptions.hasException( name, "jepson", "badjepsonid" ) ) {
|
100
105
|
ErrorLog.log( name, "has no Jepson ID" );
|
package/lib/taxon.js
CHANGED
@@ -18,9 +18,11 @@ class Taxon {
|
|
18
18
|
#rankRPI;
|
19
19
|
#cesa;
|
20
20
|
#fesa;
|
21
|
+
#rankCNDDB;
|
22
|
+
#rankGlobal;
|
21
23
|
#synonyms = [];
|
22
24
|
|
23
|
-
constructor( name, commonNames, status, jepsonID, calRecNum, iNatID, rpiID, rankRPI, cesa, fesa ) {
|
25
|
+
constructor( name, commonNames, status, jepsonID, calRecNum, iNatID, rpiID, rankRPI, cesa, fesa, rankCNDDB, rankGlobal ) {
|
24
26
|
this.#name = name;
|
25
27
|
this.#genus = name.split( " " )[ 0 ];
|
26
28
|
this.#commonNames = commonNames ? commonNames.split( "," ).map( t => t.trim() ) : [];
|
@@ -32,6 +34,8 @@ class Taxon {
|
|
32
34
|
this.#rankRPI = rankRPI;
|
33
35
|
this.#cesa = cesa ? cesa : undefined;
|
34
36
|
this.#fesa = fesa ? fesa : undefined;
|
37
|
+
this.#rankCNDDB = rankCNDDB ? rankCNDDB : undefined;
|
38
|
+
this.#rankGlobal = rankGlobal ? rankGlobal : undefined;
|
35
39
|
Genera.addTaxon( this );
|
36
40
|
}
|
37
41
|
|
@@ -78,6 +82,10 @@ class Taxon {
|
|
78
82
|
return this.#cesa;
|
79
83
|
}
|
80
84
|
|
85
|
+
getCNDDBRank() {
|
86
|
+
return this.#rankCNDDB;
|
87
|
+
}
|
88
|
+
|
81
89
|
getCommonNames() {
|
82
90
|
return this.#commonNames;
|
83
91
|
}
|
@@ -102,6 +110,10 @@ class Taxon {
|
|
102
110
|
return this.#genus;
|
103
111
|
}
|
104
112
|
|
113
|
+
getGlobalRank() {
|
114
|
+
return this.#rankGlobal;
|
115
|
+
}
|
116
|
+
|
105
117
|
getHTMLLink( href = true, includeRPI = true ) {
|
106
118
|
href = href ? ( "./" + this.getFileName() ) : undefined;
|
107
119
|
let className = this.isNative() ? "native" : "non-native";
|
package/package.json
CHANGED
package/lib/htmlpage.js
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
import { Files } from "./files.js";
|
2
|
-
|
3
|
-
/**
|
4
|
-
* @deprecated
|
5
|
-
*/
|
6
|
-
class HTMLPage {
|
7
|
-
|
8
|
-
getFrontMatter( title, js ) {
|
9
|
-
return "---\n"
|
10
|
-
+ "title: \"" + title + "\"\n"
|
11
|
-
+ ( js ? ( "js: " + js + "\n" ) : "" )
|
12
|
-
+ "---\n";
|
13
|
-
}
|
14
|
-
|
15
|
-
writeFile( outputDir, fileName, html ) {
|
16
|
-
Files.write( outputDir + "/" + fileName, html );
|
17
|
-
}
|
18
|
-
|
19
|
-
}
|
20
|
-
|
21
|
-
export { HTMLPage };
|