aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdp.d')
-rwxr-xr-xsrc/sdp.d37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/sdp.d b/src/sdp.d
index 62e2e8f..24c85bc 100755
--- a/src/sdp.d
+++ b/src/sdp.d
@@ -1,7 +1,6 @@
#!/usr/bin/env rdmd
/+
sdp
- sdp.d
+/
/+ sdp: sisu document parser, see http://sisudoc.org +/
import
@@ -181,35 +180,37 @@ void main(string[] args) {
"not a sisu markup filename"
);
/+ ↓ read file +/
- auto header_and_content_tuple = raw.sourceContent(fn_src);
- static assert(!isTypeTuple!(header_and_content_tuple));
- auto header = header_and_content_tuple[0];
- auto sourcefile_content = header_and_content_tuple[1];
- debug(header_and_content) {
+ auto read_in_file_string = raw.sourceContent(fn_src);
+ /+ ↓ file tuple of header and content +/
+ auto header_and_body_tuple = raw.sourceContentSplitIntoHeaderAndBody(read_in_file_string, fn_src);
+ auto header = header_and_body_tuple[0];
+ auto content_body = header_and_body_tuple[1];
+ debug(header_and_body) {
writeln(header);
- writeln(header_and_content_tuple.length);
- writeln(sourcefile_content[0]);
+ writeln(header_and_body_tuple.length);
+ writeln(content_body[0]);
}
+ /+ ↓ split header into make and meta +/
auto header_make_and_meta_tuple = head.headerContentAA(header, conf_doc_make_aa);
static assert(!isTypeTuple!(header_make_and_meta_tuple));
- string[string][string] dochead_make_aa = header_make_and_meta_tuple[0];
- string[string][string] dochead_meta_aa = header_make_and_meta_tuple[1];
- /+ ↓ process document, return abstraction as tuple +/
- auto t = abs.abstract_doc_source(sourcefile_content, dochead_make_aa, dochead_meta_aa);
+ string[string][string] dochead_make = header_make_and_meta_tuple[0];
+ string[string][string] dochead_meta = header_make_and_meta_tuple[1];
+ /+ ↓ document abstraction: process document, return abstraction as tuple +/
+ auto t = abs.abstract_doc_source(content_body, dochead_make, dochead_meta);
static assert(!isTypeTuple!(t));
auto doc_ao_contents = t[0]; // contents ~ endnotes ~ bookindex;
// static assert(!isIterable!(doc_ao_contents));
auto doc_ao_bookindex_unordered_hashes = t[1];
auto doc_ao_biblio = t[2];
// destroy(t);
- /+ ↓ document parts +/
+ /+ ↓ debugs +/
debug(checkdoc) { // checkbook & dumpdoc
dbg.abstract_doc_source_debugs(
doc_ao_contents,
doc_ao_bookindex_unordered_hashes,
doc_ao_biblio,
- dochead_make_aa,
- dochead_meta_aa,
+ dochead_make,
+ dochead_meta,
fn_src,
opt_action_bool
);
@@ -219,8 +220,8 @@ void main(string[] args) {
doc_ao_contents,
doc_ao_bookindex_unordered_hashes,
doc_ao_biblio,
- dochead_make_aa,
- dochead_meta_aa,
+ dochead_make,
+ dochead_meta,
fn_src,
opt_action_bool
);
@@ -231,7 +232,7 @@ void main(string[] args) {
fn_src
);
}
- destroy(sourcefile_content);
+ destroy(content_body);
destroy(t);
destroy(doc_ao_contents);
// destroy(doc_ao_make_aa);