metanorma-release 0.2.8 → 0.2.10
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b076e06eeb68abca60395688f6931f6d0ba71f787f1d9ca703eae6a09e0eb3de
|
|
4
|
+
data.tar.gz: 005d48aa61abf265a30c845f3201a403865e38fb74365a090714f7bb834b20a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81f45c4bb5451194e748abcb8e15662266840d428d3fa6625012b8e31ae56c2fd59b385395c8643f71e79b86741ebb3dc42f07f84c63fab647f479ba34479fef
|
|
7
|
+
data.tar.gz: fa69130d435783ffa9bb45b40c6b473763dcee49b06db3a20e1d8a4208a23c35b20473890675780632e6e79bf980fe9a39b0b4c156f0ff67e24e55a9caefa658
|
|
@@ -79,7 +79,7 @@ module Metanorma
|
|
|
79
79
|
desc: "Filter stages"
|
|
80
80
|
option :output_dir, type: :string, default: "_site/cc",
|
|
81
81
|
desc: "Output directory"
|
|
82
|
-
option :file_routing, type: :string,
|
|
82
|
+
option :file_routing, type: :string,
|
|
83
83
|
desc: "File routing (by-document|flat|by-format)"
|
|
84
84
|
option :cache_dir, type: :string, desc: "Cache directory"
|
|
85
85
|
option :data_dir, type: :string, desc: "Write flattened documents.json for site generators"
|
|
@@ -77,7 +77,7 @@ module Metanorma
|
|
|
77
77
|
channels: cli_options[:channels].any? ? cli_options[:channels] : Array(file_data["channels"]),
|
|
78
78
|
stages: cli_options[:stages].any? ? cli_options[:stages] : Array(file_data["stages"]),
|
|
79
79
|
output_dir: cli_options[:output_dir] || file_data["output_dir"],
|
|
80
|
-
file_routing: cli_options[:file_routing] || file_data["file_routing"],
|
|
80
|
+
file_routing: cli_options[:file_routing] || file_data["file_routing"] || "by-document",
|
|
81
81
|
cache_dir: cli_options[:cache_dir] || file_data["cache_dir"],
|
|
82
82
|
data_dir: cli_options[:data_dir] || file_data["data_dir"],
|
|
83
83
|
include_drafts: cli_options[:include_drafts] || file_data["include_drafts"],
|
|
@@ -85,18 +85,26 @@ module Metanorma
|
|
|
85
85
|
def flatten_for_site(doc)
|
|
86
86
|
bib = doc["bibliographic"] || {}
|
|
87
87
|
doc_id = resolve_doc_id(bib, doc)
|
|
88
|
+
stage = (doc["stage"] || "published").to_s.downcase
|
|
89
|
+
doctype = extract_doctype(bib) || doc.fetch("doctype", "")
|
|
90
|
+
formats = doc["formats"] || []
|
|
88
91
|
{
|
|
89
92
|
"slug" => doc["id"],
|
|
90
93
|
"id" => doc_id,
|
|
91
94
|
"title" => doc["title"].to_s,
|
|
92
95
|
"abstract" => extract_abstract(bib),
|
|
93
|
-
"stage" =>
|
|
94
|
-
"doctype" =>
|
|
96
|
+
"stage" => stage,
|
|
97
|
+
"doctype" => doctype,
|
|
95
98
|
"edition" => doc["edition"],
|
|
96
99
|
"date" => extract_date(doc),
|
|
97
100
|
"channels" => doc["channels"] || [],
|
|
98
|
-
"formats" =>
|
|
101
|
+
"formats" => formats,
|
|
99
102
|
"files" => doc["files"] || [],
|
|
103
|
+
"has_html" => formats.include?("html"),
|
|
104
|
+
"has_pdf" => formats.include?("pdf"),
|
|
105
|
+
"has_xml" => formats.include?("xml"),
|
|
106
|
+
"stage_css" => stage.gsub(/\s+/, "-"),
|
|
107
|
+
"doctype_class" => "type-#{doctype.downcase}",
|
|
100
108
|
}
|
|
101
109
|
end
|
|
102
110
|
|