aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/ocda/abstraction/ssp.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/ocda/abstraction/ssp.d')
-rw-r--r--src/sisudoc/ocda/abstraction/ssp.d32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/sisudoc/ocda/abstraction/ssp.d b/src/sisudoc/ocda/abstraction/ssp.d
index 5e9347f..1ec2d41 100644
--- a/src/sisudoc/ocda/abstraction/ssp.d
+++ b/src/sisudoc/ocda/abstraction/ssp.d
@@ -195,7 +195,10 @@ template spineAbstractionTxt() {
output ~= "@" ~ section ~ " {";
output ~= "";
foreach (obj; section_objs) {
- /+ ↓ object declaration line +/
+ /+ ↓ object declaration line. a heading carries its identifier here,
+ on the declaration line, where it is not the ocn; every other
+ object carries it as .identifier below, on the same condition
+ +/
string obj_decl = "[" ~ obj.metainfo.ocn.to!string ~ "] ";
if (obj.metainfo.is_a == "heading") {
string lev = obj.metainfo.marked_up_level;
@@ -209,6 +212,11 @@ template spineAbstractionTxt() {
}
output ~= obj_decl;
/+ ↓ properties (only non-default values) +/
+ if (obj.metainfo.is_a != "heading"
+ && obj.metainfo.identifier.length > 0
+ && obj.metainfo.identifier != obj.metainfo.ocn.to!string) {
+ output ~= ".identifier: " ~ obj.metainfo.identifier;
+ }
if (obj.metainfo.is_of_part.length > 0) {
output ~= ".part: " ~ obj.metainfo.is_of_part;
}
@@ -315,6 +323,9 @@ template spineAbstractionTxt() {
if (obj.metainfo.object_number_off) {
output ~= ".ocn_off: true";
}
+ // if (obj.metainfo.o_n_type != 0) {
+ // output ~= ".o_n_type: " ~ obj.metainfo.o_n_type.to!string;
+ // }
if (obj.metainfo.is_of_type.length > 0) {
output ~= ".is_of_type: " ~ obj.metainfo.is_of_type;
}
@@ -399,10 +410,16 @@ template spineAbstractionTxt() {
}
if (obj.table.heading) {
output ~= ".table_header: true";
- }
+ }
+ // if (obj.table.walls) {
+ // output ~= ".table_walls: true";
+ // }
}
/+ ↓ code block properties +/
if (obj.metainfo.is_a == "code") {
+ // if (obj.code_block.syntax.length > 0) {
+ // output ~= ".code_syntax: " ~ obj.code_block.syntax;
+ // }
if (obj.code_block.linenumbers) {
output ~= ".code_linenumbers: true";
}
@@ -435,6 +452,17 @@ template spineAbstractionTxt() {
if (obj.tags.segment_anchor_tag_epub.length > 0) {
output ~= ".segment_epub: " ~ obj.tags.segment_anchor_tag_epub;
}
+ /+ ↓ the segment an object belongs to, as opposed to the segment a
+ heading opens. .segment (in_segment_html) is set on headings
+ only, so without these two a reader cannot tell which segment a
+ paragraph is in; the sqlite search writer reads the html one
+ +/
+ if (obj.tags.html_segment_anchor_tag_is.length > 0) {
+ output ~= ".segment_html_is: " ~ obj.tags.html_segment_anchor_tag_is;
+ }
+ if (obj.tags.epub_segment_anchor_tag_is.length > 0) {
+ output ~= ".segment_epub_is: " ~ obj.tags.epub_segment_anchor_tag_is;
+ }
/+ ↓ heading ancestors text +/
{
bool has_hat = false;