aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/io_in
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2019-12-08 19:26:13 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2020-01-13 16:06:43 -0500
commit99de6c56f71bcc0588aa1d888a5278aba15ec237 (patch)
treedc064ccaafafac75d40f2022829b10de9d14bec4 /src/doc_reform/io_in
parentsrc without pod.manifest, report on verbose (diff)
yaml doc headers, protect harvest
- protect harvest from missing doc header metadata - title & author required - removed crude rgx yaml check (rely on yaml parser)
Diffstat (limited to 'src/doc_reform/io_in')
-rw-r--r--src/doc_reform/io_in/read_config_files.d2
-rw-r--r--src/doc_reform/io_in/read_source_files.d13
2 files changed, 3 insertions, 12 deletions
diff --git a/src/doc_reform/io_in/read_config_files.d b/src/doc_reform/io_in/read_config_files.d
index cb673e0..1f6faa3 100644
--- a/src/doc_reform/io_in/read_config_files.d
+++ b/src/doc_reform/io_in/read_config_files.d
@@ -127,7 +127,7 @@ static template readConfigDoc() {
string[] possible_config_path_locations = _conf_file_details.possible_config_path_locations.dr_document_make;
foreach(conf_fn; [_conf_file_details.config_filename_document]) {
foreach(pth; possible_config_path_locations) {
- auto conf_file = ((chainPath(pth.to!string, conf_fn)).asNormalizedPath).array;
+ char[] conf_file = ((chainPath(pth.to!string, conf_fn)).asNormalizedPath).array;
conf_filename = conf_fn;
if (config_file_str.length > 0) {
break;
diff --git a/src/doc_reform/io_in/read_source_files.d b/src/doc_reform/io_in/read_source_files.d
index aeb2382..933868b 100644
--- a/src/doc_reform/io_in/read_source_files.d
+++ b/src/doc_reform/io_in/read_source_files.d
@@ -64,17 +64,13 @@ static template spineRawMarkupContent() {
images_list = tu[2].dup;
}
string header_type = "";
- if (header_raw.match(rgx.yaml_config)) {
- header_type = "yaml";
- }
t = tuple(
header_raw,
sourcefile_body_content,
- header_type,
insert_file_list,
images_list
);
- static assert(t.length==5);
+ static assert(t.length==4);
return t;
}
}
@@ -82,7 +78,7 @@ static template spineRawMarkupContent() {
import std.file;
final private string readInMarkupSource(in char[] fn_src) {
enforce(
- exists(fn_src)!=0,
+ exists(fn_src) != 0,
"file not found: «" ~
fn_src ~ "»"
);
@@ -138,14 +134,9 @@ static template spineRawMarkupContent() {
char[] header = hc[0];
char[] source_txt = hc[1];
auto source_line_arr = markupSourceLineArray(source_txt);
- string header_type = "";
- if (header.match(rgx.yaml_config)) {
- header_type = "yaml";
- }
auto t = tuple(
header,
source_line_arr,
- header_type,
file_insert_list,
images_list
);