aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/meta_debugs.org
blob: 687e1b281c1fccec240e0dd93687479005f571bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
#+TITLE:       doc_reform abstraction summary and debugs
#+DESCRIPTION: documents - structuring, publishing in multiple formats & search
#+FILETAGS:    :doc_reform:debugs:
#+AUTHOR:      Ralph Amissah
#+EMAIL:       [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]]
#+LANGUAGE:    en
#+STARTUP:     indent content
#+OPTIONS:     H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil _:nil -:t f:t *:t <:t
#+OPTIONS:     TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+OPTIONS:     author:nil email:nil creator:nil timestamp:nil
#+PROPERTY:    header-args :padline no :exports code :noweb yes
#+EXPORT_SELECT_TAGS:  export
#+EXPORT_EXCLUDE_TAGS: noexport
#+TAGS: assert(a) class(c) debug(d) mixin(m) doc_reform(s) tangle(T) template(t) WEB(W) noexport(n)

[[./doc_reform.org][doc_reform]]  [[./][org/]]
* 1. abstraction debugs                   :module:doc_reform:meta_doc_debugs:
** 0. module template

#+BEGIN_SRC d :tangle ../src/doc_reform/meta/doc_debugs.d
/++
  output debugs
+/
module doc_reform.meta.doc_debugs;
template DocReformDebugs() {
  <<debug_imports>>
  auto DocReformDebugs(S,T)(
    const S  contents,
          T  doc_matters,
  ) {
    mixin DocReformRgxInit;
    mixin InternalMarkup;
    <<initialize>>
    <<meta_output_debugs>>
    debug(checkdoc) {
      if ((doc_matters.opt.action.debug_do)) {
        <<meta_output_debugs_summary>>
        <<meta_output_debugs_checkdoc>>
      }
    }
  }
}
#+END_SRC

** imports

#+name: debug_imports
#+BEGIN_SRC d
import
  doc_reform.meta.defaults,
  doc_reform.meta.rgx;
import
  std.algorithm,
  std.array,
  std.container,
  std.exception,
  std.json,
  std.stdio,
  std.file,
  std.path,
  std.range,
  std.regex,
  std.string,
  std.traits,
  std.typecons,
  std.utf,
  std.conv : to;
#+END_SRC

** initialize                                                       :report:

#+name: initialize
#+BEGIN_SRC d
static auto rgx = Rgx();
auto markup = InlineMarkup();
string key;
#+END_SRC

** (parent)                                                         :parent:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(parent) {
  writefln(
    "%s:%s",
    __FILE__,
    __LINE__,
  );
  foreach (key; doc_matters.xml.keys_seq.seg) {
    foreach (obj; contents[key]) {
      if (obj.metainfo.is_of_part != "empty") {
        if (obj.metainfo.is_a == "heading") {
          writefln(
            "%s node: %s heading: %s %s",
            obj.object_number,
            obj.node,
            obj.heading_lev_markup,
            obj.text,
          );
        }
      }
    }
  }
}
#+END_SRC

** (dumpdoc)                                                       :objects:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(dumpdoc) {
  writefln(
    "> %s:%s",
    __FILE__,
    __LINE__,
  );
}
#+END_SRC

** (segnames)                                                      :objects:

#+name: meta_output_debugs_checkdoc
#+BEGIN_SRC d
debug(checkdoc) {
  void out_segnames(S,T)(
    const S  contents,
          T  doc_matters,
  ) {
    foreach (key; doc_matters.xml.keys_seq.seg) {
      if (contents[key].length > 1) {
        foreach (obj; contents[key]) {
          if (obj.heading_lev_markup == 4) {
            writeln(obj.ptr_html_segnames, ". (", doc_matters.xml.segnames[obj.ptr_html_segnames], ") -> ",  obj.text);
          }
        }
      }
    }
  }
}
#+END_SRC

** shared output section arrange
*** out toc

#+name: meta_output_debugs_checkdoc
#+BEGIN_SRC d
debug(checkdoc) {
  void out_toc(S)(
    const S  contents,
    string                   key,
  ) {
    if (contents[key].length > 1) {
      string indent_spaces;
      foreach (obj; contents[key]) {
        indent_spaces=markup.indent_by_spaces_provided(obj.indent_hang);
        writefln(
          "%s%s",
          indent_spaces,
          obj.text
        );
      }
    }
  }
}
#+END_SRC

*** out endnotes                                                 :endnotes:

#+name: meta_output_debugs_checkdoc
#+BEGIN_SRC d
debug(checkdoc) {
  void out_endnotes(S)(
    const S  contents,
    string                   key,
  ) {
    if (contents[key].length > 1) {
      foreach (obj; contents[key]) {
        writefln(
          "[%s]\n%s",
          obj.metainfo.is_a,
          obj.text
        );
      }
    }
  }
}
#+END_SRC

*** out bookindex                                               :bookindex:

#+name: meta_output_debugs_checkdoc
#+BEGIN_SRC d
debug(checkdoc) {
  void out_bookindex(S)(
    const S  contents,
    string                   key,
  ) {
    if (contents[key].length > 1) {
      foreach (obj; contents[key]) {
        writefln(
          "[%s][%s]\n%s",
          obj.object_number,
          obj.metainfo.is_a,
          obj.text
        );
      }
    }
  }
}
#+END_SRC

** sections
*** heading_section                                               :heading:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_head) {
  key="head";
  if (contents[key].length > 1) {
    foreach (obj; contents[key]) {
      writefln(
        "[%s][%s]\n%s",
        obj.object_number,
        obj.metainfo.is_a,
        obj.text
      );
    }
  }
}
#+END_SRC

*** toc_section (seg & scroll)
**** toc

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_toc) {
  key="toc_seg";
  out_toc(contents, key);
}
#+END_SRC

**** toc seg

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_toc_seg) {
  key="toc_seg";
  out_toc(contents, key);
}
#+END_SRC

**** toc scroll

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_toc_scroll) {
  key="toc_scroll";
  out_toc(contents, key);
}
#+END_SRC

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(segnames) {
  writeln(__LINE__);
  out_segnames(contents, doc_matters);
}
#+END_SRC

*** body_section                                                     :body:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_body) {
  key="body";
  if (contents[key].length > 1) {
    foreach (obj; contents[key]) {
      writefln(
        "[%s][%s]\n%s",
        obj.object_number,
        obj.metainfo.is_a,
        obj.text
      );
    }
  }
}
#+END_SRC

*** dom structure                                                    :body:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(toc_nav_dom) {
  enum DomTags { none, open, close, close_and_open, open_still, }
  foreach (sect; doc_matters.xml.keys_seq.seg) {
    foreach (obj; contents[sect]) {
      if (obj.metainfo.is_a == "heading") {
        foreach_reverse (k; 0 .. 7) {
          switch (obj.dom_structure_markedup_tags_status[k]) {
          case DomTags.close :
            writeln(markup.indent_by_spaces_provided(k), "</", k, ">");
            break;
          case DomTags.close_and_open :
            writeln(markup.indent_by_spaces_provided(k), "</", k, ">");
            writeln(markup.indent_by_spaces_provided(k),
              "<", k, ">", obj.text,
              " file: ", obj.segment_anchor_tag, ".xhtml#", obj.ocn);
            break;
          case DomTags.open :
            writeln(markup.indent_by_spaces_provided(k),
              "<", k, ">", obj.text,
              " file: ", obj.segment_anchor_tag, ".xhtml#", obj.ocn);
            break;
          default :
            break;
          }
        }
      }
    }
  }
  writeln("--------------------");
  foreach (sect; doc_matters.xml.keys_seq.seg) {
    foreach (obj; contents[sect]) {
      if (obj.metainfo.is_a == "heading") {
        foreach_reverse (k; 0 .. 7) {
          switch (obj.dom_structure_collapsed_tags_status[k]) {
          case DomTags.close :
            writeln(markup.indent_by_spaces_provided(k), "</", k, ">");
            break;
          case DomTags.close_and_open :
            writeln(markup.indent_by_spaces_provided(k), "</", k, ">");
            writeln(markup.indent_by_spaces_provided(k),
              "<", k, ">", obj.text,
              " file: ", obj.segment_anchor_tag, ".xhtml#", obj.ocn);
            break;
          case DomTags.open :
            writeln(markup.indent_by_spaces_provided(k),
              "<", k, ">", obj.text,
              " file: ", obj.segment_anchor_tag, ".xhtml#", obj.ocn);
            break;
          default :
            break;
          }
        }
      }
    }
  }
}
#+END_SRC

*** decendants

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(decendants) {
  foreach (sect; doc_matters.xml.keys_seq.scroll) {
    foreach (obj; contents[sect]) {
      if (obj.metainfo.is_a == "heading") {
        writeln(obj.metainfo.ocn, " .. ", obj.metainfo.last_decendant_ocn);
      }
    }
  }
}
#+END_SRC

*** endnotes_section (seg & scroll)                              :endnotes:
**** endnotes

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_endnotes) {
  key="endnotes";
  out_endnotes(contents, key);
}
#+END_SRC

**** endnotes seg

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_endnotes_seg) {
  key="endnotes";
  out_endnotes(contents, key);
}
#+END_SRC

*** glossary_section                                             :glossary:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_glossary) {
  key="glossary";
  if (contents[key].length > 1) {
    foreach (obj; contents[key]) {
      writefln(
        "[%s][%s]\n%s",
        obj.object_number,
        obj.metainfo.is_a,
        obj.text
      );
    }
  }
}
#+END_SRC

*** bibliography_section (seg & scroll)                      :bibliography:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_bibliography) {
  key="bibliography";
  if (contents[key].length > 1) {
    foreach (obj; contents[key]) {
      writefln(
        "[%s][%s]\n%s",
        obj.object_number,
        obj.metainfo.is_a,
        obj.text
      );
    }
  }
}
#+END_SRC

*** bookindex_section (seg & scroll)                            :bookindex:
**** bookindex

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_bookindex) {
  key="bookindex_seg";
  out_bookindex(contents, key);
}
#+END_SRC

**** bookindex seg

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_bookindex_seg) {
  key="bookindex_seg";
  out_bookindex(contents, key);
}
#+END_SRC

**** bookindex scroll

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(section_bookindex_scroll) {
  key="bookindex_scroll";
  out_bookindex(contents, key);
}
#+END_SRC

*** section_blurb                                                   :blurb:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(blurb_section) {
  key="blurb";
  if (contents[key].length > 1) {
    foreach (obj; contents[key]) {
      writefln(
        "[%s][%s]\n%s",
        obj.object_number,
        obj.metainfo.is_a,
        obj.text
      );
    }
  }
}
#+END_SRC

** (objects)                                                       :objects:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(objects) {
  writefln(
    "> %s:%s",
    __FILE__,
    __LINE__,
  );
  foreach (obj; contents[key]) {
    if (obj.metainfo.is_of_part != "empty") {
      writefln(
        "* [%s][%s] %s",
        obj.object_number,
        obj.metainfo.is_a,
        obj.text
      );
    }
  }
}
#+END_SRC

** (headermakejson)                                            :json:header:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(headermakejson) {
  writefln(
    "%s\n%s\n%s",
    "document header, metadata & make instructions:",
    doc_matters.conf_make_meta.meta,
    ptr_head_main,
  );
  foreach (main_header; ptr_head_main) {
    switch (main_header) {
    case "make":
      foreach (sub_header; ptr_head_sub_make) {
        if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) {
          writefln(
            "%s:%s: %s",
            main_header,
            sub_header,
            doc_matters.conf_make_meta.meta.title_full
          );
        }
      }
      break;
    default:
      break;
    }
  }
}
#+END_SRC

** (headermetadatajson)                                        :json:header:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(headermetadatajson) {
  writefln(
    "%s\n%s\n%s",
    "document header, metadata & make instructions:",
    doc_matters.conf_make_meta.meta,
    ptr_head_main,
  );
  foreach (main_header; ptr_head_main) {
    switch (main_header) {
    case "creator":
      foreach (sub_header; ptr_head_sub_creator) {
        if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) {
          writefln(
            "%s:%s: %s",
            main_header,
            sub_header,
            doc_matters.conf_make_meta.meta.title_full,
          );
        }
      }
      break;
    case "title":
      foreach (sub_header; ptr_head_sub_title) {
        if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) {
          writefln(
            "%s:%s: %s",
            main_header,
            sub_header,
            doc_matters.conf_make_meta.meta.title_full
          );
        }
      }
      break;
    case "rights":
      foreach (sub_header; ptr_head_sub_rights) {
        if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) {
          writefln(
            "%s:%s: %s",
            main_header,
            sub_header,
            doc_matters.conf_make_meta.meta.title_full
          );
        }
      }
      break;
    case "date":
      foreach (sub_header; ptr_head_sub_date) {
        if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) {
          writefln(
            "%s:%s: %s",
            main_header,
            sub_header,
            doc_matters.conf_make_meta.meta.title_full
          );
        }
      }
      break;
    case "original":
      foreach (sub_header; ptr_head_sub_original) {
        if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) {
          writefln(
            "%s:%s: %s",
            main_header,
            sub_header,
            doc_matters.conf_make_meta.meta.title_full
          );
        }
      }
      break;
    case "classify":
      foreach (sub_header; ptr_head_sub_classify) {
        if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) {
          writefln(
            "%s:%s: %s",
            main_header,
            sub_header,
            doc_matters.conf_make_meta.meta.title_full
          );
        }
      }
      break;
    case "identifier":
      foreach (sub_header; ptr_head_sub_identifier) {
        if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) {
          writefln(
            "%s:%s: %s",
            main_header,
            sub_header,
            doc_matters.conf_make_meta.meta.title_full
          );
        }
      }
      break;
    case "notes":
      foreach (sub_header; ptr_head_sub_notes) {
        if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) {
          writefln(
            "%s:%s: %s",
            main_header,
            sub_header,
            doc_matters.conf_make_meta.meta.title_full
          );
        }
      }
      break;
    case "publisher":
      foreach (sub_header; ptr_head_sub_publisher) {
        if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) {
          writefln(
            "%s:%s: %s",
            main_header,
            sub_header,
            doc_matters.conf_make_meta.meta.title_full
          );
        }
      }
      break;
    default:
      break;
    }
  }
}
#+END_SRC

** anchor tags

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(anchor) {
  writefln(
    "> %s:%s",
    __FILE__,
    __LINE__,
  );
  foreach (k; doc_matters.xml.keys_seq.seg) {
    foreach (obj; contents[k]) {
      if (obj.metainfo.is_a == "heading") {
        writefln(
          "%s~ [%s] %s %s",
          obj.marked_up_level,
          obj.object_number,
          obj.anchor_tags,
          obj.text
        );
      }
    }
  }
}
#+END_SRC

** (headings)                                                     :headings:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(heading) {                         // heading
  foreach (k; doc_matters.xml.keys_seq.seg) {
    foreach (o; contents[k]) {
      if (o.metainfo.is_a == "heading") {
        writefln(
          "%s* %s\n                (markup level: %s; collapsed level: %s)",
          replicate("  ", o.heading_lev_markup),
          strip(o.text),
          o.heading_lev_markup,
          o.heading_lev_collapsed,
        );
      }
    }
  }
}
#+END_SRC

** (summary) [+1]                                                  :summary:

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(headings) {
  writefln(
    "> %s:%s",
    __FILE__,
    __LINE__,
  );
  foreach (k; doc_matters.xml.keys_seq.seg) {
    foreach (obj; contents[k]) {
      if (obj.metainfo.is_a == "heading") {
        writefln(
          "%s~ [%s] %s",
          obj.marked_up_level,
          obj.object_number,
          obj.text
        );
      }
    }
  }
}
#+END_SRC

#+name: meta_output_debugs
#+BEGIN_SRC d
debug(summary) {
  string[string] check = [
    "last_object_number" : "NA [debug \"checkdoc\" not run]",
  ];
}
#+END_SRC

*** compare number of object_number for known sisu markup output (checkdoc)

#+name: meta_output_debugs_summary
#+BEGIN_SRC d
debug(checkdoc) {
  if (auto mfn=match(doc_matters.src.filename, rgx.src_fn)) {
    if (doc_matters.opt.action.assertions) {
      switch (mfn.captures[2]) {
      // live manual:
      case "live-manual.ssm":
        assert(check["last_object_number"] ==
          "1019","last object_number should be: 1019 (check test, document is frequently updated)"); // ok
        break;
      // sisu_markup:
      case "sisu_markup.sst":
        assert(check["last_object_number"] ==
          "297","last object_number expected to be: 297 rather than " ~ check["last_object_number"]); // ok
        // assert(check["last_object_number"] == "297","last object_number expected to be: 297 rather than " ~ check["last_object_number"]);
        // notes for first divergance study sisu headings 247 250
        // sisu has issue with code that contains heading 1~ which results in no object_number! ??
        // sisu currently has incorrect last body object_number of 294!
        // bug in sisu? attend
        break;
      // sisu-markup-samples:
      case "accelerando.charles_stross.sst":
        assert(check["last_object_number"] ==
          "2861","last object_number expected to be: 2861 rather than " ~ check["last_object_number"]); // ok
        break;
      case "alices_adventures_in_wonderland.lewis_carroll.sst":
        assert(check["last_object_number"] ==
          "805","last object_number expected to be: 805 rather than " ~ check["last_object_number"]); // 808
        break;
      case "autonomy_markup0.sst":
        assert(check["last_object_number"] ==
          "77","last object_number expected to be: 77 rather than " ~ check["last_object_number"]); // ok endnotes
        // assert(check["last_object_number"] == "78","last object_number expected to be: 78 rather than " ~ check["last_object_number"]);
        break;
      case "content.cory_doctorow.sst":
        assert(check["last_object_number"] ==
          "953","last object_number expected to be: 953 rather than " ~ check["last_object_number"]); // 1007 way off, check object_number off switches
        // assert(check["last_object_number"] == "953","last object_number expected to be: 953 rather than " ~ check["last_object_number"]);
        break;
      case "democratizing_innovation.eric_von_hippel.sst":
        // fixed ERROR! range violation, broken check! endnotes, bookindex, biblio
        // error in bookindex ... (ch1; ch6; ch8 )
        assert(check["last_object_number"] ==
          "905","last object_number expected to be: 905 rather than " ~ check["last_object_number"]); // 911
        break;
      case "down_and_out_in_the_magic_kingdom.cory_doctorow.sst":
        assert(check["last_object_number"] ==
          "1417","last object_number expected to be: 1417 rather than " ~ check["last_object_number"]); // 1455 check object_number off switches
        break;
      case "for_the_win.cory_doctorow.sst":
        assert(check["last_object_number"] ==
          "3510","last object_number expected to be: 3510 rather than " ~ check["last_object_number"]); // 3569 check object_number off switches
        break;
      case "free_as_in_freedom_2.richard_stallman_and_the_free_software_revolution.sam_williams.richard_stallman.sst":
        assert(check["last_object_number"] ==
          "1082","last object_number expected to be: 1082 rather than " ~ check["last_object_number"]); // check 1079 too few
        break;
      case "free_culture.lawrence_lessig.sst":
        assert(check["last_object_number"] ==
          "1330","last object_number expected to be: 1330 rather than " ~ check["last_object_number"]); // 1312
        // fixed ERROR! range violation, broken check!
        // error in bookindex ... sections piracy (ch1) & property (ch10 market concentration) fixed
        break;
      case "free_for_all.peter_wayner.sst": // endnotes, bookindex, biblio
        assert(check["last_object_number"] ==
          "1559","last object_number expected to be: 1559 rather than " ~ check["last_object_number"]); // 1560, check object_number off switches, has endnotes so 2 too many
        // assert(check["last_object_number"] == "1559","last object_number expected to be: 1559 rather than " ~ check["last_object_number"]);
        break;
      case "gpl2.fsf.sst":
        assert(check["last_object_number"] ==
          "65","last object_number expected to be: 65 rather than " ~ check["last_object_number"]); // ok endnotes? check
        // assert(check["last_object_number"] == "66","last object_number expected to be: 66 rather than " ~ check["last_object_number"]);
        break;
      case "gpl3.fsf.sst":
        assert(check["last_object_number"] ==
          "123","last object_number expected to be: 123 rather than " ~ check["last_object_number"]); // ok
        break;
      case "gullivers_travels.jonathan_swift.sst":
        assert(check["last_object_number"] ==
          "668","last object_number expected to be: 668 rather than " ~ check["last_object_number"]); // 674
        break;
      case "little_brother.cory_doctorow.sst":
        assert(check["last_object_number"] ==
          "3130","last object_number expected to be: 3130 rather than " ~ check["last_object_number"]); // 3204, check object_number off switches
        break;
      case "the_cathedral_and_the_bazaar.eric_s_raymond.sst":
        assert(check["last_object_number"] ==
          "258","last object_number expected to be: 258 rather than " ~ check["last_object_number"]); // ok
        break;
      case "the_public_domain.james_boyle.sst":
        assert(check["last_object_number"] ==
          "970","last object_number expected to be: 970 rather than " ~ check["last_object_number"]); // 978
        break;
      case "the_wealth_of_networks.yochai_benkler.sst": // endnotes, bookindex
        assert(check["last_object_number"] ==
          "829","last object_number expected to be: 829 rather than " ~ check["last_object_number"]); // ok
        // assert(check["last_object_number"] == "832","last object_number expected to be: 832 rather than " ~ check["last_object_number"]);
        // has endnotes and bookindex, issue with sisu.rb
        break;
      case "through_the_looking_glass.lewis_carroll.sst":
        assert(check["last_object_number"] ==
          "949","last object_number expected to be: 949 rather than " ~ check["last_object_number"]); // 955
        break;
      case "two_bits.christopher_kelty.sst": // endnotes, bookindex, biblio
        assert(check["last_object_number"] ==
          "1190","last object_number expected to be: 1190 rather than " ~ check["last_object_number"]); // 1191
        // assert(check["last_object_number"] == "1193","last object_number expected to be: 1193 rather than " ~ check["last_object_number"]); // 1191 ok?
        // has endnotes and bookindex, issue with sisu.rb
        break;
        // fixed ERROR! range violation!
        // error in bookindex ... (ch3 the movement)
      case "un_contracts_international_sale_of_goods_convention_1980.sst":
        assert(check["last_object_number"] ==
          "377","last object_number expected to be: 377 rather than " ~ check["last_object_number"]); // ok
        break;
      case "viral_spiral.david_bollier.sst": // endnotes, bookindex
        assert(check["last_object_number"] ==
          "1078","last object_number expected to be: 1078 rather than " ~ check["last_object_number"]); // 1100
        // fixed ERROR! range violation!
        // error in bookindex ... (ch7 ... building the cc machine, an extra semi colon)
        break;
      default:
        writeln(doc_matters.src.filename);
        break;
      }
    }
  }
}
#+END_SRC

* __END__