@ca-plant-list/ca-plant-list 0.3.5 → 0.3.7
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 +24 -1
- package/data/taxa.csv +117 -99
- package/data/text/Antirrhinum-thompsonii.md +1 -0
- package/data/text/Calyptridium-monospermum.md +1 -0
- package/data/text/Calyptridium-ubellatum.md +1 -0
- package/data/text/Clarkia-affinis.md +1 -0
- package/data/text/Clarkia-breweri.md +1 -0
- package/data/text/Clarkia-concinna-subsp-automixa.md +1 -0
- package/data/text/Clarkia-modesta.md +1 -0
- package/data/text/Clarkia-purpurea-subsp-quadrivulnera.md +1 -0
- package/data/text/Clarkia-rubicunda.md +1 -0
- package/data/text/Delphinium-californicum-subsp-californicum.md +1 -1
- package/data/text/Delphinium-californicum-subsp-interius.md +1 -0
- package/data/text/Delphinium-hesperium-subsp-hesperium.md +1 -1
- package/data/text/Delphinium-hesperium-subsp-pallescens.md +1 -0
- package/data/text/Delphinium-parryi-subsp-parryi.md +1 -0
- package/data/text/Delphinium-variegatum-subsp-variegatum.md +1 -0
- package/data/text/Erythranthe-moschata.md +1 -0
- package/data/text/Erythranthe-primuloides.md +1 -0
- package/data/text/Erythranthe-tilingii.md +1 -0
- package/data/text/Fritillaria-affinis.md +1 -0
- package/data/text/Fritillaria-agrestis.md +1 -0
- package/data/text/Fritillaria-liliacea.md +1 -0
- package/data/text/Lilium-pardalinum-subsp-shastense.md +1 -0
- package/data/text/Logfia-filaginoides.md +1 -0
- package/data/text/Logfia-gallica.md +1 -0
- package/data/text/Malacothamnus-arcuatus-var-elmeri.md +1 -0
- package/data/text/Malacothamnus-fremontii-var-fremontii.md +1 -0
- package/data/text/Trifolium-obtusiflorum.md +1 -0
- package/data/text/Trifolium-willdenovii.md +1 -0
- package/ebook/css/main.css +4 -0
- package/jekyll/assets/css/main.css +4 -0
- package/lib/ebook/images.js +49 -40
- package/lib/ebook/pages/page_list_species.js +15 -9
- package/lib/ebook/pages/taxonpage.js +3 -6
- package/lib/ebook/xhtml.js +3 -5
- package/lib/externalsites.js +14 -21
- package/lib/families.js +0 -2
- package/lib/genera.js +1 -3
- package/lib/genericpage.js +26 -18
- package/lib/generictaxaloader.js +1 -1
- package/lib/htmltaxon.js +35 -17
- package/lib/markdown.js +7 -9
- package/lib/pagerenderer.js +127 -82
- package/lib/plants/glossary.js +9 -14
- package/lib/taxa.js +14 -15
- package/lib/taxaloader.js +3 -1
- package/lib/taxon.js +2 -4
- package/lib/web/glossarypages.js +31 -18
- package/lib/web/pagetaxon.js +0 -10
- package/package.json +2 -3
- package/scripts/build-ebook.js +1 -1
- package/scripts/build-site.js +34 -24
- package/types/classes.d.ts +26 -0
package/scripts/build-site.js
CHANGED
@@ -2,54 +2,64 @@
|
|
2
2
|
|
3
3
|
import * as child_process from "node:child_process";
|
4
4
|
import * as path from "node:path";
|
5
|
-
import { Files } from "@ca-plant-list/ca-plant-list";
|
6
5
|
import { Config } from "../lib/config.js";
|
7
6
|
import { PageRenderer } from "../lib/pagerenderer.js";
|
8
7
|
import { CommandAndTaxaProcessor } from "../lib/commandandtaxaprocessor.js";
|
8
|
+
import { Files } from "../lib/files.js";
|
9
9
|
|
10
10
|
class JekyllRenderer {
|
11
|
-
|
12
11
|
#srcDir = "./output";
|
13
12
|
#destDir = "./public";
|
14
13
|
|
15
14
|
async renderPages() {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
configFiles.push( fullPath );
|
15
|
+
function addConfigFile(configFiles, dir, name) {
|
16
|
+
const fullPath = path.join(dir, name);
|
17
|
+
if (Files.exists(fullPath)) {
|
18
|
+
configFiles.push(fullPath);
|
21
19
|
}
|
22
20
|
}
|
23
21
|
|
24
22
|
// Remove existing files.
|
25
|
-
Files.rmDir(
|
23
|
+
Files.rmDir(this.#destDir);
|
26
24
|
|
27
|
-
const options = [
|
25
|
+
const options = [
|
26
|
+
"--source",
|
27
|
+
this.#srcDir,
|
28
|
+
"--destination",
|
29
|
+
this.#destDir,
|
30
|
+
];
|
28
31
|
|
29
32
|
// Find out what config files are available.
|
30
33
|
const configFiles = [];
|
31
|
-
addConfigFile(
|
32
|
-
addConfigFile(
|
33
|
-
addConfigFile(
|
34
|
-
options.push(
|
35
|
-
|
36
|
-
const result = child_process.execSync(
|
37
|
-
|
34
|
+
addConfigFile(configFiles, this.#srcDir, "_config.yml");
|
35
|
+
addConfigFile(configFiles, this.#srcDir, "_config-local.yml");
|
36
|
+
addConfigFile(configFiles, ".", "_config-dev.yml");
|
37
|
+
options.push("--config", '"' + configFiles.join() + '"');
|
38
|
+
|
39
|
+
const result = child_process.execSync(
|
40
|
+
"bundle exec jekyll build " + options.join(" ")
|
41
|
+
);
|
42
|
+
console.log(result.toString());
|
38
43
|
}
|
39
|
-
|
40
44
|
}
|
41
45
|
|
42
|
-
async function generateSite(
|
43
|
-
|
46
|
+
async function generateSite(taxaProcessor) {
|
44
47
|
const options = taxaProcessor.getOptions();
|
45
48
|
|
46
|
-
PageRenderer.render(
|
49
|
+
PageRenderer.render(
|
50
|
+
options.outputdir,
|
51
|
+
new Config(options.datadir),
|
52
|
+
taxaProcessor.getTaxa()
|
53
|
+
);
|
47
54
|
|
48
|
-
console.log(
|
55
|
+
console.log("generating site");
|
49
56
|
const r = new JekyllRenderer();
|
50
57
|
await r.renderPages();
|
51
|
-
|
52
58
|
}
|
53
59
|
|
54
|
-
const gen = new CommandAndTaxaProcessor(
|
55
|
-
|
60
|
+
const gen = new CommandAndTaxaProcessor(
|
61
|
+
"ca-plant-list",
|
62
|
+
"A tool to generate a website with local plant data.",
|
63
|
+
generateSite
|
64
|
+
);
|
65
|
+
await gen.process(generateSite);
|
@@ -0,0 +1,26 @@
|
|
1
|
+
declare class ErrorLog {
|
2
|
+
log(...args: string[]): void;
|
3
|
+
}
|
4
|
+
|
5
|
+
declare class Families {}
|
6
|
+
|
7
|
+
declare class Genera {}
|
8
|
+
|
9
|
+
declare class Taxon {
|
10
|
+
constructor(data: TaxonData, genera: Genera, meta: any);
|
11
|
+
getBloomEnd(): number;
|
12
|
+
getBloomStart(): number;
|
13
|
+
getCESA(): string;
|
14
|
+
getCommonNames(): string[];
|
15
|
+
getFESA(): string;
|
16
|
+
getFileName(): string;
|
17
|
+
getFlowerColors(): string[];
|
18
|
+
getHTMLLink(
|
19
|
+
href: boolean | string | undefined,
|
20
|
+
includeRPI: boolean
|
21
|
+
): string;
|
22
|
+
getLifeCycle(): string;
|
23
|
+
getName(): string;
|
24
|
+
getRPIRankAndThreat(): string;
|
25
|
+
getRPIRankAndThreatTooltip(): string;
|
26
|
+
}
|