aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-11-11 22:02:14 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:13 -0400
commit784d5dacd2c11c9307c228bb76e43283287fc607 (patch)
tree56e9b3ca27c00bd45c41604f8f4bb6704bd477bf
parentpara attribute: indent, variable type change, check consequences (diff)
para attribute: indent, make part of inline markup
-rw-r--r--org/ao_defaults.org38
-rw-r--r--org/ao_output_debugs.org48
-rw-r--r--src/sdp/ao_defaults.d38
-rw-r--r--src/sdp/ao_output_debugs.d46
4 files changed, 87 insertions, 83 deletions
diff --git a/org/ao_defaults.org b/org/ao_defaults.org
index 045e1e3..23e3a00 100644
--- a/org/ao_defaults.org
+++ b/org/ao_defaults.org
@@ -435,6 +435,44 @@ template InternalMarkup() {
struct InlineMarkup {
auto en_a_o = "【"; auto en_a_c = "】";
auto en_b_o = "〖"; auto en_b_c = "〗";
+ string _indent_spaces ="";
+ string indent_by_spaces_provided(int indent) {
+ switch (indent) {
+ case 0:
+ _indent_spaces = "";
+ break;
+ case 1:
+ _indent_spaces = " ";
+ break;
+ case 2:
+ _indent_spaces = " ";
+ break;
+ case 3:
+ _indent_spaces = " ";
+ break;
+ case 4:
+ _indent_spaces = " ";
+ break;
+ case 5:
+ _indent_spaces = " ";
+ break;
+ case 6:
+ _indent_spaces = " ";
+ break;
+ case 7:
+ _indent_spaces = " ";
+ break;
+ case 8:
+ _indent_spaces = " ";
+ break;
+ case 9:
+ _indent_spaces = " ";
+ break;
+ default:
+ break;
+ }
+ return _indent_spaces;
+ }
}
}
#+END_SRC
diff --git a/org/ao_output_debugs.org b/org/ao_output_debugs.org
index 0cab796..67f35ae 100644
--- a/org/ao_output_debugs.org
+++ b/org/ao_output_debugs.org
@@ -19,45 +19,9 @@
#+name: initialize
#+BEGIN_SRC d
+auto rgx = Rgx();
+auto markup = InlineMarkup();
string key;
-string indent_amount_;
-auto indented_(int indent) {
- switch (indent) {
- case 0:
- indent_amount_="";
- break;
- case 1:
- indent_amount_=" ";
- break;
- case 2:
- indent_amount_=" ";
- break;
- case 3:
- indent_amount_=" ";
- break;
- case 4:
- indent_amount_=" ";
- break;
- case 5:
- indent_amount_=" ";
- break;
- case 6:
- indent_amount_=" ";
- break;
- case 7:
- indent_amount_=" ";
- break;
- case 8:
- indent_amount_=" ";
- break;
- case 9:
- indent_amount_=" ";
- break;
- default:
- break;
- }
- return indent_amount_;
-}
#+END_SRC
** book index (sort &) report :report:
@@ -152,12 +116,12 @@ void out_toc(S)(
string key,
) {
if (contents[key].length > 1) {
- string indent_amount;
+ string indent_spaces;
foreach (obj; contents[key]) {
- indent_amount=indented_(obj.para_attrib.indent_start);
+ indent_spaces=markup.indent_by_spaces_provided(obj.para_attrib.indent_start);
writefln(
"%s%s",
- indent_amount,
+ indent_spaces,
obj.object
);
}
@@ -931,7 +895,7 @@ template SiSUoutputDebugs() {
bool[string] opt_action_bool
) {
mixin RgxInit;
- auto rgx = Rgx();
+ mixin InternalMarkup;
<<initialize>>
<<book_index_sorted_report>>
<<ao_output_debugs>>
diff --git a/src/sdp/ao_defaults.d b/src/sdp/ao_defaults.d
index 3255c99..d8c1e24 100644
--- a/src/sdp/ao_defaults.d
+++ b/src/sdp/ao_defaults.d
@@ -386,5 +386,43 @@ template InternalMarkup() {
struct InlineMarkup {
auto en_a_o = "【"; auto en_a_c = "】";
auto en_b_o = "〖"; auto en_b_c = "〗";
+ string _indent_spaces ="";
+ string indent_by_spaces_provided(int indent) {
+ switch (indent) {
+ case 0:
+ _indent_spaces = "";
+ break;
+ case 1:
+ _indent_spaces = " ";
+ break;
+ case 2:
+ _indent_spaces = " ";
+ break;
+ case 3:
+ _indent_spaces = " ";
+ break;
+ case 4:
+ _indent_spaces = " ";
+ break;
+ case 5:
+ _indent_spaces = " ";
+ break;
+ case 6:
+ _indent_spaces = " ";
+ break;
+ case 7:
+ _indent_spaces = " ";
+ break;
+ case 8:
+ _indent_spaces = " ";
+ break;
+ case 9:
+ _indent_spaces = " ";
+ break;
+ default:
+ break;
+ }
+ return _indent_spaces;
+ }
}
}
diff --git a/src/sdp/ao_output_debugs.d b/src/sdp/ao_output_debugs.d
index 4800591..7764af4 100644
--- a/src/sdp/ao_output_debugs.d
+++ b/src/sdp/ao_output_debugs.d
@@ -14,46 +14,10 @@ template SiSUoutputDebugs() {
bool[string] opt_action_bool
) {
mixin RgxInit;
+ mixin InternalMarkup;
auto rgx = Rgx();
+ auto markup = InlineMarkup();
string key;
- string indent_amount_;
- auto indented_(int indent) {
- switch (indent) {
- case 0:
- indent_amount_="";
- break;
- case 1:
- indent_amount_=" ";
- break;
- case 2:
- indent_amount_=" ";
- break;
- case 3:
- indent_amount_=" ";
- break;
- case 4:
- indent_amount_=" ";
- break;
- case 5:
- indent_amount_=" ";
- break;
- case 6:
- indent_amount_=" ";
- break;
- case 7:
- indent_amount_=" ";
- break;
- case 8:
- indent_amount_=" ";
- break;
- case 9:
- indent_amount_=" ";
- break;
- default:
- break;
- }
- return indent_amount_;
- }
struct BookIndexReport {
int mkn, skn;
auto bookindex_report_sorted(
@@ -123,12 +87,12 @@ template SiSUoutputDebugs() {
string key,
) {
if (contents[key].length > 1) {
- string indent_amount;
+ string indent_spaces;
foreach (obj; contents[key]) {
- indent_amount=indented_(obj.para_attrib.indent_start);
+ indent_spaces=markup.indent_by_spaces_provided(obj.para_attrib.indent_start);
writefln(
"%s%s",
- indent_amount,
+ indent_spaces,
obj.object
);
}