@ca-plant-list/ca-plant-list 0.4.3 → 0.4.6
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/.prettierrc +1 -0
- package/README.md +27 -1
- package/data/config.json +5 -0
- package/data/inattaxonphotos.csv +6059 -0
- package/data/taxa.csv +1 -0
- package/data/text/Rosa-rubiginosa.footer.md +3 -0
- package/eslint.config.mjs +13 -0
- package/jekyll/assets/css/main.css +59 -59
- package/jekyll/index.md +3 -0
- package/lib/config.js +12 -4
- package/lib/ebook/ebook.js +178 -179
- package/lib/ebook/plantbook.js +147 -139
- package/lib/genericpage.js +3 -4
- package/lib/htmltaxon.js +118 -123
- package/lib/inat_photo.js +43 -0
- package/lib/index.d.ts +12 -9
- package/lib/markdown.js +4 -0
- package/lib/pagerenderer.js +220 -221
- package/lib/photo.js +44 -0
- package/lib/taxa.js +37 -3
- package/lib/taxon.js +13 -0
- package/lib/util.js +20 -0
- package/lib/web/pagetaxon.js +212 -181
- package/package.json +9 -6
- package/scripts/build-site.js +1 -1
- package/scripts/inattaxonphotos.js +106 -0
- package/types/classes.d.ts +55 -9
- package/.vscode/settings.json +0 -11
package/types/classes.d.ts
CHANGED
@@ -10,20 +10,20 @@ declare class Config {
|
|
10
10
|
name: string,
|
11
11
|
subcategory?: string,
|
12
12
|
defaultValue?: string
|
13
|
-
): string;
|
13
|
+
): string | undefined;
|
14
14
|
getCountyCodes(): string[];
|
15
15
|
getLabel(name: string, dflt: string): string;
|
16
16
|
}
|
17
17
|
|
18
18
|
declare class ErrorLog {
|
19
19
|
log(...args: string[]): void;
|
20
|
-
write();
|
20
|
+
write(): void;
|
21
21
|
}
|
22
22
|
|
23
23
|
declare class Families {
|
24
24
|
getFamilies(): Family[];
|
25
25
|
getFamily(name: string): Family;
|
26
|
-
renderPages(outputDir: string, cols?: TaxaCol[]);
|
26
|
+
renderPages(outputDir: string, cols?: TaxaCol[]): void;
|
27
27
|
}
|
28
28
|
|
29
29
|
declare class Family {
|
@@ -41,7 +41,7 @@ declare class FlowerColor {
|
|
41
41
|
}
|
42
42
|
|
43
43
|
declare class Genera {
|
44
|
-
addTaxon(Taxon);
|
44
|
+
addTaxon(taxon: Taxon): void;
|
45
45
|
getGenus(name: string): Genus;
|
46
46
|
}
|
47
47
|
|
@@ -67,13 +67,13 @@ declare class InatObsOptions {
|
|
67
67
|
}
|
68
68
|
|
69
69
|
declare class SiteGenerator {
|
70
|
-
copyIllustrations(flowerColors: FlowerColor[]);
|
71
|
-
mkdir(path: string);
|
70
|
+
copyIllustrations(flowerColors: FlowerColor[]): void;
|
71
|
+
mkdir(path: string): void;
|
72
72
|
writeTemplate(
|
73
73
|
content: string,
|
74
|
-
attributes:
|
74
|
+
attributes: Record<string, string>,
|
75
75
|
filename: string
|
76
|
-
);
|
76
|
+
): void;
|
77
77
|
}
|
78
78
|
|
79
79
|
declare class SynonymData {
|
@@ -91,7 +91,7 @@ declare class Taxa {
|
|
91
91
|
|
92
92
|
declare class TaxaCol {
|
93
93
|
class?: string;
|
94
|
-
data:
|
94
|
+
data: (taxon:Taxon)=>string
|
95
95
|
title: string;
|
96
96
|
}
|
97
97
|
|
@@ -120,6 +120,7 @@ declare class Taxon {
|
|
120
120
|
getJepsonID(): string;
|
121
121
|
getLifeCycle(): string;
|
122
122
|
getName(): string;
|
123
|
+
getPhotos(): Photo[];
|
123
124
|
getRPIRank(): string;
|
124
125
|
getRPIRankAndThreat(): string;
|
125
126
|
getRPIRankAndThreatTooltip(): string;
|
@@ -152,3 +153,48 @@ declare class TaxonImage {
|
|
152
153
|
getCaption(): string | undefined;
|
153
154
|
getSrc(): string;
|
154
155
|
}
|
156
|
+
|
157
|
+
type PhotoRights = "CC0"| "CC BY"| "CC BY-NC"| "C"|null;
|
158
|
+
|
159
|
+
declare class Photo {
|
160
|
+
url?: string;
|
161
|
+
rightsHolder: null | string;
|
162
|
+
rights?: PhotoRights;
|
163
|
+
getUrl: ( ) => string;
|
164
|
+
getSourceUrl: ( ) => string;
|
165
|
+
}
|
166
|
+
|
167
|
+
declare class InatPhoto extends Photo {
|
168
|
+
inatPhotoId: number;
|
169
|
+
ext: string;
|
170
|
+
}
|
171
|
+
|
172
|
+
type InatLicenseCode = "cc-by-nc-sa"
|
173
|
+
| "cc-by-nc"
|
174
|
+
| "cc-by-nc-nd"
|
175
|
+
| "cc-by"
|
176
|
+
| "cc-by-sa"
|
177
|
+
| "cc-by-nd"
|
178
|
+
| "pd"
|
179
|
+
| "gdfl"
|
180
|
+
| "cc0";
|
181
|
+
|
182
|
+
declare class InatCsvPhoto {
|
183
|
+
name: string;
|
184
|
+
id: number;
|
185
|
+
ext: string;
|
186
|
+
licenseCode: InatLicenseCode;
|
187
|
+
attrName: string;
|
188
|
+
}
|
189
|
+
|
190
|
+
declare class InatApiTaxon {
|
191
|
+
id: number;
|
192
|
+
taxon_photos: {
|
193
|
+
photo: {
|
194
|
+
id: number;
|
195
|
+
attribution: string;
|
196
|
+
license_code: InatLicenseCode
|
197
|
+
medium_url: string;
|
198
|
+
}
|
199
|
+
}[]
|
200
|
+
}
|
package/.vscode/settings.json
DELETED