@ca-plant-list/ca-plant-list 0.3.1 → 0.3.3

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.
Files changed (59) hide show
  1. package/.vscode/settings.json +5 -0
  2. package/data/exceptions.json +88 -83
  3. package/data/glossary/ovary.md +3 -0
  4. package/data/glossary/pistil.md +3 -0
  5. package/data/glossary/stigma.md +3 -0
  6. package/data/glossary/style.md +3 -0
  7. package/data/illustrations/inkscape/pistil.svg +156 -0
  8. package/data/synonyms.csv +8 -2
  9. package/data/taxa.csv +56 -54
  10. package/data/text/Ceanothus-cuneatus-var-cuneatus.md +1 -0
  11. package/data/text/Ceanothus-leucodermis.md +1 -0
  12. package/data/text/Delphinium-californicum-subsp-californicum.md +1 -0
  13. package/data/text/Delphinium-decorum-subsp-decorum.md +1 -0
  14. package/data/text/Delphinium-hesperium-subsp-hesperium.md +1 -0
  15. package/data/text/Delphinium-patens-subsp-patens.md +1 -0
  16. package/data/text/Galium-andrewsii-subsp-gatense.md +1 -0
  17. package/data/text/Helianthella-californica-var-californica.md +1 -0
  18. package/data/text/Helianthella-castanea.md +1 -0
  19. package/data/text/Iris-macrosiphon.md +1 -0
  20. package/data/text/Lasthenia-californica-subsp-californica.md +1 -0
  21. package/data/text/Lasthenia-gracilis.md +1 -0
  22. package/data/text/Lithophragma-affine.md +1 -1
  23. package/data/text/Lithophragma-parviflorum-var-parviflorum.md +1 -1
  24. package/data/text/Lomatium-californicum.md +0 -0
  25. package/data/text/Lomatium-dasycarpum-subsp-dasycarpum.md +1 -0
  26. package/data/text/Lomatium-utriculatum.md +1 -0
  27. package/data/text/Nemophila-heterophylla.md +1 -0
  28. package/data/text/Nemophila-parviflora-var-parviflora.md +1 -0
  29. package/data/text/Plectritis-ciliosa.md +1 -0
  30. package/data/text/Plectritis-macrocera.md +1 -0
  31. package/data/text/Primula-clevelandii-var-patula.md +1 -0
  32. package/data/text/Primula-hendersonii.md +1 -0
  33. package/data/text/Sidalcea-diploscypha.md +1 -0
  34. package/data/text/Thysanocarpus-curvipes.md +1 -0
  35. package/data/text/Thysanocarpus-laciniatus.md +1 -0
  36. package/data/text/Trillium-chloropetalum.md +1 -1
  37. package/data/text/Viola-douglasii.md +1 -0
  38. package/data/text/Viola-pedunculata.md +1 -0
  39. package/data/text/Viola-purpurea-subsp-quercetorum.md +1 -0
  40. package/ebook/css/main.css +5 -0
  41. package/lib/basepagerenderer.js +30 -28
  42. package/lib/csv.js +13 -0
  43. package/lib/dateutils.js +36 -16
  44. package/lib/ebook/pages/taxonpage.js +63 -36
  45. package/lib/errorlog.js +16 -11
  46. package/lib/exceptions.js +2 -0
  47. package/lib/families.js +109 -71
  48. package/lib/files.js +103 -45
  49. package/lib/generictaxaloader.js +15 -7
  50. package/lib/html.js +2 -2
  51. package/lib/index.js +38 -3
  52. package/lib/taxa.js +175 -86
  53. package/lib/taxaloader.js +28 -15
  54. package/lib/taxaprocessor.js +6 -8
  55. package/lib/taxon.js +109 -56
  56. package/lib/web/pagetaxon.js +1 -1
  57. package/package.json +6 -8
  58. package/scripts/build-ebook.js +30 -25
  59. package/lib/index.d.ts +0 -327
package/lib/index.d.ts DELETED
@@ -1,327 +0,0 @@
1
- export class BasePageRenderer {
2
- static render(outputDir: any, taxa: any, familyCols: any): void;
3
- static renderTools(outputDir: any, taxa: any): void;
4
- }
5
- export class CommandAndTaxaProcessor extends CommandProcessor {
6
- constructor(commandName: any, commandDesc: any, optionDefs: any[], optionHelp: any[], commandHelp: any[], taxaLoaderClass: any);
7
- process(commandRunner: any): Promise<void>;
8
- #private;
9
- }
10
- import { CommandProcessor } from "./commandprocessor.js";
11
- export class CommandProcessor {
12
- /**
13
- * @param {String} commandName
14
- * @param {String} commandDesc
15
- * @param {*} optionDefs An array of command line options to be added to the standard options.
16
- * @param {*} optionHelp An array of help descriptions to be added to the standard options in the first section.
17
- * @param {*} commandHelp An array of help sections to be appended to the first option section in the help display.
18
- */
19
- constructor(commandName: string, commandDesc: string, optionDefs?: any, optionHelp?: any, commandHelp?: any);
20
- getOptions(): any;
21
- helpShown(): boolean;
22
- showHelp(): void;
23
- #private;
24
- }
25
- export class Config {
26
- static "__#1@#packageDir": string;
27
- static getPackageDir(): string;
28
- constructor(dataDir: any);
29
- getConfigValue(prefix: any, name: any, subcat: any, dflt: any): any;
30
- getCountyCodes(): any;
31
- getLabel(name: any, dflt: any): any;
32
- #private;
33
- }
34
- export class CSV {
35
- static getMap(dir: any, fileName: any): {};
36
- static "__#8@#getOptions"(fileName: any, columns: any, delimiter: any): {
37
- relax_column_count_less: boolean;
38
- };
39
- static parseFile(dir: any, fileName: any, columns: boolean, delimiter: any): any;
40
- static parseStream(dir: any, fileName: any, columns: boolean, delimiter: any, callback: any): Promise<void>;
41
- }
42
- export class DateUtils {
43
- static getMonthName(monthNum: any): string;
44
- static monthRangesOverlap(r1: any, r2: any): any;
45
- }
46
- export class ErrorLog {
47
- constructor(fileName: any, echo?: boolean);
48
- log(...args: any[]): void;
49
- write(): void;
50
- #private;
51
- }
52
- export class Exceptions {
53
- constructor(dir: any);
54
- getExceptions(): [string, any][];
55
- getValue(name: any, cat: any, subcat: any, defaultValue: any): any;
56
- hasException(name: any, cat: any, subcat: any): boolean;
57
- #private;
58
- }
59
- export class Families {
60
- static "__#12@#families": any;
61
- static getFamilies(): any[];
62
- static getFamily(familyName: any): any;
63
- static renderPages(outputDir: any, taxaColumns: any): void;
64
- }
65
- export class Files {
66
- static copyDir(srcDir: any, targetDir: any): void;
67
- static createFileFromStream(fileName: any, inStream: any): Promise<any>;
68
- static exists(path: any): boolean;
69
- /**
70
- * Retrieve data from a URL and write it to a file. If the response status is anything other than 200, an Error is thrown.
71
- * @param {string|URL} url
72
- * @param {string|undefined} targetFileName If targetFileName is undefined, the data will be retrieved but not written to a file.
73
- * @param {Object} [headers={}] Request Headers.
74
- * @returns {Promise<Headers>} The Response headers.
75
- */
76
- static fetch(url: string | URL, targetFileName: string | undefined, headers?: any): Promise<Headers>;
77
- static getDirEntries(path: any): string[];
78
- static isDir(path: any): boolean;
79
- static join(...paths: any[]): any;
80
- static mkdir(path: any): void;
81
- static read(path: any): string;
82
- static rmDir(dir: any): void;
83
- static write(path: any, data: any, overwrite?: boolean): void;
84
- static zipFileExtract(zipFilePath: any, fileNameToUnzip: any, targetFilePath: any): Promise<void>;
85
- }
86
- export class Genera {
87
- static "__#5@#genera": any;
88
- static addTaxon(taxon: any): void;
89
- static getGenus(genusName: any): Genus;
90
- static getFamily(genusName: any): any;
91
- }
92
- declare class Genus {
93
- constructor(data: any);
94
- getTaxa(): any;
95
- #private;
96
- }
97
- export {};
98
- export class GenericPage {
99
- constructor(outputDir: any, title: any, baseFileName: any, js: any);
100
- getBaseFileName(): any;
101
- getDefaultIntro(): string;
102
- getFrontMatter(): string;
103
- getMarkdown(): any;
104
- getOutputDir(): any;
105
- getTitle(): any;
106
- writeFile(html: any): void;
107
- #private;
108
- }
109
- export class GenericTaxaLoader {
110
- constructor(options: any);
111
- getErrorLog(): ErrorLog;
112
- getOptions(): any;
113
- getTaxa(): any;
114
- load(): Promise<void>;
115
- loadTaxa(): Promise<void>;
116
- writeErrorLog(): void;
117
- #private;
118
- }
119
- import { ErrorLog } from "./errorlog.js";
120
- export namespace HTML_OPTIONS {
121
- const OPEN_NEW: number;
122
- const NO_ESCAPE: number;
123
- }
124
- /** HTML utility functions. */
125
- export class HTML {
126
- static arrayToLI(items: any): any;
127
- static escapeAttribute(value: any): any;
128
- static escapeText(text: any): any;
129
- /**
130
- * @deprecated
131
- */
132
- static getElement(elName: any, text: any, attributes?: {}, options?: number): string;
133
- static "__#4@#getElement"(elName: any, text: any, attributes: any, escape: any): string;
134
- /**
135
- * Generate HTML for an &lt;a> element.
136
- * @param {string|undefined} href
137
- * @param {string} linkText
138
- * @param {Object} attributes
139
- * @param {boolean} openInNewWindow true if the link should open in a new window.
140
- * @returns {string} an HTML &lt;a> element.
141
- */
142
- static getLink(href: string | undefined, linkText: string, attributes: any, openInNewWindow: boolean): string;
143
- /**
144
- * Get a Bootstrap formatted tooltip element.
145
- * @param {string} text - The text or HTML that should trigger the tooltip on hover.
146
- * @param {string} tooltip - The tooltip text or HTML.
147
- * @param {Object} options
148
- * @param {boolean} options.icon [true] display an icon after the text
149
- * @returns {string} A &lt;span> element to be used as a Bootstrap tooltip.
150
- */
151
- static getToolTip(text: string, tooltip: string, options?: {
152
- icon: boolean;
153
- }): string;
154
- static renderAttribute(n: any, v: any): string;
155
- static renderAttributes(attributes: any): string;
156
- static textElement(elName: any, text: any, attributes?: {}): string;
157
- static wrap(elName: any, text: any, attributes?: {}): string;
158
- }
159
- import { BasePageRenderer } from "./basepagerenderer.js";
160
- import { CommandProcessor } from "./commandprocessor.js";
161
- import { CommandAndTaxaProcessor } from "./commandandtaxaprocessor.js";
162
- import { Config } from "./config.js";
163
- import { CSV } from "./csv.js";
164
- import { ErrorLog } from "./errorlog.js";
165
- import { Exceptions } from "./exceptions.js";
166
- import { Families } from "./families.js";
167
- import { Files } from "./files.js";
168
- import { GenericTaxaLoader } from "./generictaxaloader.js";
169
- import { HTML } from "./html.js";
170
- import { Jekyll } from "./jekyll.js";
171
- import { PlantBook } from "./ebook/plantbook.js";
172
- import { Taxa } from "./taxa.js";
173
- import { TaxaLoader } from "./taxaloader.js";
174
- import { TaxaProcessor } from "./taxaprocessor.js";
175
- import { TAXA_COLNAMES } from "./taxon.js";
176
- import { Taxon } from "./taxon.js";
177
- export { BasePageRenderer, CommandProcessor, CommandAndTaxaProcessor, Config, CSV, ErrorLog, Exceptions, Families, Files, GenericTaxaLoader, HTML, Jekyll, PlantBook, Taxa, TaxaLoader, TaxaProcessor, TAXA_COLNAMES, Taxon };
178
- export class Jekyll extends SiteGenerator {
179
- static getFrontMatter(atts: any): string;
180
- static hasInclude(baseDir: any, path: any): boolean;
181
- static include(path: any): string;
182
- static writeInclude(baseDir: any, path: any, data: any): void;
183
- writeTemplate(content: any, attributes: any, filename: any): void;
184
- }
185
- import { SiteGenerator } from "./sitegenerator.js";
186
- export class Jepson {
187
- static getEFloraLink(id: any): string;
188
- }
189
- export class Markdown {
190
- static "__#2@#md": any;
191
- static fileToHTML(filePath: any): any;
192
- static strToHTML(str: any): any;
193
- }
194
- export class RarePlants {
195
- static getCESADescription(cesa: any): any;
196
- static getFESADescription(fesa: any): any;
197
- static getRPIRankDescription(rank: any): any;
198
- static getRPIRankAndThreatDescriptions(rank: any): any[];
199
- }
200
- export class SiteGenerator {
201
- constructor(baseDir: any);
202
- copyIllustrations(flowerColors: any): void;
203
- getBaseDir(): any;
204
- mkdir(path: any): void;
205
- #private;
206
- }
207
- export class Taxa {
208
- static getHTMLTable(taxa: any, columns?: {
209
- title: string;
210
- data: (t: any) => any;
211
- }[]): string;
212
- static getFlowerColorNames(): string[];
213
- static getFlowerColors(): {
214
- name: string;
215
- color: string;
216
- }[];
217
- constructor(inclusionList: any, errorLog: any, showFlowerErrors: any, taxaMeta?: {}, taxonClass?: typeof Taxon, extraTaxa?: any[], extraSynonyms?: any[]);
218
- getFlowerColor(name: any): any;
219
- getTaxon(name: any): any;
220
- getTaxonList(): any[];
221
- hasSynonym(formerName: any): boolean;
222
- #private;
223
- }
224
- export namespace TAXA_LIST_COLS {
225
- namespace CESA {
226
- const title: string;
227
- function data(t: any): any;
228
- }
229
- namespace COMMON_NAME {
230
- const title_1: string;
231
- export { title_1 as title };
232
- export function data_1(t: any): any;
233
- export { data_1 as data };
234
- }
235
- namespace CNPS_RANK {
236
- const title_2: string;
237
- export { title_2 as title };
238
- export function data_2(t: any): string;
239
- export { data_2 as data };
240
- }
241
- namespace FESA {
242
- const title_3: string;
243
- export { title_3 as title };
244
- export function data_3(t: any): any;
245
- export { data_3 as data };
246
- }
247
- namespace SPECIES {
248
- const title_4: string;
249
- export { title_4 as title };
250
- export function data_4(t: any): any;
251
- export { data_4 as data };
252
- }
253
- namespace SPECIES_BARE {
254
- const title_5: string;
255
- export { title_5 as title };
256
- export function data_5(t: any): any;
257
- export { data_5 as data };
258
- }
259
- }
260
- import { Taxon } from "./taxon.js";
261
- export class TaxaLoader extends GenericTaxaLoader {
262
- loadTaxa(): Promise<Taxa>;
263
- }
264
- import { GenericTaxaLoader } from "./generictaxaloader.js";
265
- import { Taxa } from "./taxa.js";
266
- export class TaxaProcessor {
267
- constructor(options: any, taxaLoaderClass?: typeof TaxaLoader);
268
- getErrorLog(): any;
269
- getOptions(): any;
270
- getTaxa(): any;
271
- process(commandRunner: any): Promise<void>;
272
- #private;
273
- }
274
- import { TaxaLoader } from "./taxaloader.js";
275
- export namespace TAXA_COLNAMES {
276
- const BLOOM_START: string;
277
- const BLOOM_END: string;
278
- const COMMON_NAME: string;
279
- const FLOWER_COLOR: string;
280
- }
281
- export class Taxon {
282
- constructor(data: any);
283
- addSynonym(syn: any, type: any): void;
284
- getBaseFileName(): any;
285
- getBloomEnd(): any;
286
- getBloomStart(): any;
287
- getCalfloraName(): any;
288
- getCalfloraID(): any;
289
- getCalfloraTaxonLink(): string;
290
- getCESA(): any;
291
- getCNDDBRank(): any;
292
- getCommonNames(): any;
293
- getFamily(): any;
294
- getFESA(): any;
295
- getFileName(ext?: string): string;
296
- getFlowerColors(): any;
297
- getGenus(): {
298
- "__#6@#data": any;
299
- getTaxa(): any;
300
- };
301
- getGenusName(): any;
302
- getGlobalRank(): any;
303
- getHTMLLink(href?: boolean, includeRPI?: boolean): string;
304
- getINatID(): any;
305
- getINatName(): any;
306
- getINatSyn(): any;
307
- getINatTaxonLink(): string;
308
- getJepsonID(): any;
309
- getName(): any;
310
- getRPIID(): any;
311
- getRPIRank(): any;
312
- getRPIRankAndThreat(): any;
313
- getRPIRankAndThreatTooltip(): string;
314
- getRPITaxonLink(): string;
315
- getStatus(): any;
316
- getStatusDescription(config: any): any;
317
- getSynonyms(): any[];
318
- isCANative(): boolean;
319
- /**
320
- * Determine whether a species is a local native.
321
- * @returns {boolean} true if taxon is a local native; false if not a CA native, or native elsewhere in CA.
322
- */
323
- isNative(): boolean;
324
- isRare(): boolean;
325
- shouldHaveFlowers(): boolean;
326
- #private;
327
- }