@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.
Files changed (54) hide show
  1. package/data/synonyms.csv +24 -1
  2. package/data/taxa.csv +117 -99
  3. package/data/text/Antirrhinum-thompsonii.md +1 -0
  4. package/data/text/Calyptridium-monospermum.md +1 -0
  5. package/data/text/Calyptridium-ubellatum.md +1 -0
  6. package/data/text/Clarkia-affinis.md +1 -0
  7. package/data/text/Clarkia-breweri.md +1 -0
  8. package/data/text/Clarkia-concinna-subsp-automixa.md +1 -0
  9. package/data/text/Clarkia-modesta.md +1 -0
  10. package/data/text/Clarkia-purpurea-subsp-quadrivulnera.md +1 -0
  11. package/data/text/Clarkia-rubicunda.md +1 -0
  12. package/data/text/Delphinium-californicum-subsp-californicum.md +1 -1
  13. package/data/text/Delphinium-californicum-subsp-interius.md +1 -0
  14. package/data/text/Delphinium-hesperium-subsp-hesperium.md +1 -1
  15. package/data/text/Delphinium-hesperium-subsp-pallescens.md +1 -0
  16. package/data/text/Delphinium-parryi-subsp-parryi.md +1 -0
  17. package/data/text/Delphinium-variegatum-subsp-variegatum.md +1 -0
  18. package/data/text/Erythranthe-moschata.md +1 -0
  19. package/data/text/Erythranthe-primuloides.md +1 -0
  20. package/data/text/Erythranthe-tilingii.md +1 -0
  21. package/data/text/Fritillaria-affinis.md +1 -0
  22. package/data/text/Fritillaria-agrestis.md +1 -0
  23. package/data/text/Fritillaria-liliacea.md +1 -0
  24. package/data/text/Lilium-pardalinum-subsp-shastense.md +1 -0
  25. package/data/text/Logfia-filaginoides.md +1 -0
  26. package/data/text/Logfia-gallica.md +1 -0
  27. package/data/text/Malacothamnus-arcuatus-var-elmeri.md +1 -0
  28. package/data/text/Malacothamnus-fremontii-var-fremontii.md +1 -0
  29. package/data/text/Trifolium-obtusiflorum.md +1 -0
  30. package/data/text/Trifolium-willdenovii.md +1 -0
  31. package/ebook/css/main.css +4 -0
  32. package/jekyll/assets/css/main.css +4 -0
  33. package/lib/ebook/images.js +49 -40
  34. package/lib/ebook/pages/page_list_species.js +15 -9
  35. package/lib/ebook/pages/taxonpage.js +3 -6
  36. package/lib/ebook/xhtml.js +3 -5
  37. package/lib/externalsites.js +14 -21
  38. package/lib/families.js +0 -2
  39. package/lib/genera.js +1 -3
  40. package/lib/genericpage.js +26 -18
  41. package/lib/generictaxaloader.js +1 -1
  42. package/lib/htmltaxon.js +35 -17
  43. package/lib/markdown.js +7 -9
  44. package/lib/pagerenderer.js +127 -82
  45. package/lib/plants/glossary.js +9 -14
  46. package/lib/taxa.js +14 -15
  47. package/lib/taxaloader.js +3 -1
  48. package/lib/taxon.js +2 -4
  49. package/lib/web/glossarypages.js +31 -18
  50. package/lib/web/pagetaxon.js +0 -10
  51. package/package.json +2 -3
  52. package/scripts/build-ebook.js +1 -1
  53. package/scripts/build-site.js +34 -24
  54. package/types/classes.d.ts +26 -0
@@ -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
- function addConfigFile( configFiles, dir, name ) {
18
- const fullPath = path.join( dir, name );
19
- if ( Files.exists( fullPath ) ) {
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( this.#destDir );
23
+ Files.rmDir(this.#destDir);
26
24
 
27
- const options = [ "--source", this.#srcDir, "--destination", this.#destDir ];
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( configFiles, this.#srcDir, "_config.yml" );
32
- addConfigFile( configFiles, this.#srcDir, "_config-local.yml" );
33
- addConfigFile( configFiles, ".", "_config-dev.yml" );
34
- options.push( "--config", "\"" + configFiles.join() + "\"" );
35
-
36
- const result = child_process.execSync( "bundle exec jekyll build " + options.join( " " ) );
37
- console.log( result.toString() );
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( taxaProcessor ) {
43
-
46
+ async function generateSite(taxaProcessor) {
44
47
  const options = taxaProcessor.getOptions();
45
48
 
46
- PageRenderer.render( options.outputdir, new Config( options.datadir ), taxaProcessor.getTaxa() );
49
+ PageRenderer.render(
50
+ options.outputdir,
51
+ new Config(options.datadir),
52
+ taxaProcessor.getTaxa()
53
+ );
47
54
 
48
- console.log( "generating site" );
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( "ca-plant-list", "A tool to generate a website with local plant data.", generateSite );
55
- await gen.process( generateSite );
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
+ }