Footnotes and the Bigfoot plugin

This commit is contained in:
Graham Nelson 2020-04-11 13:08:53 +01:00
parent db41a57f65
commit cb81dd9311
33 changed files with 4421 additions and 1479 deletions

View file

@ -818,3 +818,49 @@ void Parser::wrong_version(int using, source_line *L, char *feature, int need) {
Main::error_in_web(warning, L);
DISCARD_TEXT(warning);
}
@h Footnote notation.
=
int Parser::detect_footnote(web *W, text_stream *matter, text_stream *before,
text_stream *cue, text_stream *after) {
text_stream *fn_on_notation =
Bibliographic::get_datum(W->md, I"Footnote Begins Notation");
text_stream *fn_off_notation =
Bibliographic::get_datum(W->md, I"Footnote Ends Notation");
if (Str::ne(fn_on_notation, I"Off")) {
int N1 = Str::len(fn_on_notation);
int N2 = Str::len(fn_off_notation);
if ((N1 > 0) && (N2 > 0))
for (int i=0; i < Str::len(matter); i++) {
if (Str::includes_at(matter, i, fn_on_notation)) {
int j = i + N1 + 1;
while (j < Str::len(matter)) {
if (Str::includes_at(matter, j, fn_off_notation)) {
TEMPORARY_TEXT(b);
TEMPORARY_TEXT(c);
TEMPORARY_TEXT(a);
Str::substr(b, Str::start(matter), Str::at(matter, i));
Str::substr(c, Str::at(matter, i + N1), Str::at(matter, j));
Str::substr(a, Str::at(matter, j + N2), Str::end(matter));
int allow = TRUE;
LOOP_THROUGH_TEXT(pos, c)
if (Characters::isdigit(Str::get(pos)) == FALSE)
allow = FALSE;
if (allow) {
Str::clear(before); Str::copy(before, b);
Str::clear(cue); Str::copy(cue, c);
Str::clear(after); Str::copy(after, a);
}
DISCARD_TEXT(b);
DISCARD_TEXT(c);
DISCARD_TEXT(a);
if (allow) return TRUE;
}
j++;
}
}
}
}
return FALSE;
}

View file

@ -163,7 +163,7 @@ being accessed directly.
The current state of the processor is recorded in the following.
@d MAX_TEMPLATE_LINES 256 /* maximum number of lines in template */
@d MAX_TEMPLATE_LINES 8192 /* maximum number of lines in template */
@d CI_STACK_CAPACITY 8 /* maximum recursion of chapter/section iteration */
=

View file

@ -82,6 +82,12 @@ typedef struct weave_target {
struct linked_list *breadcrumbs; /* non-standard breadcrumb trail, if any */
struct filename *navigation; /* navigation links, or |NULL| if not supplied */
struct linked_list *plugins; /* of |weave_plugin|: these are for HTML extensions */
/* used for workspace during an actual weave: */
struct source_line *current_weave_line;
struct linked_list *footnotes_cued; /* of |text_stream| */
struct linked_list *footnotes_written; /* of |text_stream| */
struct text_stream *current_footnote;
MEMORY_MANAGEMENT
} weave_target;
@ -102,6 +108,11 @@ typedef struct weave_target {
wt->plugins = NEW_LINKED_LIST(weave_plugin);
if (Reader::web_has_one_section(W)) wt->self_contained = TRUE;
Str::copy(wt->cover_sheet_to_use, I"cover-sheet");
wt->current_weave_line = NULL;
wt->footnotes_cued = NEW_LINKED_LIST(text_stream);
wt->footnotes_written = NEW_LINKED_LIST(text_stream);
wt->current_footnote = Str::new();
int has_content = FALSE;
chapter *C;

View file

@ -13,8 +13,6 @@ where to put the result: and so we arrive at the front door of the routine
|Weaver::weave_source| below.
=
source_line *current_weave_line = NULL;
int Weaver::weave_source(web *W, weave_target *wv) {
text_stream TO_struct;
text_stream *OUT = &TO_struct;
@ -57,6 +55,7 @@ int Weaver::weave_source(web *W, weave_target *wv) {
LOOP_OVER_LINKED_LIST(S, section, C->sections)
if (Reader::range_within(S->sect_range, wv->weave_range)) {
latest_section = S;
@<Wipe the slate clean of footnotes@>;
LanguageMethods::begin_weave(S, wv);
Str::clear(state->sectionmark);
@<Weave this section@>;
@ -110,12 +109,17 @@ typedef struct weaver_state {
state->chaptermark = Str::new();
state->sectionmark = Str::new();
@<Wipe the slate clean of footnotes@> =
wv->footnotes_cued = NEW_LINKED_LIST(text_stream);
wv->footnotes_written = NEW_LINKED_LIST(text_stream);
wv->current_footnote = Str::new();
@h Weaving a section.
@<Weave this section@> =
paragraph *current_paragraph = NULL;
for (source_line *L = S->first_line; L; L = L->next_line) {
current_weave_line = L;
wv->current_weave_line = L;
if ((Tags::tagged_with(L->owning_paragraph, wv->theme_match)) &&
(LanguageMethods::skip_in_weaving(S->sect_language, wv, L) == FALSE)) {
lines_woven++;
@ -269,6 +273,7 @@ we only have to transcribe it. But not quite!
@<Weave a blank line as a thin vertical skip and paragraph break@>;
@<Weave bracketed list indications at start of line into indentation@>;
@<Weave tabbed code material as a new indented paragraph@>;
@<Weave footnotes@>;
state->substantive_comment = TRUE;
WRITE_TO(matter, "\n");
Formats::text(OUT, wv, matter);
@ -359,6 +364,44 @@ in the source is set indented in code style.
}
Regexp::dispose_of(&mr);
@<Weave footnotes@> =
TEMPORARY_TEXT(before);
TEMPORARY_TEXT(cue);
TEMPORARY_TEXT(after);
int this_is_a_cue = FALSE;
if (Parser::detect_footnote(wv->weave_web, matter, before, cue, after)) {
LOOP_THROUGH_TEXT(pos, before)
if (Characters::is_whitespace(Str::get(pos)) == FALSE)
this_is_a_cue = TRUE;
if (this_is_a_cue) {
text_stream *T;
LOOP_OVER_LINKED_LIST(T, text_stream, wv->footnotes_cued)
if (Str::eq(T, cue))
Main::error_in_web(I"this is a duplicate footnote cue", L);
ADD_TO_LINKED_LIST(T, text_stream, wv->footnotes_cued);
if (Str::len(wv->current_footnote) > 0)
Main::error_in_web(I"this is a footnote cue within a footnote", L);
} else {
text_stream *T;
LOOP_OVER_LINKED_LIST(T, text_stream, wv->footnotes_written)
if (Str::eq(T, cue))
Main::error_in_web(I"this is a duplicate footnote text", L);
ADD_TO_LINKED_LIST(T, text_stream, wv->footnotes_written);
@<End any currently weaving footnote text@>;
Str::copy(wv->current_footnote, cue);
Formats::begin_footnote_text(OUT, wv, cue);
}
}
DISCARD_TEXT(before);
DISCARD_TEXT(cue);
DISCARD_TEXT(after);
@<End any currently weaving footnote text@> =
if (Str::len(wv->current_footnote) > 0) {
Formats::end_footnote_text(OUT, wv, wv->current_footnote);
Str::clear(wv->current_footnote);
}
@h Code-like matter.
Even though Inweb's approach, unlike |CWEB|'s, is to respect the layout
of the original, this is still quite typographically complex: commentary
@ -687,6 +730,7 @@ At the end of a paragraph, on the other hand, we do this:
Weaver::show_endnotes_on_previous_paragraph(OUT, wv, current_paragraph);
}
if (L) current_paragraph = L->owning_paragraph;
@<End any currently weaving footnote text@>;
@h Endnotes.
The endnotes describe function calls from far away, or unexpected

View file

@ -231,6 +231,55 @@ void Formats::url(OUTPUT_STREAM, weave_target *wv, text_stream *url,
}
}
@ And this weaves a footnote cue.
@e FOOTNOTE_CUE_FOR_MTID
=
VMETHOD_TYPE(FOOTNOTE_CUE_FOR_MTID, weave_format *wf, text_stream *OUT, weave_target *wv,
text_stream *cue)
void Formats::footnote_cue(OUTPUT_STREAM, weave_target *wv, text_stream *cue) {
weave_format *wf = wv->format;
if (Methods::provided(wf->methods, FOOTNOTE_CUE_FOR_MTID)) {
VMETHOD_CALL(wf, FOOTNOTE_CUE_FOR_MTID, OUT, wv, cue);
} else {
WRITE("[%S]", cue);
}
}
@ And this weaves a footnote text opening...
@e BEGIN_FOOTNOTE_TEXT_FOR_MTID
=
VMETHOD_TYPE(BEGIN_FOOTNOTE_TEXT_FOR_MTID, weave_format *wf, text_stream *OUT, weave_target *wv,
text_stream *cue)
void Formats::begin_footnote_text(OUTPUT_STREAM, weave_target *wv, text_stream *cue) {
weave_format *wf = wv->format;
if (Methods::provided(wf->methods, BEGIN_FOOTNOTE_TEXT_FOR_MTID)) {
VMETHOD_CALL(wf, BEGIN_FOOTNOTE_TEXT_FOR_MTID, OUT, wv, cue);
} else {
WRITE("[%S]. ", cue);
}
}
@ ...bookended by a footnote text closing. The weaver ensures that these occur
in pairs and do not nest.
@e END_FOOTNOTE_TEXT_FOR_MTID
=
VMETHOD_TYPE(END_FOOTNOTE_TEXT_FOR_MTID, weave_format *wf, text_stream *OUT, weave_target *wv,
text_stream *cue)
void Formats::end_footnote_text(OUTPUT_STREAM, weave_target *wv, text_stream *cue) {
weave_format *wf = wv->format;
if (Methods::provided(wf->methods, END_FOOTNOTE_TEXT_FOR_MTID)) {
VMETHOD_CALL(wf, END_FOOTNOTE_TEXT_FOR_MTID, OUT, wv, cue);
} else {
WRITE("\n");
}
}
@ This method produces the |>> Example| bits of example source text, really
a convenience for Inform 7 code commentary.
@ -426,6 +475,7 @@ void Formats::text_r(OUTPUT_STREAM, weave_target *wv, text_stream *id,
if (within) {
Formats::source_fragment(OUT, wv, id);
} else {
@<Detect use of footnotes@>;
Formats::text_fragment(OUT, wv, id);
}
}
@ -469,6 +519,22 @@ void Formats::text_r(OUTPUT_STREAM, weave_target *wv, text_stream *id,
}
}
@<Detect use of footnotes@> =
TEMPORARY_TEXT(before);
TEMPORARY_TEXT(cue);
TEMPORARY_TEXT(after);
int allow = FALSE;
if (Parser::detect_footnote(wv->weave_web, id, before, cue, after)) {
allow = TRUE;
Formats::text_r(OUT, wv, before, within, comments);
Formats::footnote_cue(OUT, wv, cue);
Formats::text_r(OUT, wv, after, within, comments);
}
DISCARD_TEXT(before);
DISCARD_TEXT(cue);
DISCARD_TEXT(after);
if (allow) return;
@<Recognise cross-references@> =
int N = Str::len(xref_notation);
for (int i=0; i < Str::len(id); i++) {
@ -498,7 +564,7 @@ void Formats::text_r(OUTPUT_STREAM, weave_target *wv, text_stream *id,
TEMPORARY_TEXT(url);
TEMPORARY_TEXT(title);
if (Formats::resolve_reference_in_weave(url, title, wv, reference,
current_weave_line)) {
wv->current_weave_line)) {
Formats::text_r(OUT, wv, before, within, comments);
Formats::url(OUT, wv, url, title, FALSE);
Formats::text_r(OUT, wv, after, within, comments);

View file

@ -28,6 +28,9 @@ void HTMLFormat::create(void) {
METHOD_ADD(wf, SOURCE_CODE_FOR_MTID, HTMLFormat::source_code);
METHOD_ADD(wf, INLINE_CODE_FOR_MTID, HTMLFormat::inline_code);
METHOD_ADD(wf, URL_FOR_MTID, HTMLFormat::url);
METHOD_ADD(wf, FOOTNOTE_CUE_FOR_MTID, HTMLFormat::footnote_cue);
METHOD_ADD(wf, BEGIN_FOOTNOTE_TEXT_FOR_MTID, HTMLFormat::begin_footnote_text);
METHOD_ADD(wf, END_FOOTNOTE_TEXT_FOR_MTID, HTMLFormat::end_footnote_text);
METHOD_ADD(wf, DISPLAY_LINE_FOR_MTID, HTMLFormat::display_line);
METHOD_ADD(wf, ITEM_FOR_MTID, HTMLFormat::item);
METHOD_ADD(wf, BAR_FOR_MTID, HTMLFormat::bar);
@ -400,7 +403,7 @@ void HTMLFormat::source_code(weave_format *self, text_stream *OUT, weave_target
TEMPORARY_TEXT(url);
TEMPORARY_TEXT(title);
if (Formats::resolve_reference_in_weave(url, title, wv, reference,
current_weave_line)) {
wv->current_weave_line)) {
Formats::url(OUT, wv, url, title, FALSE);
i = j + N;
}
@ -433,6 +436,37 @@ void HTMLFormat::url(weave_format *self, text_stream *OUT, weave_target *wv,
HTML::end_link(OUT);
}
@=
void HTMLFormat::footnote_cue(weave_format *self, text_stream *OUT, weave_target *wv,
text_stream *cue) {
text_stream *fn_plugin_name =
Bibliographic::get_datum(wv->weave_web->md, I"Footnotes Plugin");
if (Str::ne_insensitive(fn_plugin_name, I"None"))
Swarm::ensure_plugin(wv, fn_plugin_name);
WRITE("<sup id=\"fnref:%S\"><a href=\"#fn:%S\" rel=\"footnote\">%S</a></sup>",
cue, cue, cue);
}
@=
void HTMLFormat::begin_footnote_text(weave_format *self, text_stream *OUT, weave_target *wv,
text_stream *cue) {
text_stream *fn_plugin_name =
Bibliographic::get_datum(wv->weave_web->md, I"Footnotes Plugin");
if (Str::ne_insensitive(fn_plugin_name, I"None"))
Swarm::ensure_plugin(wv, fn_plugin_name);
WRITE("<li class=\"footnote\" id=\"fn:%S\"><p>", cue);
}
@=
void HTMLFormat::end_footnote_text(weave_format *self, text_stream *OUT, weave_target *wv,
text_stream *cue) {
text_stream *fn_plugin_name =
Bibliographic::get_datum(wv->weave_web->md, I"Footnotes Plugin");
if (Str::ne_insensitive(fn_plugin_name, I"None"))
Swarm::ensure_plugin(wv, fn_plugin_name);
WRITE("<a href=\"#fnref:%S\" title=\"return to text\"> &#x21A9;</a></p></li>", cue);
}
@ =
void HTMLFormat::display_line(weave_format *self, text_stream *OUT, weave_target *wv,
text_stream *from) {
@ -499,7 +533,7 @@ void HTMLFormat::embed(weave_format *self, text_stream *OUT, weave_target *wv,
DISCARD_TEXT(embed_leaf);
if (TextFiles::exists(F) == FALSE) {
Main::error_in_web(I"This is not a supported service", current_weave_line);
Main::error_in_web(I"This is not a supported service", wv->current_weave_line);
return;
}

View file

@ -20,14 +20,19 @@ weave_plugin *WeavePlugins::new(text_stream *name) {
void WeavePlugins::include(OUTPUT_STREAM, web *W, weave_plugin *wp,
weave_pattern *pattern) {
pathname *P1 = Pathnames::subfolder(W->md->path_to_web, I"Plugins");
pathname *P2 = Pathnames::subfolder(path_to_inweb, I"Plugins");
TEMPORARY_TEXT(embed_leaf);
TEMPORARY_TEXT(css_leaf);
WRITE_TO(embed_leaf, "%S.html", wp->plugin_name);
filename *F = Filenames::in_folder(
Pathnames::subfolder(W->md->path_to_web, I"Plugins"), embed_leaf);
if (TextFiles::exists(F) == FALSE)
F = Filenames::in_folder(
Pathnames::subfolder(path_to_inweb, I"Plugins"), embed_leaf);
WRITE_TO(css_leaf, "%S.css", wp->plugin_name);
filename *F = P1?(Filenames::in_folder(P1, embed_leaf)):NULL;
if (TextFiles::exists(F) == FALSE) F = P2?(Filenames::in_folder(P2, embed_leaf)):NULL;
filename *CF = P1?(Filenames::in_folder(P1, css_leaf)):NULL;
if (TextFiles::exists(CF) == FALSE) CF = P2?(Filenames::in_folder(P2, css_leaf)):NULL;
DISCARD_TEXT(embed_leaf);
DISCARD_TEXT(css_leaf);
if (TextFiles::exists(F) == FALSE) {
TEMPORARY_TEXT(err);
@ -36,4 +41,9 @@ void WeavePlugins::include(OUTPUT_STREAM, web *W, weave_plugin *wp,
return;
}
Indexer::run(W, I"", F, NULL, OUT, pattern, NULL, NULL, NULL, FALSE, TRUE);
if (TextFiles::exists(CF)) {
WRITE("<link href=\"%S.css\" rel=\"stylesheet\" rev=\"stylesheet\" type=\"text/css\">\n",
wp->plugin_name);
Patterns::copy_file_into_weave(W, CF);
}
}

View file

@ -502,7 +502,8 @@ For example, it's known that the average running time of Euclid's GCD
algorithm on $a$ and numbers coprime to $a$ is:
$$ \tau (a)={\frac {12}{\pi ^{2}}}\ln 2\ln a+C+O(a^{-1/6-\varepsilon }) $$
where $C$ is Porter's constant,
$$ C=-{\frac {1}{2}}+{\frac {6\ln 2}{\pi ^{2}}}\left(4\gamma -{\frac {24}{\pi ^{2}}}\zeta '(2)+3\ln 2-2\right)\approx 1.467 $$
$$ C=-{\frac {1}{2}}+{\frac {6\ln 2}{\pi ^{2}}}
\left(4\gamma - {\frac {24}{\pi ^{2}}}\zeta'(2)+3\ln 2-2\right)\approx 1.467 $$
which involves evaluating Euler's constant $\gamma$ and the first derivative
of the Riemann zeta function $\zeta'(z)$ at $z=2$.
@ -513,7 +514,7 @@ That passage was achieved by typing this as the Inweb source:
$$ \tau (a)={\frac {12}{\pi ^{2}}}\ln 2\ln a+C+O(a^{-1/6-\varepsilon }) $$
where $C$ is Porter's constant,
$$ C=-{\frac {1}{2}}+{\frac {6\ln 2}{\pi ^{2}}}
\left(4\gamma -{\frac {24}{\pi^{2}}}\zeta '(2)+3\ln 2-2\right)\approx 1.467 $$
\left(4\gamma - {\frac {24}{\pi^{2}}}\zeta'(2)+3\ln 2-2\right)\approx 1.467 $$
which involves evaluating Euler's constant $\gamma$ and the first derivative
of the Riemann zeta function $\zeta'(z)$ at $z=2$.
=
@ -538,3 +539,52 @@ deactivated entirely by writing the following in the Contents section of a web:
TeX Mathematics Notation: Off
=
(This is always |On|, the default, or |Off|.)
@h Footnotes.
Not everyone likes footnotes,[1] but sometimes they're a tidy way to make
references.[2]
[1] But see Anthony Grafton, "The Footnote: A Curious History" (Harvard
University Press, 1999).
[2] For example, to cite Donald Knuth, "Evaluation of Porter's constant",
Computers & Mathematics with Applications, 2, 137-39 (1976).
@ The content of that sentence was typed as follows:
= (text as Inweb)
Not everyone likes footnotes,[1] but sometimes they're a tidy way to make
references.[2]
[1] But see Anthony Grafton, "The Footnote: A Curious History" (Harvard
University Press, 1999).
[2] For example, to cite Donald Knuth, "Evaluation of Porter's constant",
Computers & Mathematics with Applications, 2, 137-39 (1976).
=
If you're reading this as a web page (with Javascript on), then you should
have seen clickable footnote blobs, which reveal the text. If Javascript is
off, there's a more conventionally textual presentation.
These blob-footnotes are fine for snarky asides or quick references, but long
discursive notes need more space, so if you intend to use those then you
should probably turn this rendering off altogether:
= (text as Inweb)
Footnotes Plugin: None
=
Footnotes are otherwise rendered by the |Bigfoot| plugin, which is the default
value of this; its big feet unfortunately tread on the |MathJax3| plugin, so
right now it's not possible to have mathematics in a footnote when |Bigfoot|
is in use.
@ Once again, notation may be an issue, and so it's controllable. By default,
we have:
= (text as Inweb)
Footnote Begins Notation: [
Footnote Ends Notation: ]
=
but if you need squares for something else in your commentary, then perhaps:
= (text as Inweb)
Footnote Begins Notation: [fn
Footnote Ends Notation: ]
=
would be sensible. The "cue" between these notations is required to be a
string of digits; each must occur just once in its section; and each must
have a text and a cue which match up correctly.

352
Plugins/Bigfoot.css Normal file
View file

@ -0,0 +1,352 @@
.bigfoot-footnote__button {
position: relative;
z-index: 5;
top: -0.1em;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-moz-box-sizing: border-box;
display: inline-block;
padding: 0.35em;
margin: 0 0.1em 0 0.2em;
border: none;
border-radius: 0.3em;
cursor: pointer;
background-color: rgba(110, 110, 110, 0.2);
-webkit-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
font-size: 1rem;
line-height: 0;
vertical-align: middle;
text-decoration: none;
font-smoothing: antialiased;
-webkit-transition-property: background-color;
transition-property: background-color;
-webkit-transition-duration: 0.25s;
transition-duration: 0.25s;
}
.bigfoot-footnote__button:hover,
.bigfoot-footnote__button:focus {
outline: none;
background-color: rgba(110, 110, 110, 0.5);
}
.bigfoot-footnote__button:active {
background-color: rgba(110, 110, 110, 0.5);
}
.bigfoot-footnote__button.is-active {
background-color: #6e6e6e;
-webkit-transition-delay: 0.1s;
transition-delay: 0.1s;
}
.bigfoot-footnote__button:after {
content: '';
display: table;
clear: both;
}
.bigfoot-footnote__button__circle {
display: inline-block;
width: 0.25em;
height: 0.25em;
margin-right: 0.25em;
float: left;
}
.bigfoot-footnote__button__circle:last-child {
margin-right: 0;
}
.bigfoot-footnote__container {
display: inline-block;
position: relative;
text-indent: 0;
}
@media not print {
.footnote-print-only {
display: none !important;
}
}
@media print {
.bigfoot-footnote,
.bigfoot-footnote__button {
display: none !important;
}
}
.bigfoot-footnote {
position: absolute;
z-index: 10;
top: 0;
left: 0;
display: inline-block;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
max-width: 90%;
margin: 1.96924em 0;
background: #fafafa;
opacity: 0;
border-radius: 0.5em;
border: 1px solid #c3c3c3;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
line-height: 0;
-webkit-transition-property: opacity, -webkit-transform;
transition-property: opacity, transform;
-webkit-transition-duration: 0.25s;
transition-duration: 0.25s;
-webkit-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transform: scale(0.1) translateZ(0);
-ms-transform: scale(0.1) translateZ(0);
transform: scale(0.1) translateZ(0);
-webkit-transform-origin: 50% 0;
-ms-transform-origin: 50% 0;
transform-origin: 50% 0;
}
.bigfoot-footnote.is-positioned-top {
top: auto;
bottom: 0;
}
.bigfoot-footnote.is-active {
-webkit-transform: scale(1) translateZ(0);
-ms-transform: scale(1) translateZ(0);
transform: scale(1) translateZ(0);
opacity: 0.97;
}
.bigfoot-footnote.is-bottom-fixed {
position: fixed;
bottom: 0;
top: auto;
left: 0;
right: auto;
-webkit-transform: translateY(100%);
-ms-transform: translateY(100%);
transform: translateY(100%);
width: 100%;
margin: 0;
border-radius: 0;
opacity: 1;
border-width: 1px 0 0;
-webkit-transition: -webkit-transform 0.3s ease;
transition: transform 0.3s ease;
}
.bigfoot-footnote.is-bottom-fixed.is-active {
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0);
}
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__wrapper {
margin: 0 0 0 50%;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
max-width: 100%;
}
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__wrapper,
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__content {
border-radius: 0;
}
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__tooltip {
display: none;
}
.bigfoot-footnote.is-scrollable:after {
content: '';
position: absolute;
bottom: 0.3375em;
left: 0.3375em;
z-index: 14;
display: block;
height: 0.78125em;
width: 0.625em;
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTJweCIgaGVpZ2h0PSIxNXB4IiB2aWV3Qm94PSIwIDAgMTIgMTUiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pbllNaW4iPgogICAgPGcgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IkFycm93IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxLjAwMDAwMCwgMS4wMDAwMDApIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiPgogICAgICAgICAgICA8cGF0aCBkPSJNNSwwIEw1LDExLjUiIGlkPSJMaW5lIj48L3BhdGg+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLjUsNy41IEw1LjAyNzY5Mjc5LDEyLjAyNzY5MjgiIGlkPSJMaW5lIj48L3BhdGg+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik00LjUsNy41IEw5LjAyNzY5Mjc5LDEyLjAyNzY5MjgiIGlkPSJMaW5lLTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDcuMDAwMDAwLCAxMC4wMDAwMDApIHNjYWxlKC0xLCAxKSB0cmFuc2xhdGUoLTcuMDAwMDAwLCAtMTAuMDAwMDAwKSAiPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPgo=");
-webkit-background-size: cover;
background-size: cover;
opacity: 0.1;
transition-properties: opacity;
-webkit-transition-duration: 0.25s;
transition-duration: 0.25s;
-webkit-transition-timing-function: ease;
transition-timing-function: ease;
}
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:before,
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:after {
content: '';
position: absolute;
width: 100%;
z-index: 12;
left: 0;
}
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:before {
top: -1px;
height: 1.1em;
border-radius: 0.5em 0.5em 0 0;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fafafa), to(rgba(250, 250, 250, 0)));
background-image: -webkit-linear-gradient(top, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
background-image: linear-gradient(to bottom, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
}
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:after {
bottom: -1px;
height: 1.2em;
border-radius: 0 0 0.5em 0.5em;
background-image: -webkit-gradient(linear, left bottom, left top, from(#fafafa), to(rgba(250, 250, 250, 0)));
background-image: -webkit-linear-gradient(bottom, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
background-image: linear-gradient(to top, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
}
.bigfoot-footnote.is-scrollable ::-webkit-scrollbar {
display: none;
}
.bigfoot-footnote.is-fully-scrolled:after,
.bigfoot-footnote.is-fully-scrolled:before {
opacity: 0;
-webkit-transition-delay: 0;
transition-delay: 0;
}
.bigfoot-footnote__wrapper {
position: relative;
z-index: 14;
width: 22em;
display: inline-block;
-webkit-box-sizing: inherit;
-moz-box-sizing: inherit;
box-sizing: inherit;
overflow: hidden;
margin: 0;
background-color: #fafafa;
border-radius: 0.5em;
line-height: 0;
}
.bigfoot-footnote__content {
position: relative;
z-index: 8;
display: inline-block;
max-height: 15em;
padding: 1.1em 1.3em 1.2em;
-webkit-box-sizing: inherit;
-moz-box-sizing: inherit;
box-sizing: inherit;
overflow: auto;
-webkit-overflow-scrolling: touch;
background: #fafafa;
border-radius: 0.5em;
font-smoothing: subpixel-antialiased;
line-height: normal;
}
.bigfoot-footnote__content img {
max-width: 100%;
}
.bigfoot-footnote__content *:last-child {
margin-bottom: 0 !important;
}
.bigfoot-footnote__content *:first-child {
margin-top: 0 !important;
}
.bigfoot-footnote__tooltip {
position: absolute;
z-index: 12;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-left: -0.65em;
width: 1.3em;
height: 1.3em;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
background: #fafafa;
border: 1px solid #c3c3c3;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
border-top-left-radius: 0;
}
.is-positioned-bottom .bigfoot-footnote__tooltip {
top: -0.65em;
}
.is-positioned-top .bigfoot-footnote__tooltip {
bottom: -0.65em;
}
.bigfoot-footnote__button {
position: relative;
height: 0.95em;
width: 1.5em;
border-radius: 0.475em;
}
.bigfoot-footnote__button:after {
content: attr(data-footnote-number);
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
display: block;
font-size: 0.57em;
font-weight: bold;
color: rgba(0, 0, 0, 0.5);
-webkit-transition: color 0.25s ease;
transition: color 0.25s ease;
}
.bigfoot-footnote__button:hover:after,
.bigfoot-footnote__button.is-active:after {
color: white;
}
.bigfoot-footnote__button__circle {
display: none;
}
/* Dark Mode */
@media (prefers-color-scheme: dark) {
.bigfoot-footnote__content {
color: black;
}
.bigfoot-footnote__button {
background-color: rgba(255, 255, 255, 0.8);
}
}

645
Plugins/Bigfoot.html Normal file
View file

@ -0,0 +1,645 @@
<script src="http://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script type="text/javascript">
(function() {
(function($) {
return $.bigfoot = function(options) {
var addBreakpoint, baseFontSize, bigfoot, buttonHover, calculatePixelDimension, cleanFootnoteLinks, clickButton, createPopover, defaults, deleteEmptyOrHR, escapeKeypress, footnoteInit, getSetting, makeDefaultCallbacks, popoverStates, positionTooltip, removeBackLinks, removeBreakpoint, removePopovers, replaceWithReferenceAttributes, repositionFeet, roomCalc, settings, touchClick, unhoverFeet, updateSetting, viewportDetails;
bigfoot = void 0;
defaults = {
actionOriginalFN: "hide",
activateCallback: function() {},
activateOnHover: false,
allowMultipleFN: false,
anchorPattern: /(fn|footnote|note)[:\-_\d]/gi,
anchorParentTagname: 'sup',
breakpoints: {},
deleteOnUnhover: false,
footnoteParentClass: 'footnote',
footnoteTagname: 'li',
hoverDelay: 250,
numberResetSelector: void 0,
popoverDeleteDelay: 300,
popoverCreateDelay: 100,
positionContent: true,
preventPageScroll: true,
scope: false,
useFootnoteOnlyOnce: true,
contentMarkup: "<aside class=\"bigfoot-footnote is-positioned-bottom\" data-footnote-number=\"{{FOOTNOTENUM}}\" data-footnote-identifier=\"{{FOOTNOTEID}}\" alt=\"Footnote {{FOOTNOTENUM}}\"> <div class=\"bigfoot-footnote__wrapper\"> <div class=\"bigfoot-footnote__content\"> {{FOOTNOTECONTENT}} </div></div> <div class=\"bigfoot-footnote__tooltip\"></div> </aside>",
buttonMarkup: "<div class='bigfoot-footnote__container'> <button class=\"bigfoot-footnote__button\" id=\"{{SUP:data-footnote-backlink-ref}}\" data-footnote-number=\"{{FOOTNOTENUM}}\" data-footnote-identifier=\"{{FOOTNOTEID}}\" alt=\"See Footnote {{FOOTNOTENUM}}\" rel=\"footnote\" data-bigfoot-footnote=\"{{FOOTNOTECONTENT}}\"> <svg class=\"bigfoot-footnote__button__circle\" viewbox=\"0 0 6 6\" preserveAspectRatio=\"xMinYMin\"><circle r=\"3\" cx=\"3\" cy=\"3\" fill=\"white\"></circle></svg> <svg class=\"bigfoot-footnote__button__circle\" viewbox=\"0 0 6 6\" preserveAspectRatio=\"xMinYMin\"><circle r=\"3\" cx=\"3\" cy=\"3\" fill=\"white\"></circle></svg> <svg class=\"bigfoot-footnote__button__circle\" viewbox=\"0 0 6 6\" preserveAspectRatio=\"xMinYMin\"><circle r=\"3\" cx=\"3\" cy=\"3\" fill=\"white\"></circle></svg> </button></div>"
};
settings = $.extend(defaults, options);
popoverStates = {};
footnoteInit = function() {
var $curResetElement, $currentLastFootnoteLink, $footnoteAnchors, $footnoteButton, $lastResetElement, $parent, $relevantFNLink, $relevantFootnote, finalFNLinks, footnoteButton, footnoteButtonSearchQuery, footnoteContent, footnoteIDNum, footnoteLinks, footnoteNum, footnotes, i, _i, _ref, _results;
footnoteButtonSearchQuery = settings.scope ? "" + settings.scope + " a[href*=\"#\"]" : "a[href*=\"#\"]";
$footnoteAnchors = $(footnoteButtonSearchQuery).filter(function() {
var $this, relAttr;
$this = $(this);
relAttr = $this.attr("rel");
if (relAttr === "null" || (relAttr == null)) {
relAttr = "";
}
return ("" + ($this.attr("href")) + relAttr).match(settings.anchorPattern) && $this.closest("[class*=" + settings.footnoteParentClass + "]:not(a):not(" + settings.anchorParentTagname + ")").length < 1;
});
footnotes = [];
footnoteLinks = [];
finalFNLinks = [];
cleanFootnoteLinks($footnoteAnchors, footnoteLinks);
$(footnoteLinks).each(function() {
var $closestFootnoteEl, relatedFN;
relatedFN = $(this).data("footnote-ref").replace(/[:.+~*\]\[]/g, "\\$&");
if (settings.useFootnoteOnlyOnce) {
relatedFN = "" + relatedFN + ":not(.footnote-processed)";
}
$closestFootnoteEl = $(relatedFN).closest(settings.footnoteTagname);
if ($closestFootnoteEl.length > 0) {
footnotes.push($closestFootnoteEl.first().addClass("footnote-processed"));
return finalFNLinks.push(this);
}
});
$currentLastFootnoteLink = $("[data-footnote-identifier]:last");
footnoteIDNum = $currentLastFootnoteLink.length < 1 ? 0 : +$currentLastFootnoteLink.data("footnote-identifier");
_results = [];
for (i = _i = 0, _ref = footnotes.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
footnoteContent = removeBackLinks($(footnotes[i]).html().trim(), $(finalFNLinks[i]).data("footnote-backlink-ref"));
footnoteContent = footnoteContent.replace(/"/g, "&quot;").replace(/&lt;/g, "&ltsym;").replace(/&gt;/g, "&gtsym;");
footnoteIDNum += 1;
footnoteButton = "";
$relevantFNLink = $(finalFNLinks[i]);
$relevantFootnote = $(footnotes[i]);
if (settings.numberResetSelector != null) {
$curResetElement = $relevantFNLink.closest(settings.numberResetSelector);
if ($curResetElement.is($lastResetElement)) {
footnoteNum += 1;
} else {
footnoteNum = 1;
}
$lastResetElement = $curResetElement;
} else {
footnoteNum = footnoteIDNum;
}
if (footnoteContent.indexOf("<") !== 0) {
footnoteContent = "<p>" + footnoteContent + "</p>";
}
footnoteButton = settings.buttonMarkup.replace(/\{\{FOOTNOTENUM\}\}/g, footnoteNum).replace(/\{\{FOOTNOTEID\}\}/g, footnoteIDNum).replace(/\{\{FOOTNOTECONTENT\}\}/g, footnoteContent);
footnoteButton = replaceWithReferenceAttributes(footnoteButton, "SUP", $relevantFNLink);
footnoteButton = replaceWithReferenceAttributes(footnoteButton, "FN", $relevantFootnote);
$footnoteButton = $(footnoteButton).insertBefore($relevantFNLink);
$parent = $relevantFootnote.parent();
switch (settings.actionOriginalFN.toLowerCase()) {
case "hide":
$relevantFNLink.addClass("footnote-print-only");
$relevantFootnote.addClass("footnote-print-only");
_results.push(deleteEmptyOrHR($parent));
break;
case "delete":
$relevantFNLink.remove();
$relevantFootnote.remove();
_results.push(deleteEmptyOrHR($parent));
break;
default:
_results.push($relevantFNLink.addClass("footnote-print-only"));
}
}
return _results;
};
cleanFootnoteLinks = function($footnoteAnchors, footnoteLinks) {
var $parent, $supChild, linkHREF, linkID;
if (footnoteLinks == null) {
footnoteLinks = [];
}
$parent = void 0;
$supChild = void 0;
linkHREF = void 0;
linkID = void 0;
$footnoteAnchors.each(function() {
var $child, $this;
$this = $(this);
linkHREF = "#" + ($this.attr("href")).split("#")[1];
$parent = $this.closest(settings.anchorParentTagname);
$child = $this.find(settings.anchorParentTagname);
if ($parent.length > 0) {
linkID = ($parent.attr("id") || "") + ($this.attr("id") || "");
return footnoteLinks.push($parent.attr({
"data-footnote-backlink-ref": linkID,
"data-footnote-ref": linkHREF
}));
} else if ($child.length > 0) {
linkID = ($child.attr("id") || "") + ($this.attr("id") || "");
return footnoteLinks.push($this.attr({
"data-footnote-backlink-ref": linkID,
"data-footnote-ref": linkHREF
}));
} else {
linkID = $this.attr("id") || "";
return footnoteLinks.push($this.attr({
"data-footnote-backlink-ref": linkID,
"data-footnote-ref": linkHREF
}));
}
});
};
deleteEmptyOrHR = function($el) {
var $parent;
$parent = void 0;
if ($el.is(":empty") || $el.children(":not(.footnote-print-only)").length === 0) {
$parent = $el.parent();
if (settings.actionOriginalFN.toLowerCase() === "delete") {
$el.remove();
} else {
$el.addClass("footnote-print-only");
}
return deleteEmptyOrHR($parent);
} else if ($el.children(":not(.footnote-print-only)").length === $el.children("hr:not(.footnote-print-only)").length) {
$parent = $el.parent();
if (settings.actionOriginalFN.toLowerCase() === "delete") {
$el.remove();
} else {
$el.children("hr").addClass("footnote-print-only");
$el.addClass("footnote-print-only");
}
return deleteEmptyOrHR($parent);
}
};
removeBackLinks = function(footnoteHTML, backlinkID) {
var regex;
if (backlinkID.indexOf(' ') >= 0) {
backlinkID = backlinkID.trim().replace(/\s+/g, "|").replace(/(.*)/g, "($1)");
}
regex = new RegExp("(\\s|&nbsp;)*<\\s*a[^#<]*#" + backlinkID + "[^>]*>(.*?)<\\s*/\\s*a>", "g");
return footnoteHTML.replace(regex, "").replace("[]", "");
};
replaceWithReferenceAttributes = function(string, referenceKeyword, $referenceElement) {
var refMatches, refRegex, refReplaceRegex, refReplaceText;
refRegex = new RegExp("\\{\\{" + referenceKeyword + ":([^\\}]*)\\}\\}", "g");
refMatches = void 0;
refReplaceText = void 0;
refReplaceRegex = void 0;
refMatches = refRegex.exec(string);
while (refMatches) {
if (refMatches[1]) {
refReplaceText = $referenceElement.attr(refMatches[1]) || "";
string = string.replace("{{" + referenceKeyword + ":" + refMatches[1] + "}}", refReplaceText);
}
refMatches = refRegex.exec(string);
}
return string;
};
buttonHover = function(event) {
var $buttonHovered, dataIdentifier, otherPopoverSelector;
if (settings.activateOnHover) {
$buttonHovered = $(event.target).closest(".bigfoot-footnote__button");
dataIdentifier = "[data-footnote-identifier=\"" + ($buttonHovered.attr("data-footnote-identifier")) + "\"]";
if ($buttonHovered.hasClass("is-active")) {
return;
}
$buttonHovered.addClass("is-hover-instantiated");
if (!settings.allowMultipleFN) {
otherPopoverSelector = ".bigfoot-footnote:not(" + dataIdentifier + ")";
removePopovers(otherPopoverSelector);
}
createPopover(".bigfoot-footnote__button" + dataIdentifier).addClass("is-hover-instantiated");
}
};
touchClick = function(event) {
var $nearButton, $nearFootnote, $target;
$target = $(event.target);
$nearButton = $target.closest(".bigfoot-footnote__button");
$nearFootnote = $target.closest(".bigfoot-footnote");
if ($nearButton.length > 0) {
event.preventDefault();
clickButton($nearButton);
} else if ($nearFootnote.length < 1) {
if ($(".bigfoot-footnote").length > 0) {
removePopovers();
}
}
};
clickButton = function($button) {
var dataIdentifier;
$button.blur();
dataIdentifier = "data-footnote-identifier=\"" + ($button.attr("data-footnote-identifier")) + "\"";
if ($button.hasClass("changing")) {
return;
} else if (!$button.hasClass("is-active")) {
$button.addClass("changing");
setTimeout((function() {
return $button.removeClass("changing");
}), settings.popoverCreateDelay);
createPopover(".bigfoot-footnote__button[" + dataIdentifier + "]");
$button.addClass("is-click-instantiated");
if (!settings.allowMultipleFN) {
removePopovers(".bigfoot-footnote:not([" + dataIdentifier + "])");
}
} else {
if (!settings.allowMultipleFN) {
removePopovers();
} else {
removePopovers(".bigfoot-footnote[" + dataIdentifier + "]");
}
}
};
createPopover = function(selector) {
var $buttons, $popoversCreated;
$buttons = void 0;
if (typeof selector !== "string" && settings.allowMultipleFN) {
$buttons = selector;
} else if (typeof selector !== "string") {
$buttons = selector.first();
} else if (settings.allowMultipleFN) {
$buttons = $(selector).closest(".bigfoot-footnote__button");
} else {
$buttons = $(selector + ":first").closest(".bigfoot-footnote__button");
}
$popoversCreated = $();
$buttons.each(function() {
var $content, $contentContainer, $this, content;
$this = $(this);
content = void 0;
try {
content = settings.contentMarkup.replace(/\{\{FOOTNOTENUM\}\}/g, $this.attr("data-footnote-number")).replace(/\{\{FOOTNOTEID\}\}/g, $this.attr("data-footnote-identifier")).replace(/\{\{FOOTNOTECONTENT\}\}/g, $this.attr("data-bigfoot-footnote")).replace(/\&gtsym\;/g, "&gt;").replace(/\&ltsym\;/g, "&lt;");
return content = replaceWithReferenceAttributes(content, "BUTTON", $this);
} finally {
$content = $(content);
try {
settings.activateCallback($content, $this);
} catch (_error) {}
$content.insertAfter($buttons);
popoverStates[$this.attr("data-footnote-identifier")] = "init";
$content.attr("bigfoot-max-width", calculatePixelDimension($content.css("max-width"), $content));
$content.css("max-width", 10000);
$contentContainer = $content.find(".bigfoot-footnote__content");
$content.attr("data-bigfoot-max-height", calculatePixelDimension($contentContainer.css("max-height"), $contentContainer));
repositionFeet();
$this.addClass("is-active");
$content.find(".bigfoot-footnote__content").bindScrollHandler();
$popoversCreated = $popoversCreated.add($content);
}
});
setTimeout((function() {
return $popoversCreated.addClass("is-active");
}), settings.popoverCreateDelay);
return $popoversCreated;
};
baseFontSize = function() {
var el, size;
el = document.createElement("div");
el.style.cssText = "display:inline-block;padding:0;line-height:1;position:absolute;visibility:hidden;font-size:1em;";
el.appendChild(document.createElement("M"));
document.body.appendChild(el);
size = el.offsetHeight;
document.body.removeChild(el);
return size;
};
calculatePixelDimension = function(dim, $el) {
if (dim === "none") {
dim = 10000;
} else if (dim.indexOf("rem") >= 0) {
dim = parseFloat(dim) * baseFontSize();
} else if (dim.indexOf("em") >= 0) {
dim = parseFloat(dim) * parseFloat($el.css("font-size"));
} else if (dim.indexOf("px") >= 0) {
dim = parseFloat(dim);
if (dim <= 60) {
dim = dim / parseFloat($el.parent().css("width"));
}
} else if (dim.indexOf("%") >= 0) {
dim = parseFloat(dim) / 100;
}
return dim;
};
$.fn.bindScrollHandler = function() {
if (!settings.preventPageScroll) {
return $(this);
}
$(this).on("DOMMouseScroll mousewheel", function(event) {
var $popover, $this, delta, height, prevent, scrollHeight, scrollTop, up;
$this = $(this);
scrollTop = $this.scrollTop();
scrollHeight = $this[0].scrollHeight;
height = parseInt($this.css("height"));
$popover = $this.closest(".bigfoot-footnote");
if ($this.scrollTop() > 0 && $this.scrollTop() < 10) {
$popover.addClass("is-scrollable");
}
if (!$popover.hasClass("is-scrollable")) {
return;
}
delta = event.type === "DOMMouseScroll" ? event.originalEvent.detail * -40 : event.originalEvent.wheelDelta;
up = delta > 0;
prevent = function() {
event.stopPropagation();
event.preventDefault();
event.returnValue = false;
return false;
};
if (!up && -delta > scrollHeight - height - scrollTop) {
$this.scrollTop(scrollHeight);
$popover.addClass("is-fully-scrolled");
return prevent();
} else if (up && delta > scrollTop) {
$this.scrollTop(0);
$popover.removeClass("is-fully-scrolled");
return prevent();
} else {
return $popover.removeClass("is-fully-scrolled");
}
});
return $(this);
};
unhoverFeet = function(e) {
if (settings.deleteOnUnhover && settings.activateOnHover) {
return setTimeout((function() {
var $target;
$target = $(e.target).closest(".bigfoot-footnote, .bigfoot-footnote__button");
if ($(".bigfoot-footnote__button:hover, .bigfoot-footnote:hover").length < 1) {
return removePopovers();
}
}), settings.hoverDelay);
}
};
escapeKeypress = function(event) {
if (event.keyCode === 27) {
return removePopovers();
}
};
removePopovers = function(footnotes, timeout) {
var $buttonsClosed, $linkedButton, $this, footnoteID;
if (footnotes == null) {
footnotes = ".bigfoot-footnote";
}
if (timeout == null) {
timeout = settings.popoverDeleteDelay;
}
$buttonsClosed = $();
footnoteID = void 0;
$linkedButton = void 0;
$this = void 0;
$(footnotes).each(function() {
$this = $(this);
footnoteID = $this.attr("data-footnote-identifier");
$linkedButton = $(".bigfoot-footnote__button[data-footnote-identifier=\"" + footnoteID + "\"]");
if (!$linkedButton.hasClass("changing")) {
$buttonsClosed = $buttonsClosed.add($linkedButton);
$linkedButton.removeClass("is-active is-hover-instantiated is-click-instantiated").addClass("changing");
$this.removeClass("is-active").addClass("disapearing");
return setTimeout((function() {
$this.remove();
delete popoverStates[footnoteID];
return $linkedButton.removeClass("changing");
}), timeout);
}
});
return $buttonsClosed;
};
repositionFeet = function(e) {
var type;
if (settings.positionContent) {
type = e ? e.type : "resize";
$(".bigfoot-footnote").each(function() {
var $button, $contentWrapper, $mainWrap, $this, dataIdentifier, identifier, lastState, marginSize, maxHeightInCSS, maxHeightOnScreen, maxWidth, maxWidthInCSS, positionOnTop, relativeToWidth, roomLeft, totalHeight;
$this = $(this);
identifier = $this.attr("data-footnote-identifier");
dataIdentifier = "data-footnote-identifier=\"" + identifier + "\"";
$contentWrapper = $this.find(".bigfoot-footnote__content");
$button = $this.siblings(".bigfoot-footnote__button");
roomLeft = roomCalc($button);
marginSize = parseFloat($this.css("margin-top"));
maxHeightInCSS = +($this.attr("data-bigfoot-max-height"));
totalHeight = 2 * marginSize + $this.outerHeight();
maxHeightOnScreen = 10000;
positionOnTop = roomLeft.bottomRoom < totalHeight && roomLeft.topRoom > roomLeft.bottomRoom;
lastState = popoverStates[identifier];
if (positionOnTop) {
if (lastState !== "top") {
popoverStates[identifier] = "top";
$this.addClass("is-positioned-top").removeClass("is-positioned-bottom");
$this.css("transform-origin", (roomLeft.leftRelative * 100) + "% 100%");
}
maxHeightOnScreen = roomLeft.topRoom - marginSize - 15;
} else {
if (lastState !== "bottom" || lastState === "init") {
popoverStates[identifier] = "bottom";
$this.removeClass("is-positioned-top").addClass("is-positioned-bottom");
$this.css("transform-origin", (roomLeft.leftRelative * 100) + "% 0%");
}
maxHeightOnScreen = roomLeft.bottomRoom - marginSize - 15;
}
$this.find(".bigfoot-footnote__content").css({
"max-height": Math.min(maxHeightOnScreen, maxHeightInCSS) + "px"
});
if (type === "resize") {
maxWidthInCSS = parseFloat($this.attr("bigfoot-max-width"));
$mainWrap = $this.find(".bigfoot-footnote__wrapper");
maxWidth = maxWidthInCSS;
if (maxWidthInCSS <= 1) {
relativeToWidth = (function() {
var jq, userSpecifiedRelativeElWidth;
userSpecifiedRelativeElWidth = 10000;
if (settings.maxWidthRelativeTo) {
jq = $(settings.maxWidthRelativeTo);
if (jq.length > 0) {
userSpecifiedRelativeElWidth = jq.outerWidth();
}
}
return Math.min(window.innerWidth, userSpecifiedRelativeElWidth);
})();
maxWidth = relativeToWidth * maxWidthInCSS;
}
maxWidth = Math.min(maxWidth, $this.find(".bigfoot-footnote__content").outerWidth() + 1);
$mainWrap.css("max-width", maxWidth + "px");
$this.css({
left: (-roomLeft.leftRelative * maxWidth + parseFloat($button.css("margin-left")) + $button.outerWidth() / 2) + "px"
});
positionTooltip($this, roomLeft.leftRelative);
}
if (parseInt($this.outerHeight()) < $this.find(".bigfoot-footnote__content")[0].scrollHeight) {
return $this.addClass("is-scrollable");
}
});
}
};
positionTooltip = function($popover, leftRelative) {
var $tooltip;
if (leftRelative == null) {
leftRelative = 0.5;
}
$tooltip = $popover.find(".bigfoot-footnote__tooltip");
if ($tooltip.length > 0) {
$tooltip.css("left", "" + (leftRelative * 100) + "%");
}
};
roomCalc = function($el) {
var elHeight, elLeftMargin, elWidth, leftRoom, topRoom, w;
elLeftMargin = parseFloat($el.css("margin-left"));
elWidth = parseFloat($el.outerWidth()) - elLeftMargin;
elHeight = parseFloat($el.outerHeight());
w = viewportDetails();
topRoom = $el.offset().top - w.scrollY + elHeight / 2;
leftRoom = $el.offset().left - w.scrollX + elWidth / 2;
return {
topRoom: topRoom,
bottomRoom: w.height - topRoom,
leftRoom: leftRoom,
rightRoom: w.width - leftRoom,
leftRelative: leftRoom / w.width,
topRelative: topRoom / w.height
};
};
viewportDetails = function() {
var $window;
$window = $(window);
return {
width: window.innerWidth,
height: window.innerHeight,
scrollX: $window.scrollLeft(),
scrollY: $window.scrollTop()
};
};
addBreakpoint = function(size, trueCallback, falseCallback, deleteDelay, removeOpen) {
var falseDefaultPositionSetting, minMax, mqListener, mql, query, s, trueDefaultPositionSetting;
if (deleteDelay == null) {
deleteDelay = settings.popoverDeleteDelay;
}
if (removeOpen == null) {
removeOpen = true;
}
mql = void 0;
minMax = void 0;
s = void 0;
if (typeof size === "string") {
s = size.toLowerCase() === "iphone" ? "<320px" : size.toLowerCase() === "ipad" ? "<768px" : size;
minMax = s.charAt(0) === ">" ? "min" : s.charAt(0) === "<" ? "max" : null;
query = minMax ? "(" + minMax + "-width: " + (s.substring(1)) + ")" : s;
mql = window.matchMedia(query);
} else {
mql = size;
}
if (mql.media && mql.media === "invalid") {
return {
added: false,
mq: mql,
listener: null
};
}
trueDefaultPositionSetting = minMax === "min";
falseDefaultPositionSetting = minMax === "max";
trueCallback = trueCallback || makeDefaultCallbacks(removeOpen, deleteDelay, trueDefaultPositionSetting, function($popover) {
return $popover.addClass("is-bottom-fixed");
});
falseCallback = falseCallback || makeDefaultCallbacks(removeOpen, deleteDelay, falseDefaultPositionSetting, function() {});
mqListener = function(mq) {
if (mq.matches) {
trueCallback(removeOpen, bigfoot);
} else {
falseCallback(removeOpen, bigfoot);
}
};
mql.addListener(mqListener);
mqListener(mql);
settings.breakpoints[size] = {
added: true,
mq: mql,
listener: mqListener
};
return settings.breakpoints[size];
};
makeDefaultCallbacks = function(removeOpen, deleteDelay, position, callback) {
return function(removeOpen, bigfoot) {
var $closedPopovers;
$closedPopovers = void 0;
if (removeOpen) {
$closedPopovers = bigfoot.close();
bigfoot.updateSetting("activateCallback", callback);
}
return setTimeout((function() {
bigfoot.updateSetting("positionContent", position);
if (removeOpen) {
return bigfoot.activate($closedPopovers);
}
}), deleteDelay);
};
};
removeBreakpoint = function(target, callback) {
var b, breakpoint, mq, mqFound;
mq = null;
b = void 0;
mqFound = false;
if (typeof target === "string") {
mqFound = settings.breakpoints[target] !== undefined;
} else {
for (b in settings.breakpoints) {
if (settings.breakpoints.hasOwnProperty(b) && settings.breakpoints[b].mq === target) {
mqFound = true;
}
}
}
if (mqFound) {
breakpoint = settings.breakpoints[b || target];
if (callback) {
callback({
matches: false
});
} else {
breakpoint.listener({
matches: false
});
}
breakpoint.mq.removeListener(breakpoint.listener);
delete settings.breakpoints[b || target];
}
return mqFound;
};
updateSetting = function(newSettings, value) {
var oldValue, prop;
oldValue = void 0;
if (typeof newSettings === "string") {
oldValue = settings[newSettings];
settings[newSettings] = value;
} else {
oldValue = {};
for (prop in newSettings) {
if (newSettings.hasOwnProperty(prop)) {
oldValue[prop] = settings[prop];
settings[prop] = newSettings[prop];
}
}
}
return oldValue;
};
getSetting = function(setting) {
return settings[setting];
};
$(document).ready(function() {
footnoteInit();
$(document).on("mouseenter", ".bigfoot-footnote__button", buttonHover);
$(document).on("touchend click", touchClick);
$(document).on("mouseout", ".is-hover-instantiated", unhoverFeet);
$(document).on("keyup", escapeKeypress);
$(window).on("scroll resize", repositionFeet);
return $(document).on("gestureend", function() {
return repositionFeet();
});
});
bigfoot = {
removePopovers: removePopovers,
close: removePopovers,
createPopover: createPopover,
activate: createPopover,
repositionFeet: repositionFeet,
reposition: repositionFeet,
addBreakpoint: addBreakpoint,
removeBreakpoint: removeBreakpoint,
getSetting: getSetting,
updateSetting: updateSetting
};
return bigfoot;
};
})(jQuery);
}).call(this);
</script>
<script type="text/javascript">
$.bigfoot();
</script>

View file

@ -1,6 +1,6 @@
# Inweb 7
v7-alpha.1+1A16 'Escape to Danger' (10 April 2020)
v7-alpha.1+1A17 'Escape to Danger' (11 April 2020)
## About Inweb

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,3 @@
Prerelease: alpha.1
Build Date: 10 April 2020
Build Number: 1A16
Build Date: 11 April 2020
Build Number: 1A17

View file

@ -111,6 +111,9 @@ convenient to store them directly here than to use a dictionary.
<span class="identifier">bd</span><span class="plain"> = </span><span class="functiontext">Bibliographic::set_datum</span><span class="plain">(</span><span class="identifier">Wm</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Strict Usage Rules"</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Off"</span><span class="plain">); </span><span class="identifier">bd</span><span class="plain">-&gt;</span><span class="element">on_or_off</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
<span class="identifier">bd</span><span class="plain"> = </span><span class="functiontext">Bibliographic::set_datum</span><span class="plain">(</span><span class="identifier">Wm</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"TeX Mathematics Notation"</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"On"</span><span class="plain">); </span><span class="identifier">bd</span><span class="plain">-&gt;</span><span class="element">on_or_off</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
<span class="identifier">bd</span><span class="plain"> = </span><span class="functiontext">Bibliographic::set_datum</span><span class="plain">(</span><span class="identifier">Wm</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"TeX Mathematics Plugin"</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"MathJax3"</span><span class="plain">);</span>
<span class="identifier">bd</span><span class="plain"> = </span><span class="functiontext">Bibliographic::set_datum</span><span class="plain">(</span><span class="identifier">Wm</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Footnote Begins Notation"</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"["</span><span class="plain">);</span>
<span class="identifier">bd</span><span class="plain"> = </span><span class="functiontext">Bibliographic::set_datum</span><span class="plain">(</span><span class="identifier">Wm</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Footnote Ends Notation"</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"]"</span><span class="plain">);</span>
<span class="identifier">bd</span><span class="plain"> = </span><span class="functiontext">Bibliographic::set_datum</span><span class="plain">(</span><span class="identifier">Wm</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Footnotes Plugin"</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Bigfoot"</span><span class="plain">);</span>
<span class="identifier">bd</span><span class="plain"> = </span><span class="functiontext">Bibliographic::set_datum</span><span class="plain">(</span><span class="identifier">Wm</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Code In Commentary Notation"</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"|"</span><span class="plain">);</span>
<span class="identifier">bd</span><span class="plain"> = </span><span class="functiontext">Bibliographic::set_datum</span><span class="plain">(</span><span class="identifier">Wm</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Code In Code Comments Notation"</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"|"</span><span class="plain">);</span>
<span class="identifier">bd</span><span class="plain"> = </span><span class="functiontext">Bibliographic::set_datum</span><span class="plain">(</span><span class="identifier">Wm</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Cross-References Notation"</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"//"</span><span class="plain">);</span>

View file

@ -518,7 +518,7 @@ source:
<p class="inwebparagraph"></p>
<p class="endnote">The function Main::error_in_web is used in 1/cnf (<a href="1-cnf.html#SP5">&#167;5</a>), 2/tp (<a href="2-tp.html#SP1_1_6_3">&#167;1.1.6.3</a>, <a href="2-tp.html#SP1_1_6_4">&#167;1.1.6.4</a>, <a href="2-tp.html#SP1_1_6_7">&#167;1.1.6.7</a>, <a href="2-tp.html#SP1_1_6_7_1">&#167;1.1.6.7.1</a>, <a href="2-tp.html#SP1_1_6_5_1">&#167;1.1.6.5.1</a>, <a href="2-tp.html#SP1_1_6_5_1_1">&#167;1.1.6.5.1.1</a>, <a href="2-tp.html#SP1_1_6_5_1_2">&#167;1.1.6.5.1.2</a>, <a href="2-tp.html#SP1_1_6_5_1_3">&#167;1.1.6.5.1.3</a>, <a href="2-tp.html#SP1_1_6_5_1_4">&#167;1.1.6.5.1.4</a>, <a href="2-tp.html#SP1_1_6_5_1_7">&#167;1.1.6.5.1.7</a>, <a href="2-tp.html#SP3">&#167;3</a>), 2/ec (<a href="2-ec.html#SP3_1">&#167;3.1</a>, <a href="2-ec.html#SP3_2">&#167;3.2</a>, <a href="2-ec.html#SP3_3">&#167;3.3</a>), 3/ta (<a href="3-ta.html#SP4_1">&#167;4.1</a>), 3/tt (<a href="3-tt.html#SP1_1_1_1">&#167;1.1.1.1</a>, <a href="3-tt.html#SP3_1">&#167;3.1</a>), 4/saf (<a href="4-saf.html#SP7_3">&#167;7.3</a>), 4/lm (<a href="4-lm.html#SP8">&#167;8</a>), 4/cl (<a href="4-cl.html#SP2">&#167;2</a>, <a href="4-cl.html#SP2_1">&#167;2.1</a>, <a href="4-cl.html#SP2_4_2_1">&#167;2.4.2.1</a>, <a href="4-cl.html#SP8">&#167;8</a>), 5/fm (<a href="5-fm.html#SP25">&#167;25</a>), 5/hf (<a href="5-hf.html#SP17">&#167;17</a>), 5/wp (<a href="5-wp.html#SP2">&#167;2</a>).</p>
<p class="endnote">The function Main::error_in_web is used in 1/cnf (<a href="1-cnf.html#SP5">&#167;5</a>), 2/tp (<a href="2-tp.html#SP1_1_6_3">&#167;1.1.6.3</a>, <a href="2-tp.html#SP1_1_6_4">&#167;1.1.6.4</a>, <a href="2-tp.html#SP1_1_6_7">&#167;1.1.6.7</a>, <a href="2-tp.html#SP1_1_6_7_1">&#167;1.1.6.7.1</a>, <a href="2-tp.html#SP1_1_6_5_1">&#167;1.1.6.5.1</a>, <a href="2-tp.html#SP1_1_6_5_1_1">&#167;1.1.6.5.1.1</a>, <a href="2-tp.html#SP1_1_6_5_1_2">&#167;1.1.6.5.1.2</a>, <a href="2-tp.html#SP1_1_6_5_1_3">&#167;1.1.6.5.1.3</a>, <a href="2-tp.html#SP1_1_6_5_1_4">&#167;1.1.6.5.1.4</a>, <a href="2-tp.html#SP1_1_6_5_1_7">&#167;1.1.6.5.1.7</a>, <a href="2-tp.html#SP3">&#167;3</a>), 2/ec (<a href="2-ec.html#SP3_1">&#167;3.1</a>, <a href="2-ec.html#SP3_2">&#167;3.2</a>, <a href="2-ec.html#SP3_3">&#167;3.3</a>), 3/ta (<a href="3-ta.html#SP4_1">&#167;4.1</a>), 3/tw (<a href="3-tw.html#SP1_3_4_1_8_5">&#167;1.3.4.1.8.5</a>), 3/tt (<a href="3-tt.html#SP1_1_1_1">&#167;1.1.1.1</a>, <a href="3-tt.html#SP3_1">&#167;3.1</a>), 4/saf (<a href="4-saf.html#SP7_3">&#167;7.3</a>), 4/lm (<a href="4-lm.html#SP8">&#167;8</a>), 4/cl (<a href="4-cl.html#SP2">&#167;2</a>, <a href="4-cl.html#SP2_1">&#167;2.1</a>, <a href="4-cl.html#SP2_4_2_1">&#167;2.4.2.1</a>, <a href="4-cl.html#SP8">&#167;8</a>), 5/fm (<a href="5-fm.html#SP28">&#167;28</a>), 5/hf (<a href="5-hf.html#SP20">&#167;20</a>), 5/wp (<a href="5-wp.html#SP2">&#167;2</a>).</p>
<hr class="tocbar">
<ul class="toc"><li><a href="1-bsc.html">Back to 'Basics'</a></li><li><a href="1-cnf.html">Continue with 'Configuration'</a></li></ul><hr class="tocbar">

View file

@ -332,7 +332,7 @@ from each other then this routine will lock up into an infinite loop.
<p class="inwebparagraph"></p>
<p class="endnote">The function Patterns::obtain_filename is used in <a href="#SP6">&#167;6</a>, 3/ts (<a href="3-ts.html#SP4">&#167;4</a>), 3/ti (<a href="3-ti.html#SP1">&#167;1</a>, <a href="3-ti.html#SP2">&#167;2</a>, <a href="3-ti.html#SP2_1_3">&#167;2.1.3</a>, <a href="3-ti.html#SP5_1">&#167;5.1</a>), 5/tf (<a href="5-tf.html#SP3_1">&#167;3.1</a>), 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP9">&#167;9</a>, <a href="5-hf.html#SP29">&#167;29</a>).</p>
<p class="endnote">The function Patterns::obtain_filename is used in <a href="#SP6">&#167;6</a>, 3/ts (<a href="3-ts.html#SP4">&#167;4</a>), 3/ti (<a href="3-ti.html#SP1">&#167;1</a>, <a href="3-ti.html#SP2">&#167;2</a>, <a href="3-ti.html#SP2_1_3">&#167;2.1.3</a>, <a href="3-ti.html#SP5_1">&#167;5.1</a>), 5/tf (<a href="5-tf.html#SP3_1">&#167;3.1</a>), 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP9">&#167;9</a>, <a href="5-hf.html#SP32">&#167;32</a>).</p>
<p class="inwebparagraph"><a id="SP6"></a><b>&#167;6. </b>When we eventually want to deal with the <code class="display"><span class="extract">use P</span></code> commands, which call
for payloads to be copied into weave, we make good use of the above:
@ -382,7 +382,7 @@ for payloads to be copied into weave, we make good use of the above:
<p class="inwebparagraph"></p>
<p class="endnote">The function Patterns::copy_file_into_weave is used in <a href="#SP6">&#167;6</a>, 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP9">&#167;9</a>, <a href="5-hf.html#SP16">&#167;16</a>).</p>
<p class="endnote">The function Patterns::copy_file_into_weave is used in <a href="#SP6">&#167;6</a>, 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP9">&#167;9</a>, <a href="5-hf.html#SP19">&#167;19</a>), 5/wp (<a href="5-wp.html#SP2">&#167;2</a>).</p>
<p class="endnote">The function Patterns::copy_up_file_into_weave is used in <a href="#SP6">&#167;6</a>, 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP9">&#167;9</a>).</p>

View file

@ -85,7 +85,7 @@ much faster.
<p class="inwebparagraph"></p>
<p class="endnote">The function Macros::find_by_name is used in 2/pn (<a href="2-pn.html#SP1_1">&#167;1.1</a>), 3/tw (<a href="3-tw.html#SP1_3_3_1_9_6">&#167;1.3.3.1.9.6</a>), 3/tt (<a href="3-tt.html#SP3_1">&#167;3.1</a>).</p>
<p class="endnote">The function Macros::find_by_name is used in 2/pn (<a href="2-pn.html#SP1_1">&#167;1.1</a>), 3/tw (<a href="3-tw.html#SP1_3_4_1_9_6">&#167;1.3.4.1.9.6</a>), 3/tt (<a href="3-tt.html#SP3_1">&#167;3.1</a>).</p>
<hr class="tocbar">
<ul class="toc"><li><a href="2-tp.html">Back to 'The Parser'</a></li><li><a href="2-tgs.html">Continue with 'Tags'</a></li></ul><hr class="tocbar">

View file

@ -153,7 +153,7 @@ the tag is <code class="display"><span class="extract">History</span></code>, th
<p class="inwebparagraph"></p>
<p class="endnote">The function Tags::retrieve_caption is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_10_3_1">&#167;1.3.3.1.10.3.1</a>).</p>
<p class="endnote">The function Tags::retrieve_caption is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_10_3_1">&#167;1.3.4.1.10.3.1</a>).</p>
<p class="inwebparagraph"><a id="SP6"></a><b>&#167;6. </b>Finally, this tests whether a given paragraph falls under a given tag.
(Everything falls under the null non-tag: this ensures that a weave which
@ -175,7 +175,7 @@ doesn't specify a tag.)
<p class="inwebparagraph"></p>
<p class="endnote">The function Tags::tagged_with is used in 3/tw (<a href="3-tw.html#SP1_3_3">&#167;1.3.3</a>).</p>
<p class="endnote">The function Tags::tagged_with is used in 3/tw (<a href="3-tw.html#SP1_3_4">&#167;1.3.4</a>).</p>
<p class="inwebparagraph"><a id="SP7"></a><b>&#167;7. </b></p>

View file

@ -27,7 +27,7 @@
<!--Weave of 'The Parser' generated by 7-->
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="index.html">inweb</a></li><li><a href="index.html#2">Chapter 2: Parsing a Web</a></li><li><b>The Parser</b></li></ul><p class="purpose">To work through the program read in, assigning each line its category, and noting down other useful information as we go.</p>
<ul class="toc"><li><a href="#SP1">&#167;1. Sequence of parsing</a></li><li><a href="#SP1_1_6">&#167;1.1.6. Categorisatiom</a></li><li><a href="#SP3">&#167;3. Version errors</a></li></ul><hr class="tocbar">
<ul class="toc"><li><a href="#SP1">&#167;1. Sequence of parsing</a></li><li><a href="#SP1_1_6">&#167;1.1.6. Categorisatiom</a></li><li><a href="#SP3">&#167;3. Version errors</a></li><li><a href="#SP4">&#167;4. Footnote notation</a></li></ul><hr class="tocbar">
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. Sequence of parsing. </b>At this point, thw web has been read into memory. It's a linked list of
chapters, each of which is a linked list of sections, each of which must
@ -1246,7 +1246,58 @@ when it comes to Inweb's exit code, so they will halt a make.
<p class="inwebparagraph"></p>
<p class="endnote">The function Parser::wrong_version is used in <a href="#SP1_1_1">&#167;1.1.1</a>, <a href="#SP1_1_5">&#167;1.1.5</a>, <a href="#SP1_1_6">&#167;1.1.6</a>, <a href="#SP1_1_6_3">&#167;1.1.6.3</a>, <a href="#SP1_1_6_5_1">&#167;1.1.6.5.1</a>, <a href="#SP1_1_6_5_1_1">&#167;1.1.6.5.1.1</a>, <a href="#SP1_1_6_5_1_2">&#167;1.1.6.5.1.2</a>, <a href="#SP1_1_6_5_1_3">&#167;1.1.6.5.1.3</a>, <a href="#SP1_1_6_5_1_4">&#167;1.1.6.5.1.4</a>, <a href="#SP1_1_6_5_1_5">&#167;1.1.6.5.1.5</a>, 3/tw (<a href="3-tw.html#SP1_3_3_1_2_1">&#167;1.3.3.1.2.1</a>).</p>
<p class="endnote">The function Parser::wrong_version is used in <a href="#SP1_1_1">&#167;1.1.1</a>, <a href="#SP1_1_5">&#167;1.1.5</a>, <a href="#SP1_1_6">&#167;1.1.6</a>, <a href="#SP1_1_6_3">&#167;1.1.6.3</a>, <a href="#SP1_1_6_5_1">&#167;1.1.6.5.1</a>, <a href="#SP1_1_6_5_1_1">&#167;1.1.6.5.1.1</a>, <a href="#SP1_1_6_5_1_2">&#167;1.1.6.5.1.2</a>, <a href="#SP1_1_6_5_1_3">&#167;1.1.6.5.1.3</a>, <a href="#SP1_1_6_5_1_4">&#167;1.1.6.5.1.4</a>, <a href="#SP1_1_6_5_1_5">&#167;1.1.6.5.1.5</a>, 3/tw (<a href="3-tw.html#SP1_3_4_1_2_1">&#167;1.3.4.1.2.1</a>).</p>
<p class="inwebparagraph"><a id="SP4"></a><b>&#167;4. Footnote notation. </b></p>
<pre class="display">
<span class="reserved">int</span><span class="plain"> </span><span class="functiontext">Parser::detect_footnote</span><span class="plain">(</span><span class="reserved">web</span><span class="plain"> *</span><span class="identifier">W</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">matter</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">before</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">cue</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">after</span><span class="plain">) {</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">fn_on_notation</span><span class="plain"> =</span>
<span class="functiontext">Bibliographic::get_datum</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">-&gt;</span><span class="element">md</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Footnote Begins Notation"</span><span class="plain">);</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">fn_off_notation</span><span class="plain"> =</span>
<span class="functiontext">Bibliographic::get_datum</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">-&gt;</span><span class="element">md</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Footnote Ends Notation"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::ne</span><span class="plain">(</span><span class="identifier">fn_on_notation</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Off"</span><span class="plain">)) {</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">N1</span><span class="plain"> = </span><span class="functiontext">Str::len</span><span class="plain">(</span><span class="identifier">fn_on_notation</span><span class="plain">);</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">N2</span><span class="plain"> = </span><span class="functiontext">Str::len</span><span class="plain">(</span><span class="identifier">fn_off_notation</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">N1</span><span class="plain"> &gt; </span><span class="constant">0</span><span class="plain">) &amp;&amp; (</span><span class="identifier">N2</span><span class="plain"> &gt; </span><span class="constant">0</span><span class="plain">))</span>
<span class="reserved">for</span><span class="plain"> (</span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">i</span><span class="plain">=0; </span><span class="identifier">i</span><span class="plain"> &lt; </span><span class="functiontext">Str::len</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">); </span><span class="identifier">i</span><span class="plain">++) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::includes_at</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">i</span><span class="plain">, </span><span class="identifier">fn_on_notation</span><span class="plain">)) {</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">j</span><span class="plain"> = </span><span class="identifier">i</span><span class="plain"> + </span><span class="identifier">N1</span><span class="plain"> + </span><span class="constant">1</span><span class="plain">;</span>
<span class="reserved">while</span><span class="plain"> (</span><span class="identifier">j</span><span class="plain"> &lt; </span><span class="functiontext">Str::len</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">)) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::includes_at</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">j</span><span class="plain">, </span><span class="identifier">fn_off_notation</span><span class="plain">)) {</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">b</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">c</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">a</span><span class="plain">);</span>
<span class="functiontext">Str::substr</span><span class="plain">(</span><span class="identifier">b</span><span class="plain">, </span><span class="functiontext">Str::start</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">), </span><span class="functiontext">Str::at</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">i</span><span class="plain">));</span>
<span class="functiontext">Str::substr</span><span class="plain">(</span><span class="identifier">c</span><span class="plain">, </span><span class="functiontext">Str::at</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">i</span><span class="plain"> + </span><span class="identifier">N1</span><span class="plain">), </span><span class="functiontext">Str::at</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">j</span><span class="plain">));</span>
<span class="functiontext">Str::substr</span><span class="plain">(</span><span class="identifier">a</span><span class="plain">, </span><span class="functiontext">Str::at</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">j</span><span class="plain"> + </span><span class="identifier">N2</span><span class="plain">), </span><span class="functiontext">Str::end</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">));</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">allow</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
<span class="identifier">LOOP_THROUGH_TEXT</span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">, </span><span class="identifier">c</span><span class="plain">)</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Characters::isdigit</span><span class="plain">(</span><span class="functiontext">Str::get</span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">)) == </span><span class="constant">FALSE</span><span class="plain">)</span>
<span class="identifier">allow</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">allow</span><span class="plain">) {</span>
<span class="functiontext">Str::clear</span><span class="plain">(</span><span class="identifier">before</span><span class="plain">); </span><span class="functiontext">Str::copy</span><span class="plain">(</span><span class="identifier">before</span><span class="plain">, </span><span class="identifier">b</span><span class="plain">);</span>
<span class="functiontext">Str::clear</span><span class="plain">(</span><span class="identifier">cue</span><span class="plain">); </span><span class="functiontext">Str::copy</span><span class="plain">(</span><span class="identifier">cue</span><span class="plain">, </span><span class="identifier">c</span><span class="plain">);</span>
<span class="functiontext">Str::clear</span><span class="plain">(</span><span class="identifier">after</span><span class="plain">); </span><span class="functiontext">Str::copy</span><span class="plain">(</span><span class="identifier">after</span><span class="plain">, </span><span class="identifier">a</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">b</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">c</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">a</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">allow</span><span class="plain">) </span><span class="reserved">return</span><span class="plain"> </span><span class="constant">TRUE</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="identifier">j</span><span class="plain">++;</span>
<span class="plain">}</span>
<span class="plain">}</span>
<span class="plain">}</span>
<span class="plain">}</span>
<span class="reserved">return</span><span class="plain"> </span><span class="constant">FALSE</span><span class="plain">;</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The function Parser::detect_footnote is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_8_5">&#167;1.3.4.1.8.5</a>), 5/fm (<a href="5-fm.html#SP27_3">&#167;27.3</a>).</p>
<hr class="tocbar">
<ul class="toc"><li><a href="2-lc.html">Back to 'Line Categories'</a></li><li><a href="2-pm.html">Continue with 'Paragraph Macros'</a></li></ul><hr class="tocbar">

View file

@ -460,7 +460,7 @@ tangled for.
<p class="inwebparagraph"></p>
<p class="endnote">The function Reader::woven_folder is used in 1/ptt (<a href="1-ptt.html#SP7">&#167;7</a>), 3/ts (<a href="3-ts.html#SP2_2">&#167;2.2</a>), 3/ti (<a href="3-ti.html#SP5_4">&#167;5.4</a>), 5/hf (<a href="5-hf.html#SP29">&#167;29</a>).</p>
<p class="endnote">The function Reader::woven_folder is used in 1/ptt (<a href="1-ptt.html#SP7">&#167;7</a>), 3/ts (<a href="3-ts.html#SP2_2">&#167;2.2</a>), 3/ti (<a href="3-ti.html#SP5_4">&#167;5.4</a>), 5/hf (<a href="5-hf.html#SP32">&#167;32</a>).</p>
<p class="endnote">The function Reader::tangled_folder is used in 1/pc (<a href="1-pc.html#SP7_4_2">&#167;7.4.2</a>), 3/tt (<a href="3-tt.html#SP1_2">&#167;1.2</a>), 4/is (<a href="4-is.html#SP13">&#167;13</a>).</p>
@ -624,7 +624,7 @@ get around the lack of some POSIX facilities on Windows.)
<p class="inwebparagraph"></p>
<p class="endnote">The function Reader::web_has_one_section is used in 3/ts (<a href="3-ts.html#SP2_2">&#167;2.2</a>), 3/tw (<a href="3-tw.html#SP1">&#167;1</a>, <a href="3-tw.html#SP1_3_3_1_10_4">&#167;1.3.3.1.10.4</a>).</p>
<p class="endnote">The function Reader::web_has_one_section is used in 3/ts (<a href="3-ts.html#SP2_2">&#167;2.2</a>), 3/tw (<a href="3-tw.html#SP1">&#167;1</a>, <a href="3-tw.html#SP1_3_4_1_10_4">&#167;1.3.4.1.10.4</a>).</p>
<p class="inwebparagraph"><a id="SP16"></a><b>&#167;16. </b>This really serves no purpose, but seems to boost morale.
</p>

View file

@ -52,7 +52,7 @@ to call the fuller indexing service if need be, using <code class="display"><spa
<p class="inwebparagraph"></p>
<p class="endnote">The function Indexer::cover_sheet_maker is used in <a href="#SP2_1_1">&#167;2.1.1</a>, 3/tw (<a href="3-tw.html#SP1_2">&#167;1.2</a>, <a href="3-tw.html#SP1_4">&#167;1.4</a>), 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP27">&#167;27</a>).</p>
<p class="endnote">The function Indexer::cover_sheet_maker is used in <a href="#SP2_1_1">&#167;2.1.1</a>, 3/tw (<a href="3-tw.html#SP1_2">&#167;1.2</a>, <a href="3-tw.html#SP1_4">&#167;1.4</a>), 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP30">&#167;30</a>).</p>
<p class="inwebparagraph"><a id="SP1_1"></a><b>&#167;1.1. </b>The cover-sheet-maker has the ability to weave only the top half, or only
the bottom half, of the template; they are divided by the marker <code class="display"><span class="extract">[[Code]]</span></code>.
@ -278,7 +278,7 @@ being accessed directly.
<pre class="definitions">
<span class="definitionkeyword">define</span> <span class="constant">MAX_TEMPLATE_LINES</span><span class="plain"> </span><span class="constant">256</span><span class="plain"> </span><span class="comment"> maximum number of lines in template</span>
<span class="definitionkeyword">define</span> <span class="constant">MAX_TEMPLATE_LINES</span><span class="plain"> </span><span class="constant">8192</span><span class="plain"> </span><span class="comment"> maximum number of lines in template</span>
<span class="definitionkeyword">define</span> <span class="constant">CI_STACK_CAPACITY</span><span class="plain"> </span><span class="constant">8</span><span class="plain"> </span><span class="comment"> maximum recursion of chapter/section iteration</span>
</pre>
@ -359,7 +359,7 @@ being accessed directly.
<p class="inwebparagraph"></p>
<p class="endnote">The function Indexer::run is used in <a href="#SP2_1_3">&#167;2.1.3</a>, <a href="#SP3">&#167;3</a>, 3/ts (<a href="3-ts.html#SP4">&#167;4</a>), 5/hf (<a href="5-hf.html#SP17">&#167;17</a>), 5/wp (<a href="5-wp.html#SP2">&#167;2</a>).</p>
<p class="endnote">The function Indexer::run is used in <a href="#SP2_1_3">&#167;2.1.3</a>, <a href="#SP3">&#167;3</a>, 3/ts (<a href="3-ts.html#SP4">&#167;4</a>), 5/hf (<a href="5-hf.html#SP20">&#167;20</a>), 5/wp (<a href="5-wp.html#SP2">&#167;2</a>).</p>
<p class="inwebparagraph"><a id="SP5_1"></a><b>&#167;5.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Make any necessary substitutions to turn tl into final output</span> <span class="cwebmacronumber">5.1</span>&gt; =

View file

@ -121,6 +121,12 @@ the call comes from Program Control).
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">linked_list</span><span class="plain"> *</span><span class="identifier">breadcrumbs</span><span class="plain">; </span><span class="comment"> non-standard breadcrumb trail, if any</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">navigation</span><span class="plain">; </span><span class="comment"> navigation links, or <code class="display"><span class="extract">NULL</span></code> if not supplied</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">linked_list</span><span class="plain"> *</span><span class="identifier">plugins</span><span class="plain">; </span><span class="comment"> of <code class="display"><span class="extract">weave_plugin</span></code>: these are for HTML extensions</span>
<span class="comment"> used for workspace during an actual weave:</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">current_weave_line</span><span class="plain">;</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">linked_list</span><span class="plain"> *</span><span class="identifier">footnotes_cued</span><span class="plain">; </span><span class="comment"> of <code class="display"><span class="extract">text_stream</span></code></span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">linked_list</span><span class="plain"> *</span><span class="identifier">footnotes_written</span><span class="plain">; </span><span class="comment"> of <code class="display"><span class="extract">text_stream</span></code></span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">current_footnote</span><span class="plain">;</span>
<span class="constant">MEMORY_MANAGEMENT</span>
<span class="plain">} </span><span class="reserved">weave_target</span><span class="plain">;</span>
</pre>
@ -152,6 +158,11 @@ the call comes from Program Control).
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Reader::web_has_one_section</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">)) </span><span class="identifier">wt</span><span class="plain">-&gt;</span><span class="element">self_contained</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
<span class="functiontext">Str::copy</span><span class="plain">(</span><span class="identifier">wt</span><span class="plain">-&gt;</span><span class="element">cover_sheet_to_use</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"cover-sheet"</span><span class="plain">);</span>
<span class="identifier">wt</span><span class="plain">-&gt;</span><span class="element">current_weave_line</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">wt</span><span class="plain">-&gt;</span><span class="element">footnotes_cued</span><span class="plain"> = </span><span class="identifier">NEW_LINKED_LIST</span><span class="plain">(</span><span class="reserved">text_stream</span><span class="plain">);</span>
<span class="identifier">wt</span><span class="plain">-&gt;</span><span class="element">footnotes_written</span><span class="plain"> = </span><span class="identifier">NEW_LINKED_LIST</span><span class="plain">(</span><span class="reserved">text_stream</span><span class="plain">);</span>
<span class="identifier">wt</span><span class="plain">-&gt;</span><span class="element">current_footnote</span><span class="plain"> = </span><span class="functiontext">Str::new</span><span class="plain">();</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">has_content</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
<span class="reserved">chapter</span><span class="plain"> *</span><span class="identifier">C</span><span class="plain">;</span>
<span class="reserved">section</span><span class="plain"> *</span><span class="identifier">S</span><span class="plain">;</span>
@ -285,7 +296,7 @@ and details of any cover-sheet to use.
<p class="inwebparagraph"></p>
<p class="endnote">The function Swarm::ensure_plugin is used in 5/hf (<a href="5-hf.html#SP6">&#167;6</a>).</p>
<p class="endnote">The function Swarm::ensure_plugin is used in 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP13">&#167;13</a>, <a href="5-hf.html#SP14">&#167;14</a>, <a href="5-hf.html#SP15">&#167;15</a>).</p>
<p class="inwebparagraph"><a id="SP4"></a><b>&#167;4. </b>After every swarm, we rebuild the index. We first try for a template called
<code class="display"><span class="extract">chaptered-index.html</span></code> or <code class="display"><span class="extract">unchaptered-index.html</span></code>, then fall back on a

View file

@ -27,7 +27,7 @@
<!--Weave of 'The Weaver' generated by 7-->
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="index.html">inweb</a></li><li><a href="index.html#3">Chapter 3: Outputs</a></li><li><b>The Weaver</b></li></ul><p class="purpose">To weave a portion of the code into instructions for TeX.</p>
<ul class="toc"><li><a href="#SP1">&#167;1. The Master Weaver</a></li><li><a href="#SP1_3_1">&#167;1.3.1. The state</a></li><li><a href="#SP1_3_3">&#167;1.3.3. Weaving a section</a></li><li><a href="#SP1_3_3_1_1">&#167;1.3.3.1.1. Reasons to skip things</a></li><li><a href="#SP1_3_3_1_3">&#167;1.3.3.1.3. Headings</a></li><li><a href="#SP1_3_3_1_8">&#167;1.3.3.1.8. Commentary matter</a></li><li><a href="#SP1_3_3_1_9">&#167;1.3.3.1.9. Code-like matter</a></li><li><a href="#SP1_3_3_1_10">&#167;1.3.3.1.10. How paragraphs begin</a></li><li><a href="#SP1_3_3_2">&#167;1.3.3.2. How paragraphs end</a></li><li><a href="#SP2">&#167;2. Endnotes</a></li><li><a href="#SP3">&#167;3. Section tables of contents</a></li></ul><hr class="tocbar">
<ul class="toc"><li><a href="#SP1">&#167;1. The Master Weaver</a></li><li><a href="#SP1_3_1">&#167;1.3.1. The state</a></li><li><a href="#SP1_3_4">&#167;1.3.4. Weaving a section</a></li><li><a href="#SP1_3_4_1_1">&#167;1.3.4.1.1. Reasons to skip things</a></li><li><a href="#SP1_3_4_1_3">&#167;1.3.4.1.3. Headings</a></li><li><a href="#SP1_3_4_1_8">&#167;1.3.4.1.8. Commentary matter</a></li><li><a href="#SP1_3_4_1_9">&#167;1.3.4.1.9. Code-like matter</a></li><li><a href="#SP1_3_4_1_10">&#167;1.3.4.1.10. How paragraphs begin</a></li><li><a href="#SP1_3_4_2">&#167;1.3.4.2. How paragraphs end</a></li><li><a href="#SP2">&#167;2. Endnotes</a></li><li><a href="#SP3">&#167;3. Section tables of contents</a></li></ul><hr class="tocbar">
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. The Master Weaver. </b>Here's what has happened so far, on a weave run of Inweb: on any other
sort of run, of course, we would never be in this section of code. The web was
@ -40,8 +40,6 @@ where to put the result: and so we arrive at the front door of the routine
</p>
<pre class="display">
<span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">current_weave_line</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="functiontext">Weaver::weave_source</span><span class="plain">(</span><span class="reserved">web</span><span class="plain"> *</span><span class="identifier">W</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">) {</span>
<span class="reserved">text_stream</span><span class="plain"> </span><span class="identifier">TO_struct</span><span class="plain">;</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain"> = &amp;</span><span class="identifier">TO_struct</span><span class="plain">;</span>
@ -114,9 +112,10 @@ where to put the result: and so we arrive at the front door of the routine
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">S</span><span class="plain">, </span><span class="reserved">section</span><span class="plain">, </span><span class="identifier">C</span><span class="plain">-&gt;</span><span class="element">sections</span><span class="plain">)</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Reader::range_within</span><span class="plain">(</span><span class="identifier">S</span><span class="plain">-&gt;</span><span class="element">sect_range</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">weave_range</span><span class="plain">)) {</span>
<span class="identifier">latest_section</span><span class="plain"> = </span><span class="identifier">S</span><span class="plain">;</span>
&lt;<span class="cwebmacro">Wipe the slate clean of footnotes</span> <span class="cwebmacronumber">1.3.3</span>&gt;<span class="plain">;</span>
<span class="functiontext">LanguageMethods::begin_weave</span><span class="plain">(</span><span class="identifier">S</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">);</span>
<span class="functiontext">Str::clear</span><span class="plain">(</span><span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">sectionmark</span><span class="plain">);</span>
&lt;<span class="cwebmacro">Weave this section</span> <span class="cwebmacronumber">1.3.3</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave this section</span> <span class="cwebmacronumber">1.3.4</span>&gt;<span class="plain">;</span>
<span class="plain">}</span>
<span class="plain">}</span>
</pre>
@ -210,69 +209,84 @@ where to put the result: and so we arrive at the front door of the routine
<p class="endnote">This code is used in <a href="#SP1_3">&#167;1.3</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3"></a><b>&#167;1.3.3. Weaving a section. </b></p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave this section</span> <span class="cwebmacronumber">1.3.3</span>&gt; =
<p class="inwebparagraph"><a id="SP1_3_3"></a><b>&#167;1.3.3. </b><code class="display">
&lt;<span class="cwebmacrodefn">Wipe the slate clean of footnotes</span> <span class="cwebmacronumber">1.3.3</span>&gt; =
</code></p>
<pre class="displaydefn">
<span class="reserved">paragraph</span><span class="plain"> *</span><span class="identifier">current_paragraph</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">for</span><span class="plain"> (</span><span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">L</span><span class="plain"> = </span><span class="identifier">S</span><span class="plain">-&gt;</span><span class="element">first_line</span><span class="plain">; </span><span class="identifier">L</span><span class="plain">; </span><span class="identifier">L</span><span class="plain"> = </span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">next_line</span><span class="plain">) {</span>
<span class="identifier">current_weave_line</span><span class="plain"> = </span><span class="identifier">L</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> ((</span><span class="functiontext">Tags::tagged_with</span><span class="plain">(</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">owning_paragraph</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">theme_match</span><span class="plain">)) &amp;&amp;</span>
<span class="plain">(</span><span class="functiontext">LanguageMethods::skip_in_weaving</span><span class="plain">(</span><span class="identifier">S</span><span class="plain">-&gt;</span><span class="element">sect_language</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">) == </span><span class="constant">FALSE</span><span class="plain">)) {</span>
<span class="identifier">lines_woven</span><span class="plain">++;</span>
&lt;<span class="cwebmacro">Weave this line</span> <span class="cwebmacronumber">1.3.3.1</span>&gt;<span class="plain">;</span>
<span class="plain">}</span>
<span class="plain">}</span>
<span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">L</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
&lt;<span class="cwebmacro">Complete any started but not-fully-woven paragraph</span> <span class="cwebmacronumber">1.3.3.2</span>&gt;<span class="plain">;</span>
<span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">footnotes_cued</span><span class="plain"> = </span><span class="identifier">NEW_LINKED_LIST</span><span class="plain">(</span><span class="reserved">text_stream</span><span class="plain">);</span>
<span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">footnotes_written</span><span class="plain"> = </span><span class="identifier">NEW_LINKED_LIST</span><span class="plain">(</span><span class="reserved">text_stream</span><span class="plain">);</span>
<span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">current_footnote</span><span class="plain"> = </span><span class="functiontext">Str::new</span><span class="plain">();</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3">&#167;1.3</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1"></a><b>&#167;1.3.3.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Weave this line</span> <span class="cwebmacronumber">1.3.3.1</span>&gt; =
<p class="inwebparagraph"><a id="SP1_3_4"></a><b>&#167;1.3.4. Weaving a section. </b></p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave this section</span> <span class="cwebmacronumber">1.3.4</span>&gt; =
</code></p>
<pre class="displaydefn">
<span class="reserved">paragraph</span><span class="plain"> *</span><span class="identifier">current_paragraph</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">for</span><span class="plain"> (</span><span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">L</span><span class="plain"> = </span><span class="identifier">S</span><span class="plain">-&gt;</span><span class="element">first_line</span><span class="plain">; </span><span class="identifier">L</span><span class="plain">; </span><span class="identifier">L</span><span class="plain"> = </span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">next_line</span><span class="plain">) {</span>
<span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">current_weave_line</span><span class="plain"> = </span><span class="identifier">L</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> ((</span><span class="functiontext">Tags::tagged_with</span><span class="plain">(</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">owning_paragraph</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">theme_match</span><span class="plain">)) &amp;&amp;</span>
<span class="plain">(</span><span class="functiontext">LanguageMethods::skip_in_weaving</span><span class="plain">(</span><span class="identifier">S</span><span class="plain">-&gt;</span><span class="element">sect_language</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">) == </span><span class="constant">FALSE</span><span class="plain">)) {</span>
<span class="identifier">lines_woven</span><span class="plain">++;</span>
&lt;<span class="cwebmacro">Weave this line</span> <span class="cwebmacronumber">1.3.4.1</span>&gt;<span class="plain">;</span>
<span class="plain">}</span>
<span class="plain">}</span>
<span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">L</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
&lt;<span class="cwebmacro">Complete any started but not-fully-woven paragraph</span> <span class="cwebmacronumber">1.3.4.2</span>&gt;<span class="plain">;</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3">&#167;1.3</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_4_1"></a><b>&#167;1.3.4.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Weave this line</span> <span class="cwebmacronumber">1.3.4.1</span>&gt; =
</code></p>
<pre class="displaydefn">
<span class="comment"> In principle, all of these source lines should be woven, but...</span>
&lt;<span class="cwebmacro">Certain categories of line are excluded from the weave</span> <span class="cwebmacronumber">1.3.3.1.1</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Respond to any commands aimed at the weaver, and otherwise skip commands</span> <span class="cwebmacronumber">1.3.3.1.2</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Certain categories of line are excluded from the weave</span> <span class="cwebmacronumber">1.3.4.1.1</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Respond to any commands aimed at the weaver, and otherwise skip commands</span> <span class="cwebmacronumber">1.3.4.1.2</span>&gt;<span class="plain">;</span>
<span class="comment"> Some of the more baroque front matter of a section...</span>
&lt;<span class="cwebmacro">Weave the Purpose marker as a little heading</span> <span class="cwebmacronumber">1.3.3.1.3</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">If we need to work in a section table of contents and this is a blank line, do it now</span> <span class="cwebmacronumber">1.3.3.1.4</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Deal with the Interface passage</span> <span class="cwebmacronumber">1.3.3.1.5</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave the Definitions marker as a little heading</span> <span class="cwebmacronumber">1.3.3.1.6</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave the section bar as a horizontal rule</span> <span class="cwebmacronumber">1.3.3.1.7</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave the Purpose marker as a little heading</span> <span class="cwebmacronumber">1.3.4.1.3</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">If we need to work in a section table of contents and this is a blank line, do it now</span> <span class="cwebmacronumber">1.3.4.1.4</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Deal with the Interface passage</span> <span class="cwebmacronumber">1.3.4.1.5</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave the Definitions marker as a little heading</span> <span class="cwebmacronumber">1.3.4.1.6</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave the section bar as a horizontal rule</span> <span class="cwebmacronumber">1.3.4.1.7</span>&gt;<span class="plain">;</span>
<span class="comment"> The crucial junction point between modes...</span>
&lt;<span class="cwebmacro">Deal with the marker for the start of a new paragraph, section or chapter</span> <span class="cwebmacronumber">1.3.3.1.10</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Deal with the marker for the start of a new paragraph, section or chapter</span> <span class="cwebmacronumber">1.3.4.1.10</span>&gt;<span class="plain">;</span>
<span class="comment"> With all exotica dealt with, we now just have material to weave verbatim...</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">); </span><span class="functiontext">Str::copy</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">text</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">is_commentary</span><span class="plain">) </span>&lt;<span class="cwebmacro">Weave verbatim matter in commentary style</span> <span class="cwebmacronumber">1.3.3.1.8</span>&gt;
<span class="reserved">else</span><span class="plain"> </span>&lt;<span class="cwebmacro">Weave verbatim matter in code style</span> <span class="cwebmacronumber">1.3.3.1.9</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">is_commentary</span><span class="plain">) </span>&lt;<span class="cwebmacro">Weave verbatim matter in commentary style</span> <span class="cwebmacronumber">1.3.4.1.8</span>&gt;
<span class="reserved">else</span><span class="plain"> </span>&lt;<span class="cwebmacro">Weave verbatim matter in code style</span> <span class="cwebmacronumber">1.3.4.1.9</span>&gt;<span class="plain">;</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">);</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3">&#167;1.3.3</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4">&#167;1.3.4</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_1"></a><b>&#167;1.3.3.1.1. Reasons to skip things. </b>We skip these because we weave their contents in some other way:
<p class="inwebparagraph"><a id="SP1_3_4_1_1"></a><b>&#167;1.3.4.1.1. Reasons to skip things. </b>We skip these because we weave their contents in some other way:
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Certain categories of line are excluded from the weave</span> <span class="cwebmacronumber">1.3.3.1.1</span>&gt; =
&lt;<span class="cwebmacrodefn">Certain categories of line are excluded from the weave</span> <span class="cwebmacronumber">1.3.4.1.1</span>&gt; =
</code></p>
@ -294,15 +308,15 @@ where to put the result: and so we arrive at the front door of the routine
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1">&#167;1.3.3.1</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1">&#167;1.3.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_2"></a><b>&#167;1.3.3.1.2. </b>And lastly we ignore commands, or act on them if they happen to be aimed
<p class="inwebparagraph"><a id="SP1_3_4_1_2"></a><b>&#167;1.3.4.1.2. </b>And lastly we ignore commands, or act on them if they happen to be aimed
at us; but we don't weave them into the output, that's for sure.
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Respond to any commands aimed at the weaver, and otherwise skip commands</span> <span class="cwebmacronumber">1.3.3.1.2</span>&gt; =
&lt;<span class="cwebmacrodefn">Respond to any commands aimed at the weaver, and otherwise skip commands</span> <span class="cwebmacronumber">1.3.4.1.2</span>&gt; =
</code></p>
@ -310,8 +324,8 @@ at us; but we don't weave them into the output, that's for sure.
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">category</span><span class="plain"> == </span><span class="constant">COMMAND_LCAT</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">command_code</span><span class="plain"> == </span><span class="constant">PAGEBREAK_CMD</span><span class="plain">) </span><span class="functiontext">Formats::pagebreak</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">command_code</span><span class="plain"> == </span><span class="constant">GRAMMAR_INDEX_CMD</span><span class="plain">) </span><span class="functiontext">InCSupport::weave_grammar_index</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">command_code</span><span class="plain"> == </span><span class="constant">FIGURE_CMD</span><span class="plain">) </span>&lt;<span class="cwebmacro">Weave a figure</span> <span class="cwebmacronumber">1.3.3.1.2.1</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">command_code</span><span class="plain"> == </span><span class="constant">EMBED_CMD</span><span class="plain">) </span>&lt;<span class="cwebmacro">Embed some Internet material</span> <span class="cwebmacronumber">1.3.3.1.2.2</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">command_code</span><span class="plain"> == </span><span class="constant">FIGURE_CMD</span><span class="plain">) </span>&lt;<span class="cwebmacro">Weave a figure</span> <span class="cwebmacronumber">1.3.4.1.2.1</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">command_code</span><span class="plain"> == </span><span class="constant">EMBED_CMD</span><span class="plain">) </span>&lt;<span class="cwebmacro">Embed some Internet material</span> <span class="cwebmacronumber">1.3.4.1.2.2</span>&gt;<span class="plain">;</span>
<span class="comment"> Otherwise assume it was a tangler command, and ignore it here</span>
<span class="reserved">continue</span><span class="plain">;</span>
<span class="plain">}</span>
@ -319,10 +333,10 @@ at us; but we don't weave them into the output, that's for sure.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1">&#167;1.3.3.1</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1">&#167;1.3.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_2_1"></a><b>&#167;1.3.3.1.2.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Weave a figure</span> <span class="cwebmacronumber">1.3.3.1.2.1</span>&gt; =
<p class="inwebparagraph"><a id="SP1_3_4_1_2_1"></a><b>&#167;1.3.4.1.2.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Weave a figure</span> <span class="cwebmacronumber">1.3.4.1.2.1</span>&gt; =
</code></p>
@ -354,10 +368,10 @@ at us; but we don't weave them into the output, that's for sure.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_2">&#167;1.3.3.1.2</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_2">&#167;1.3.4.1.2</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_2_2"></a><b>&#167;1.3.3.1.2.2. </b><code class="display">
&lt;<span class="cwebmacrodefn">Embed some Internet material</span> <span class="cwebmacronumber">1.3.3.1.2.2</span>&gt; =
<p class="inwebparagraph"><a id="SP1_3_4_1_2_2"></a><b>&#167;1.3.4.1.2.2. </b><code class="display">
&lt;<span class="cwebmacrodefn">Embed some Internet material</span> <span class="cwebmacronumber">1.3.4.1.2.2</span>&gt; =
</code></p>
@ -367,16 +381,16 @@ at us; but we don't weave them into the output, that's for sure.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_2">&#167;1.3.3.1.2</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_2">&#167;1.3.4.1.2</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_3"></a><b>&#167;1.3.3.1.3. Headings. </b>The purpose is set with a little heading. Its operand is that part of
<p class="inwebparagraph"><a id="SP1_3_4_1_3"></a><b>&#167;1.3.4.1.3. Headings. </b>The purpose is set with a little heading. Its operand is that part of
the purpose-text which is on the opening line; the rest follows on
subsequent lines until the next blank.
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave the Purpose marker as a little heading</span> <span class="cwebmacronumber">1.3.3.1.3</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave the Purpose marker as a little heading</span> <span class="cwebmacronumber">1.3.4.1.3</span>&gt; =
</code></p>
@ -390,14 +404,14 @@ subsequent lines until the next blank.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1">&#167;1.3.3.1</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1">&#167;1.3.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_4"></a><b>&#167;1.3.3.1.4. </b>This normally appears just after the Purpose subheading:
<p class="inwebparagraph"><a id="SP1_3_4_1_4"></a><b>&#167;1.3.4.1.4. </b>This normally appears just after the Purpose subheading:
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">If we need to work in a section table of contents and this is a blank line, do it now</span> <span class="cwebmacronumber">1.3.3.1.4</span>&gt; =
&lt;<span class="cwebmacrodefn">If we need to work in a section table of contents and this is a blank line, do it now</span> <span class="cwebmacronumber">1.3.4.1.4</span>&gt; =
</code></p>
@ -413,15 +427,15 @@ subsequent lines until the next blank.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1">&#167;1.3.3.1</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1">&#167;1.3.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_5"></a><b>&#167;1.3.3.1.5. </b>After which we have the Interface &mdash; if we're in Inweb syntax version 1 &mdash;
<p class="inwebparagraph"><a id="SP1_3_4_1_5"></a><b>&#167;1.3.4.1.5. </b>After which we have the Interface &mdash; if we're in Inweb syntax version 1 &mdash;
but it weaves nothing:
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Deal with the Interface passage</span> <span class="cwebmacronumber">1.3.3.1.5</span>&gt; =
&lt;<span class="cwebmacrodefn">Deal with the Interface passage</span> <span class="cwebmacronumber">1.3.4.1.5</span>&gt; =
</code></p>
@ -434,14 +448,14 @@ but it weaves nothing:
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1">&#167;1.3.3.1</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1">&#167;1.3.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_6"></a><b>&#167;1.3.3.1.6. </b>And another little heading, again visible only in syntax version 1...
<p class="inwebparagraph"><a id="SP1_3_4_1_6"></a><b>&#167;1.3.4.1.6. </b>And another little heading, again visible only in syntax version 1...
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave the Definitions marker as a little heading</span> <span class="cwebmacronumber">1.3.3.1.6</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave the Definitions marker as a little heading</span> <span class="cwebmacronumber">1.3.4.1.6</span>&gt; =
</code></p>
@ -456,22 +470,22 @@ but it weaves nothing:
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1">&#167;1.3.3.1</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1">&#167;1.3.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_7"></a><b>&#167;1.3.3.1.7. </b>...with the section bar to follow. The bar line completes any half-finished
<p class="inwebparagraph"><a id="SP1_3_4_1_7"></a><b>&#167;1.3.4.1.7. </b>...with the section bar to follow. The bar line completes any half-finished
paragraph and is set as a horizontal rule (and, once again, can exist only
in a version 1 web).
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave the section bar as a horizontal rule</span> <span class="cwebmacronumber">1.3.3.1.7</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave the section bar as a horizontal rule</span> <span class="cwebmacronumber">1.3.4.1.7</span>&gt; =
</code></p>
<pre class="displaydefn">
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">category</span><span class="plain"> == </span><span class="constant">BAR_LCAT</span><span class="plain">) {</span>
&lt;<span class="cwebmacro">Complete any started but not-fully-woven paragraph</span> <span class="cwebmacronumber">1.3.3.2</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Complete any started but not-fully-woven paragraph</span> <span class="cwebmacronumber">1.3.4.2</span>&gt;<span class="plain">;</span>
<span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">kind_of_material</span><span class="plain"> = </span><span class="constant">REGULAR_MATERIAL</span><span class="plain">;</span>
<span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">next_heading_without_vertical_skip</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">state</span><span class="plain">-&gt;</span><span class="identifier">horizontal_rule_just_drawn</span><span class="plain"> == </span><span class="constant">FALSE</span><span class="plain">) </span><span class="functiontext">Formats::bar</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">);</span>
@ -481,23 +495,24 @@ in a version 1 web).
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1">&#167;1.3.3.1</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1">&#167;1.3.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_8"></a><b>&#167;1.3.3.1.8. Commentary matter. </b>Typographically this is a fairly simple business: it's almost the case that
<p class="inwebparagraph"><a id="SP1_3_4_1_8"></a><b>&#167;1.3.4.1.8. Commentary matter. </b>Typographically this is a fairly simple business: it's almost the case that
we only have to transcribe it. But not quite!
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave verbatim matter in commentary style</span> <span class="cwebmacronumber">1.3.3.1.8</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave verbatim matter in commentary style</span> <span class="cwebmacronumber">1.3.4.1.8</span>&gt; =
</code></p>
<pre class="displaydefn">
&lt;<span class="cwebmacro">Weave displayed source in its own special style</span> <span class="cwebmacronumber">1.3.3.1.8.1</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave a blank line as a thin vertical skip and paragraph break</span> <span class="cwebmacronumber">1.3.3.1.8.2</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave bracketed list indications at start of line into indentation</span> <span class="cwebmacronumber">1.3.3.1.8.3</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave tabbed code material as a new indented paragraph</span> <span class="cwebmacronumber">1.3.3.1.8.4</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave displayed source in its own special style</span> <span class="cwebmacronumber">1.3.4.1.8.1</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave a blank line as a thin vertical skip and paragraph break</span> <span class="cwebmacronumber">1.3.4.1.8.2</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave bracketed list indications at start of line into indentation</span> <span class="cwebmacronumber">1.3.4.1.8.3</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave tabbed code material as a new indented paragraph</span> <span class="cwebmacronumber">1.3.4.1.8.4</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave footnotes</span> <span class="cwebmacronumber">1.3.4.1.8.5</span>&gt;<span class="plain">;</span>
<span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">substantive_comment</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">, </span><span class="string">"\n"</span><span class="plain">);</span>
<span class="functiontext">Formats::text</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">matter</span><span class="plain">);</span>
@ -506,14 +521,14 @@ we only have to transcribe it. But not quite!
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1">&#167;1.3.3.1</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1">&#167;1.3.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_8_1"></a><b>&#167;1.3.3.1.8.1. </b>Displayed source is the material marked with <code class="display"><span class="extract">&gt;&gt;</span></code> arrows in column 1.
<p class="inwebparagraph"><a id="SP1_3_4_1_8_1"></a><b>&#167;1.3.4.1.8.1. </b>Displayed source is the material marked with <code class="display"><span class="extract">&gt;&gt;</span></code> arrows in column 1.
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave displayed source in its own special style</span> <span class="cwebmacronumber">1.3.3.1.8.1</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave displayed source in its own special style</span> <span class="cwebmacronumber">1.3.4.1.8.1</span>&gt; =
</code></p>
@ -526,15 +541,15 @@ we only have to transcribe it. But not quite!
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_8">&#167;1.3.3.1.8</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_8">&#167;1.3.4.1.8</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_8_2"></a><b>&#167;1.3.3.1.8.2. </b>Our style is to use paragraphs without initial-line indentation, so we
<p class="inwebparagraph"><a id="SP1_3_4_1_8_2"></a><b>&#167;1.3.4.1.8.2. </b>Our style is to use paragraphs without initial-line indentation, so we
add a vertical skip between them to show the division more clearly.
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave a blank line as a thin vertical skip and paragraph break</span> <span class="cwebmacronumber">1.3.3.1.8.2</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave a blank line as a thin vertical skip and paragraph break</span> <span class="cwebmacronumber">1.3.4.1.8.2</span>&gt; =
</code></p>
@ -554,15 +569,15 @@ add a vertical skip between them to show the division more clearly.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_8">&#167;1.3.3.1.8</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_8">&#167;1.3.4.1.8</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_8_3"></a><b>&#167;1.3.3.1.8.3. </b>Here our extension is simply to provide a tidier way to use TeX's standard
<p class="inwebparagraph"><a id="SP1_3_4_1_8_3"></a><b>&#167;1.3.4.1.8.3. </b>Here our extension is simply to provide a tidier way to use TeX's standard
<code class="display"><span class="extract">\item</span></code> and <code class="display"><span class="extract">\itemitem</span></code> macros for indented list items.
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave bracketed list indications at start of line into indentation</span> <span class="cwebmacronumber">1.3.3.1.8.3</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave bracketed list indications at start of line into indentation</span> <span class="cwebmacronumber">1.3.4.1.8.3</span>&gt; =
</code></p>
@ -598,15 +613,15 @@ add a vertical skip between them to show the division more clearly.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_8">&#167;1.3.3.1.8</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_8">&#167;1.3.4.1.8</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_8_4"></a><b>&#167;1.3.3.1.8.4. </b>Finally, matter encased in vertical strokes one tab stop in from column 1
<p class="inwebparagraph"><a id="SP1_3_4_1_8_4"></a><b>&#167;1.3.4.1.8.4. </b>Finally, matter encased in vertical strokes one tab stop in from column 1
in the source is set indented in code style.
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave tabbed code material as a new indented paragraph</span> <span class="cwebmacronumber">1.3.3.1.8.4</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave tabbed code material as a new indented paragraph</span> <span class="cwebmacronumber">1.3.4.1.8.4</span>&gt; =
</code></p>
@ -639,30 +654,88 @@ in the source is set indented in code style.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_8">&#167;1.3.3.1.8</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_8">&#167;1.3.4.1.8</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_9"></a><b>&#167;1.3.3.1.9. Code-like matter. </b>Even though Inweb's approach, unlike <code class="display"><span class="extract">CWEB</span></code>'s, is to respect the layout
<p class="inwebparagraph"><a id="SP1_3_4_1_8_5"></a><b>&#167;1.3.4.1.8.5. </b><code class="display">
&lt;<span class="cwebmacrodefn">Weave footnotes</span> <span class="cwebmacronumber">1.3.4.1.8.5</span>&gt; =
</code></p>
<pre class="displaydefn">
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">before</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">cue</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">after</span><span class="plain">);</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">this_is_a_cue</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Parser::detect_footnote</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">weave_web</span><span class="plain">, </span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">before</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">, </span><span class="identifier">after</span><span class="plain">)) {</span>
<span class="identifier">LOOP_THROUGH_TEXT</span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">, </span><span class="identifier">before</span><span class="plain">)</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Characters::is_whitespace</span><span class="plain">(</span><span class="functiontext">Str::get</span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">)) == </span><span class="constant">FALSE</span><span class="plain">)</span>
<span class="identifier">this_is_a_cue</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">this_is_a_cue</span><span class="plain">) {</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">T</span><span class="plain">;</span>
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">T</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">footnotes_cued</span><span class="plain">)</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::eq</span><span class="plain">(</span><span class="identifier">T</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">))</span>
<span class="functiontext">Main::error_in_web</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"this is a duplicate footnote cue"</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">);</span>
<span class="identifier">ADD_TO_LINKED_LIST</span><span class="plain">(</span><span class="identifier">T</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">footnotes_cued</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::len</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">current_footnote</span><span class="plain">) &gt; </span><span class="constant">0</span><span class="plain">)</span>
<span class="functiontext">Main::error_in_web</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"this is a footnote cue within a footnote"</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">);</span>
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">T</span><span class="plain">;</span>
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">T</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">footnotes_written</span><span class="plain">)</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::eq</span><span class="plain">(</span><span class="identifier">T</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">))</span>
<span class="functiontext">Main::error_in_web</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"this is a duplicate footnote text"</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">);</span>
<span class="identifier">ADD_TO_LINKED_LIST</span><span class="plain">(</span><span class="identifier">T</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">footnotes_written</span><span class="plain">);</span>
&lt;<span class="cwebmacro">End any currently weaving footnote text</span> <span class="cwebmacronumber">1.3.4.1.8.5.1</span>&gt;<span class="plain">;</span>
<span class="functiontext">Str::copy</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">current_footnote</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="functiontext">Formats::begin_footnote_text</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="plain">}</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">before</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">cue</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">after</span><span class="plain">);</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_8">&#167;1.3.4.1.8</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_4_1_8_5_1"></a><b>&#167;1.3.4.1.8.5.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">End any currently weaving footnote text</span> <span class="cwebmacronumber">1.3.4.1.8.5.1</span>&gt; =
</code></p>
<pre class="displaydefn">
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::len</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">current_footnote</span><span class="plain">) &gt; </span><span class="constant">0</span><span class="plain">) {</span>
<span class="functiontext">Formats::end_footnote_text</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">current_footnote</span><span class="plain">);</span>
<span class="functiontext">Str::clear</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">current_footnote</span><span class="plain">);</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_8_5">&#167;1.3.4.1.8.5</a>, <a href="#SP1_3_4_2">&#167;1.3.4.2</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_4_1_9"></a><b>&#167;1.3.4.1.9. Code-like matter. </b>Even though Inweb's approach, unlike <code class="display"><span class="extract">CWEB</span></code>'s, is to respect the layout
of the original, this is still quite typographically complex: commentary
and macro usage is rendered differently.
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave verbatim matter in code style</span> <span class="cwebmacronumber">1.3.3.1.9</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave verbatim matter in code style</span> <span class="cwebmacronumber">1.3.4.1.9</span>&gt; =
</code></p>
<pre class="displaydefn">
&lt;<span class="cwebmacro">Enter beginlines/endlines mode if necessary</span> <span class="cwebmacronumber">1.3.3.1.9.1</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave a blank line as a thin vertical skip</span> <span class="cwebmacronumber">1.3.3.1.9.2</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Enter beginlines/endlines mode if necessary</span> <span class="cwebmacronumber">1.3.4.1.9.1</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave a blank line as a thin vertical skip</span> <span class="cwebmacronumber">1.3.4.1.9.2</span>&gt;<span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">tab_stops_of_indentation</span><span class="plain"> = </span><span class="constant">0</span><span class="plain">;</span>
&lt;<span class="cwebmacro">Convert leading space in line matter to a number of tab stops</span> <span class="cwebmacronumber">1.3.3.1.9.3</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Convert leading space in line matter to a number of tab stops</span> <span class="cwebmacronumber">1.3.4.1.9.3</span>&gt;<span class="plain">;</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">prefatory</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">concluding_comment</span><span class="plain">);</span>
&lt;<span class="cwebmacro">Extract any comment matter ending the line to be set in italic</span> <span class="cwebmacronumber">1.3.3.1.9.4</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Give constant definition lines slightly fancier openings</span> <span class="cwebmacronumber">1.3.3.1.9.5</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Extract any comment matter ending the line to be set in italic</span> <span class="cwebmacronumber">1.3.4.1.9.4</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Give constant definition lines slightly fancier openings</span> <span class="cwebmacronumber">1.3.4.1.9.5</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">LanguageMethods::weave_code_line</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">S</span><span class="plain">-&gt;</span><span class="element">sect_language</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">,</span>
<span class="identifier">W</span><span class="plain">, </span><span class="identifier">C</span><span class="plain">, </span><span class="identifier">S</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">, </span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">concluding_comment</span><span class="plain">)) </span><span class="reserved">continue</span><span class="plain">;</span>
@ -672,7 +745,7 @@ and macro usage is rendered differently.
<span class="plain"> </span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">colouring</span><span class="plain">);</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">found</span><span class="plain"> = </span><span class="constant">0</span><span class="plain">;</span>
&lt;<span class="cwebmacro">Find macro usages and adjust syntax colouring accordingly</span> <span class="cwebmacronumber">1.3.3.1.9.6</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Find macro usages and adjust syntax colouring accordingly</span> <span class="cwebmacronumber">1.3.4.1.9.6</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::len</span><span class="plain">(</span><span class="identifier">prefatory</span><span class="plain">) &gt; </span><span class="constant">0</span><span class="plain">) {</span>
<span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">in_run_of_definitions</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
@ -691,15 +764,15 @@ and macro usage is rendered differently.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1">&#167;1.3.3.1</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1">&#167;1.3.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_9_1"></a><b>&#167;1.3.3.1.9.1. </b>Code is typeset between the <code class="display"><span class="extract">\beginlines</span></code> and <code class="display"><span class="extract">\endlines</span></code> macros in TeX,
<p class="inwebparagraph"><a id="SP1_3_4_1_9_1"></a><b>&#167;1.3.4.1.9.1. </b>Code is typeset between the <code class="display"><span class="extract">\beginlines</span></code> and <code class="display"><span class="extract">\endlines</span></code> macros in TeX,
hence the name of the following paragraph:
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Enter beginlines/endlines mode if necessary</span> <span class="cwebmacronumber">1.3.3.1.9.1</span>&gt; =
&lt;<span class="cwebmacrodefn">Enter beginlines/endlines mode if necessary</span> <span class="cwebmacronumber">1.3.4.1.9.1</span>&gt; =
</code></p>
@ -725,15 +798,15 @@ hence the name of the following paragraph:
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_9">&#167;1.3.3.1.9</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_9">&#167;1.3.4.1.9</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_9_2"></a><b>&#167;1.3.3.1.9.2. </b>A blank line is typeset as a thin vertical skip (no TeX paragraph break
<p class="inwebparagraph"><a id="SP1_3_4_1_9_2"></a><b>&#167;1.3.4.1.9.2. </b>A blank line is typeset as a thin vertical skip (no TeX paragraph break
is needed):
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave a blank line as a thin vertical skip</span> <span class="cwebmacronumber">1.3.3.1.9.2</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave a blank line as a thin vertical skip</span> <span class="cwebmacronumber">1.3.4.1.9.2</span>&gt; =
</code></p>
@ -750,15 +823,15 @@ is needed):
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_9">&#167;1.3.3.1.9</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_9">&#167;1.3.4.1.9</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_9_3"></a><b>&#167;1.3.3.1.9.3. </b>Examine the white space at the start of the code line, and count the
<p class="inwebparagraph"><a id="SP1_3_4_1_9_3"></a><b>&#167;1.3.4.1.9.3. </b>Examine the white space at the start of the code line, and count the
number of tab steps of indentation, rating 1 tab = 4 spaces:
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Convert leading space in line matter to a number of tab stops</span> <span class="cwebmacronumber">1.3.3.1.9.3</span>&gt; =
&lt;<span class="cwebmacrodefn">Convert leading space in line matter to a number of tab stops</span> <span class="cwebmacronumber">1.3.4.1.9.3</span>&gt; =
</code></p>
@ -789,16 +862,16 @@ number of tab steps of indentation, rating 1 tab = 4 spaces:
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_9">&#167;1.3.3.1.9</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_9">&#167;1.3.4.1.9</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_9_4"></a><b>&#167;1.3.3.1.9.4. </b>Comments which run to the end of a line are set in italic type. If the
<p class="inwebparagraph"><a id="SP1_3_4_1_9_4"></a><b>&#167;1.3.4.1.9.4. </b>Comments which run to the end of a line are set in italic type. If the
only item on their lines, they are presented at the code tab stop;
otherwise, they are set flush right.
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Extract any comment matter ending the line to be set in italic</span> <span class="cwebmacronumber">1.3.3.1.9.4</span>&gt; =
&lt;<span class="cwebmacrodefn">Extract any comment matter ending the line to be set in italic</span> <span class="cwebmacronumber">1.3.4.1.9.4</span>&gt; =
</code></p>
@ -818,14 +891,14 @@ otherwise, they are set flush right.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_9">&#167;1.3.3.1.9</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_9">&#167;1.3.4.1.9</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_9_5"></a><b>&#167;1.3.3.1.9.5. </b>Set the <code class="display"><span class="extract">@d</span></code> definition escape very slightly more fancily:
<p class="inwebparagraph"><a id="SP1_3_4_1_9_5"></a><b>&#167;1.3.4.1.9.5. </b>Set the <code class="display"><span class="extract">@d</span></code> definition escape very slightly more fancily:
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Give constant definition lines slightly fancier openings</span> <span class="cwebmacronumber">1.3.3.1.9.5</span>&gt; =
&lt;<span class="cwebmacrodefn">Give constant definition lines slightly fancier openings</span> <span class="cwebmacronumber">1.3.4.1.9.5</span>&gt; =
</code></p>
@ -847,10 +920,10 @@ otherwise, they are set flush right.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_9">&#167;1.3.3.1.9</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_9">&#167;1.3.4.1.9</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_9_6"></a><b>&#167;1.3.3.1.9.6. </b><code class="display">
&lt;<span class="cwebmacrodefn">Find macro usages and adjust syntax colouring accordingly</span> <span class="cwebmacronumber">1.3.3.1.9.6</span>&gt; =
<p class="inwebparagraph"><a id="SP1_3_4_1_9_6"></a><b>&#167;1.3.4.1.9.6. </b><code class="display">
&lt;<span class="cwebmacrodefn">Find macro usages and adjust syntax colouring accordingly</span> <span class="cwebmacronumber">1.3.4.1.9.6</span>&gt; =
</code></p>
@ -883,13 +956,13 @@ otherwise, they are set flush right.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_9">&#167;1.3.3.1.9</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_9">&#167;1.3.4.1.9</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_10"></a><b>&#167;1.3.3.1.10. How paragraphs begin. </b></p>
<p class="inwebparagraph"><a id="SP1_3_4_1_10"></a><b>&#167;1.3.4.1.10. How paragraphs begin. </b></p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Deal with the marker for the start of a new paragraph, section or chapter</span> <span class="cwebmacronumber">1.3.3.1.10</span>&gt; =
&lt;<span class="cwebmacrodefn">Deal with the marker for the start of a new paragraph, section or chapter</span> <span class="cwebmacronumber">1.3.4.1.10</span>&gt; =
</code></p>
@ -899,22 +972,22 @@ otherwise, they are set flush right.
<span class="plain">(</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">category</span><span class="plain"> == </span><span class="constant">CHAPTER_HEADING_LCAT</span><span class="plain">) ||</span>
<span class="plain">(</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">category</span><span class="plain"> == </span><span class="constant">SECTION_HEADING_LCAT</span><span class="plain">)) {</span>
<span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">in_run_of_definitions</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
&lt;<span class="cwebmacro">Complete any started but not-fully-woven paragraph</span> <span class="cwebmacronumber">1.3.3.2</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Complete any started but not-fully-woven paragraph</span> <span class="cwebmacronumber">1.3.4.2</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">theme_match</span><span class="plain">)</span>
&lt;<span class="cwebmacro">If this is a paragraph break forced onto a new page, then throw a page</span> <span class="cwebmacronumber">1.3.3.1.10.1</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">If this is a paragraph break forced onto a new page, then throw a page</span> <span class="cwebmacronumber">1.3.4.1.10.1</span>&gt;<span class="plain">;</span>
<span class="functiontext">LanguageMethods::reset_syntax_colouring</span><span class="plain">(</span><span class="identifier">S</span><span class="plain">-&gt;</span><span class="element">sect_language</span><span class="plain">);</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">weight</span><span class="plain"> = </span><span class="constant">0</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">category</span><span class="plain"> == </span><span class="constant">HEADING_START_LCAT</span><span class="plain">) </span><span class="identifier">weight</span><span class="plain"> = </span><span class="constant">1</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">category</span><span class="plain"> == </span><span class="constant">SECTION_HEADING_LCAT</span><span class="plain">) </span><span class="identifier">weight</span><span class="plain"> = </span><span class="constant">2</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">category</span><span class="plain"> == </span><span class="constant">CHAPTER_HEADING_LCAT</span><span class="plain">) </span><span class="identifier">weight</span><span class="plain"> = </span><span class="constant">3</span><span class="plain">;</span>
&lt;<span class="cwebmacro">Work out the next mark to place into the TeX vertical list</span> <span class="cwebmacronumber">1.3.3.1.10.2</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Work out the next mark to place into the TeX vertical list</span> <span class="cwebmacronumber">1.3.4.1.10.2</span>&gt;<span class="plain">;</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">TeX_macro</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
&lt;<span class="cwebmacro">Choose which TeX macro to use in order to typeset the new paragraph heading</span> <span class="cwebmacronumber">1.3.3.1.10.3</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Choose which TeX macro to use in order to typeset the new paragraph heading</span> <span class="cwebmacronumber">1.3.4.1.10.3</span>&gt;<span class="plain">;</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">heading_text</span><span class="plain">);</span>
&lt;<span class="cwebmacro">Compose the heading text</span> <span class="cwebmacronumber">1.3.3.1.10.4</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Compose the heading text</span> <span class="cwebmacronumber">1.3.4.1.10.4</span>&gt;<span class="plain">;</span>
<span class="functiontext">Formats::paragraph_heading</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">TeX_macro</span><span class="plain">, </span><span class="identifier">S</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">owning_paragraph</span><span class="plain">,</span>
<span class="identifier">heading_text</span><span class="plain">, </span><span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">chaptermark</span><span class="plain">, </span><span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">sectionmark</span><span class="plain">, </span><span class="identifier">weight</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">heading_text</span><span class="plain">);</span>
@ -922,7 +995,7 @@ otherwise, they are set flush right.
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">weight</span><span class="plain"> == </span><span class="constant">0</span><span class="plain">) </span><span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">substantive_comment</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
<span class="reserved">else</span><span class="plain"> </span><span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">substantive_comment</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
&lt;<span class="cwebmacro">Weave any regular commentary text after the heading on the same line</span> <span class="cwebmacronumber">1.3.3.1.10.5</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Weave any regular commentary text after the heading on the same line</span> <span class="cwebmacronumber">1.3.4.1.10.5</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">weight</span><span class="plain"> == </span><span class="constant">3</span><span class="plain">) </span><span class="functiontext">Formats::chapter_title_page</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">C</span><span class="plain">);</span>
<span class="reserved">continue</span><span class="plain">;</span>
@ -931,10 +1004,10 @@ otherwise, they are set flush right.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1">&#167;1.3.3.1</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1">&#167;1.3.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_10_1"></a><b>&#167;1.3.3.1.10.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">If this is a paragraph break forced onto a new page, then throw a page</span> <span class="cwebmacronumber">1.3.3.1.10.1</span>&gt; =
<p class="inwebparagraph"><a id="SP1_3_4_1_10_1"></a><b>&#167;1.3.4.1.10.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">If this is a paragraph break forced onto a new page, then throw a page</span> <span class="cwebmacronumber">1.3.4.1.10.1</span>&gt; =
</code></p>
@ -945,9 +1018,9 @@ otherwise, they are set flush right.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_10">&#167;1.3.3.1.10</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_10">&#167;1.3.4.1.10</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_10_2"></a><b>&#167;1.3.3.1.10.2. </b>"Marks" are the contrivance by which TeX produces running heads on pages
<p class="inwebparagraph"><a id="SP1_3_4_1_10_2"></a><b>&#167;1.3.4.1.10.2. </b>"Marks" are the contrivance by which TeX produces running heads on pages
which follow the material on those pages: so that the running head for a page
can show the paragraph range for the material which tops it, for instance.
</p>
@ -960,7 +1033,7 @@ in TeX's deeply peculiar font encoding system.
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Work out the next mark to place into the TeX vertical list</span> <span class="cwebmacronumber">1.3.3.1.10.2</span>&gt; =
&lt;<span class="cwebmacrodefn">Work out the next mark to place into the TeX vertical list</span> <span class="cwebmacronumber">1.3.4.1.10.2</span>&gt; =
</code></p>
@ -982,9 +1055,9 @@ in TeX's deeply peculiar font encoding system.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_10">&#167;1.3.3.1.10</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_10">&#167;1.3.4.1.10</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_10_3"></a><b>&#167;1.3.3.1.10.3. </b>We want to have different heading styles for different weights, and TeX is
<p class="inwebparagraph"><a id="SP1_3_4_1_10_3"></a><b>&#167;1.3.4.1.10.3. </b>We want to have different heading styles for different weights, and TeX is
horrible at using macro parameters as function arguments, so we don't want
to pass the weight that way. Instead we use
</p>
@ -1005,7 +1078,7 @@ prevent unsightly excess white space in certain configurations of a section.
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Choose which TeX macro to use in order to typeset the new paragraph heading</span> <span class="cwebmacronumber">1.3.3.1.10.3</span>&gt; =
&lt;<span class="cwebmacrodefn">Choose which TeX macro to use in order to typeset the new paragraph heading</span> <span class="cwebmacronumber">1.3.4.1.10.3</span>&gt; =
</code></p>
@ -1016,7 +1089,7 @@ prevent unsightly excess white space in certain configurations of a section.
<span class="reserved">case</span><span class="plain"> </span><span class="constant">2</span><span class="plain">: </span><span class="identifier">TeX_macro</span><span class="plain"> = </span><span class="identifier">I</span><span class="string">"weavesectionss"</span><span class="plain">; </span><span class="reserved">break</span><span class="plain">;</span>
<span class="identifier">default:</span><span class="plain"> </span><span class="identifier">TeX_macro</span><span class="plain"> = </span><span class="identifier">I</span><span class="string">"weavesectionsss"</span><span class="plain">; </span><span class="reserved">break</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">theme_match</span><span class="plain">) </span>&lt;<span class="cwebmacro">Apply special rules for thematic extracts</span> <span class="cwebmacronumber">1.3.3.1.10.3.1</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">theme_match</span><span class="plain">) </span>&lt;<span class="cwebmacro">Apply special rules for thematic extracts</span> <span class="cwebmacronumber">1.3.4.1.10.3.1</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">next_heading_without_vertical_skip</span><span class="plain">) &amp;&amp; (</span><span class="identifier">weight</span><span class="plain"> &lt; </span><span class="constant">2</span><span class="plain">)) {</span>
<span class="identifier">state</span><span class="plain">-&gt;</span><span class="element">next_heading_without_vertical_skip</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
<span class="reserved">switch</span><span class="plain"> (</span><span class="identifier">weight</span><span class="plain">) {</span>
@ -1028,15 +1101,15 @@ prevent unsightly excess white space in certain configurations of a section.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_10">&#167;1.3.3.1.10</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_10">&#167;1.3.4.1.10</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_10_3_1"></a><b>&#167;1.3.3.1.10.3.1. </b>If we are weaving a selection of extracted paragraphs, normal conventions
<p class="inwebparagraph"><a id="SP1_3_4_1_10_3_1"></a><b>&#167;1.3.4.1.10.3.1. </b>If we are weaving a selection of extracted paragraphs, normal conventions
about breaking pages at chapters and sections fail to work. So:
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Apply special rules for thematic extracts</span> <span class="cwebmacronumber">1.3.3.1.10.3.1</span>&gt; =
&lt;<span class="cwebmacrodefn">Apply special rules for thematic extracts</span> <span class="cwebmacronumber">1.3.4.1.10.3.1</span>&gt; =
</code></p>
@ -1063,10 +1136,10 @@ about breaking pages at chapters and sections fail to work. So:
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_10_3">&#167;1.3.3.1.10.3</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_10_3">&#167;1.3.4.1.10.3</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_10_4"></a><b>&#167;1.3.3.1.10.4. </b><code class="display">
&lt;<span class="cwebmacrodefn">Compose the heading text</span> <span class="cwebmacronumber">1.3.3.1.10.4</span>&gt; =
<p class="inwebparagraph"><a id="SP1_3_4_1_10_4"></a><b>&#167;1.3.4.1.10.4. </b><code class="display">
&lt;<span class="cwebmacrodefn">Compose the heading text</span> <span class="cwebmacronumber">1.3.4.1.10.4</span>&gt; =
</code></p>
@ -1092,15 +1165,15 @@ about breaking pages at chapters and sections fail to work. So:
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_10">&#167;1.3.3.1.10</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_10">&#167;1.3.4.1.10</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_1_10_5"></a><b>&#167;1.3.3.1.10.5. </b>There's quite likely ordinary text on the line following the paragraph
<p class="inwebparagraph"><a id="SP1_3_4_1_10_5"></a><b>&#167;1.3.4.1.10.5. </b>There's quite likely ordinary text on the line following the paragraph
start indication, too, so we need to weave this out:
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Weave any regular commentary text after the heading on the same line</span> <span class="cwebmacronumber">1.3.3.1.10.5</span>&gt; =
&lt;<span class="cwebmacrodefn">Weave any regular commentary text after the heading on the same line</span> <span class="cwebmacronumber">1.3.4.1.10.5</span>&gt; =
</code></p>
@ -1116,14 +1189,14 @@ about breaking pages at chapters and sections fail to work. So:
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3_1_10">&#167;1.3.3.1.10</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4_1_10">&#167;1.3.4.1.10</a>.</p>
<p class="inwebparagraph"><a id="SP1_3_3_2"></a><b>&#167;1.3.3.2. How paragraphs end. </b>At the end of a paragraph, on the other hand, we do this:
<p class="inwebparagraph"><a id="SP1_3_4_2"></a><b>&#167;1.3.4.2. How paragraphs end. </b>At the end of a paragraph, on the other hand, we do this:
</p>
<p class="macrodefinition"><code class="display">
&lt;<span class="cwebmacrodefn">Complete any started but not-fully-woven paragraph</span> <span class="cwebmacronumber">1.3.3.2</span>&gt; =
&lt;<span class="cwebmacrodefn">Complete any started but not-fully-woven paragraph</span> <span class="cwebmacronumber">1.3.4.2</span>&gt; =
</code></p>
@ -1139,11 +1212,12 @@ about breaking pages at chapters and sections fail to work. So:
<span class="functiontext">Weaver::show_endnotes_on_previous_paragraph</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">current_paragraph</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">L</span><span class="plain">) </span><span class="identifier">current_paragraph</span><span class="plain"> = </span><span class="identifier">L</span><span class="plain">-&gt;</span><span class="element">owning_paragraph</span><span class="plain">;</span>
&lt;<span class="cwebmacro">End any currently weaving footnote text</span> <span class="cwebmacronumber">1.3.4.1.8.5.1</span>&gt;<span class="plain">;</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP1_3_3">&#167;1.3.3</a>, <a href="#SP1_3_3_1_7">&#167;1.3.3.1.7</a>, <a href="#SP1_3_3_1_10">&#167;1.3.3.1.10</a>.</p>
<p class="endnote">This code is used in <a href="#SP1_3_4">&#167;1.3.4</a>, <a href="#SP1_3_4_1_7">&#167;1.3.4.1.7</a>, <a href="#SP1_3_4_1_10">&#167;1.3.4.1.10</a>.</p>
<p class="inwebparagraph"><a id="SP2"></a><b>&#167;2. Endnotes. </b>The endnotes describe function calls from far away, or unexpected
structure usage, or how <code class="display"><span class="extract">CWEB</span></code>-style code substitutions were made.
@ -1166,7 +1240,7 @@ structure usage, or how <code class="display"><span class="extract">CWEB</span><
<p class="inwebparagraph"></p>
<p class="endnote">The function Weaver::show_endnotes_on_previous_paragraph is used in <a href="#SP1_3_3_2">&#167;1.3.3.2</a>.</p>
<p class="endnote">The function Weaver::show_endnotes_on_previous_paragraph is used in <a href="#SP1_3_4_2">&#167;1.3.4.2</a>.</p>
<p class="inwebparagraph"><a id="SP2_1"></a><b>&#167;2.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Show endnote on where paragraph macro is used</span> <span class="cwebmacronumber">2.1</span>&gt; =
@ -1359,7 +1433,7 @@ marked as <code class="display"><span class="extract">@h</span></code> headings.
<p class="inwebparagraph"></p>
<p class="endnote">The function Weaver::weave_table_of_contents is used in <a href="#SP1_3_3_1_3">&#167;1.3.3.1.3</a>, <a href="#SP1_3_3_1_4">&#167;1.3.3.1.4</a>.</p>
<p class="endnote">The function Weaver::weave_table_of_contents is used in <a href="#SP1_3_4_1_3">&#167;1.3.4.1.3</a>, <a href="#SP1_3_4_1_4">&#167;1.3.4.1.4</a>.</p>
<hr class="tocbar">
<ul class="toc"><li><a href="3-ti.html">Back to 'The Indexer'</a></li><li><a href="3-tt.html">Continue with 'The Tangler'</a></li></ul><hr class="tocbar">

View file

@ -1308,7 +1308,7 @@ nonterminal definitions:
<p class="inwebparagraph"></p>
<p class="endnote">The function InCSupport::weave_grammar_index is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_2">&#167;1.3.3.1.2</a>).</p>
<p class="endnote">The function InCSupport::weave_grammar_index is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_2">&#167;1.3.4.1.2</a>).</p>
<p class="inwebparagraph"><a id="SP14_1"></a><b>&#167;14.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">List where the nonterminal is called from Inform code</span> <span class="cwebmacronumber">14.1</span>&gt; =

View file

@ -123,7 +123,7 @@ within the comment into the supplied strings.
<p class="inwebparagraph"></p>
<p class="endnote">The function LanguageMethods::parse_comment is used in 2/tp (<a href="2-tp.html#SP1_1_6_5_1_7">&#167;1.1.6.5.1.7</a>), 3/tw (<a href="3-tw.html#SP1_3_3_1_9_4">&#167;1.3.3.1.9.4</a>), 4/tp (<a href="4-tp.html#SP2">&#167;2</a>).</p>
<p class="endnote">The function LanguageMethods::parse_comment is used in 2/tp (<a href="2-tp.html#SP1_1_6_5_1_7">&#167;1.1.6.5.1.7</a>), 3/tw (<a href="3-tw.html#SP1_3_4_1_9_4">&#167;1.3.4.1.9.4</a>), 4/tp (<a href="4-tp.html#SP2">&#167;2</a>).</p>
<p class="inwebparagraph"><a id="SP5"></a><b>&#167;5. Tangling methods. </b>We take these roughly in order of their effects on the tangled output, from
the top to the bottom of the file.
@ -542,7 +542,7 @@ anything that the language in question might need later.
<p class="inwebparagraph"></p>
<p class="endnote">The function LanguageMethods::skip_in_weaving is used in 3/tw (<a href="3-tw.html#SP1_3_3">&#167;1.3.3</a>).</p>
<p class="endnote">The function LanguageMethods::skip_in_weaving is used in 3/tw (<a href="3-tw.html#SP1_3_4">&#167;1.3.4</a>).</p>
<p class="inwebparagraph"><a id="SP22"></a><b>&#167;22. </b>Languages most do syntax colouring by having a "state" (this is now inside
a comment, inside qupted text, and so on); the following method is provided
@ -564,7 +564,7 @@ sake, which minimises the knock-on effect of any colouring mistakes.
<p class="inwebparagraph"></p>
<p class="endnote">The function LanguageMethods::reset_syntax_colouring is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_1">&#167;1.3.3.1.1</a>, <a href="3-tw.html#SP1_3_3_1_9_6">&#167;1.3.3.1.9.6</a>, <a href="3-tw.html#SP1_3_3_1_10">&#167;1.3.3.1.10</a>).</p>
<p class="endnote">The function LanguageMethods::reset_syntax_colouring is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_1">&#167;1.3.4.1.1</a>, <a href="3-tw.html#SP1_3_4_1_9_6">&#167;1.3.4.1.9.6</a>, <a href="3-tw.html#SP1_3_4_1_10">&#167;1.3.4.1.10</a>).</p>
<p class="inwebparagraph"><a id="SP23"></a><b>&#167;23. </b>And this is where colouring is done.
</p>
@ -594,7 +594,7 @@ sake, which minimises the knock-on effect of any colouring mistakes.
<p class="inwebparagraph"></p>
<p class="endnote">The function LanguageMethods::syntax_colour is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_9">&#167;1.3.3.1.9</a>).</p>
<p class="endnote">The function LanguageMethods::syntax_colour is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_9">&#167;1.3.4.1.9</a>).</p>
<p class="inwebparagraph"><a id="SP24"></a><b>&#167;24. </b>This method is called for each code line to be woven. If it returns <code class="display"><span class="extract">FALSE</span></code>, the
weaver carries on in the normal way. If not, it does nothing, assuming that the
@ -619,7 +619,7 @@ method has already woven something more attractive.
<p class="inwebparagraph"></p>
<p class="endnote">The function LanguageMethods::weave_code_line is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_9">&#167;1.3.3.1.9</a>).</p>
<p class="endnote">The function LanguageMethods::weave_code_line is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_9">&#167;1.3.4.1.9</a>).</p>
<p class="inwebparagraph"><a id="SP25"></a><b>&#167;25. </b>When Inweb creates a new <code class="display"><span class="extract"> </span></code>, it lets everybody know about that.
</p>

View file

@ -48,7 +48,7 @@
<p class="inwebparagraph"></p>
<p class="endnote">The function Languages::find_by_name is used in <a href="#SP3">&#167;3</a>, 2/tr (<a href="2-tr.html#SP4_2">&#167;4.2</a>, <a href="2-tr.html#SP4_3">&#167;4.3</a>, <a href="2-tr.html#SP4_4">&#167;4.4</a>), 2/tp (<a href="2-tp.html#SP1_1_6_7">&#167;1.1.6.7</a>), 3/tw (<a href="3-tw.html#SP1_3_3_1_2_1">&#167;1.3.3.1.2.1</a>).</p>
<p class="endnote">The function Languages::find_by_name is used in <a href="#SP3">&#167;3</a>, 2/tr (<a href="2-tr.html#SP4_2">&#167;4.2</a>, <a href="2-tr.html#SP4_3">&#167;4.3</a>, <a href="2-tr.html#SP4_4">&#167;4.4</a>), 2/tp (<a href="2-tp.html#SP1_1_6_7">&#167;1.1.6.7</a>), 3/tw (<a href="3-tw.html#SP1_3_4_1_2_1">&#167;1.3.4.1.2.1</a>).</p>
<p class="inwebparagraph"><a id="SP2_1"></a><b>&#167;2.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">If this is the name of a language already known, return that</span> <span class="cwebmacronumber">2.1</span>&gt; =

View file

@ -27,7 +27,7 @@
<!--Weave of 'Format Methods' generated by 7-->
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="index.html">inweb</a></li><li><a href="index.html#5">Chapter 5: Formats</a></li><li><b>Format Methods</b></li></ul><p class="purpose">To characterise the relevant differences in behaviour between the various weaving formats offered, such as HTML, ePub, or TeX.</p>
<ul class="toc"><li><a href="#SP1">&#167;1. Formats</a></li><li><a href="#SP3">&#167;3. Creation</a></li><li><a href="#SP4">&#167;4. Methods</a></li><li><a href="#SP31">&#167;31. Post-processing</a></li></ul><hr class="tocbar">
<ul class="toc"><li><a href="#SP1">&#167;1. Formats</a></li><li><a href="#SP3">&#167;3. Creation</a></li><li><a href="#SP4">&#167;4. Methods</a></li><li><a href="#SP34">&#167;34. Post-processing</a></li></ul><hr class="tocbar">
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. Formats. </b>Exactly as in the previous chapter, each format expresses its behaviour
through optional method calls.
@ -62,7 +62,7 @@ through optional method calls.
<p class="endnote">The function Formats::create_weave_format is used in 5/ptf (<a href="5-ptf.html#SP1">&#167;1</a>), 5/tf (<a href="5-tf.html#SP1_1">&#167;1.1</a>, <a href="5-tf.html#SP1_2">&#167;1.2</a>, <a href="5-tf.html#SP1_3">&#167;1.3</a>), 5/hf (<a href="5-hf.html#SP1_1">&#167;1.1</a>, <a href="5-hf.html#SP1_2">&#167;1.2</a>).</p>
<p class="endnote">The function Formats::find_by_name is used in <a href="#SP33">&#167;33</a>, 1/ptt (<a href="1-ptt.html#SP3_2">&#167;3.2</a>).</p>
<p class="endnote">The function Formats::find_by_name is used in <a href="#SP36">&#167;36</a>, 1/ptt (<a href="1-ptt.html#SP3_2">&#167;3.2</a>).</p>
<p class="endnote">The structure weave_format is accessed in 3/ts and here.</p>
@ -212,7 +212,7 @@ interstitial material. This is how:
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::chapter_title_page is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_10">&#167;1.3.3.1.10</a>).</p>
<p class="endnote">The function Formats::chapter_title_page is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_10">&#167;1.3.4.1.10</a>).</p>
<p class="inwebparagraph"><a id="SP8"></a><b>&#167;8. </b>The <code class="display"><span class="extract">SUBHEADING_FOR_MTID</span></code> method is expected to produce subheadings of
two levels of importance, where <code class="display"><span class="extract">level</span></code> is
@ -246,7 +246,7 @@ some supplementary text, used in some cases for running heads.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::subheading is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_3">&#167;1.3.3.1.3</a>, <a href="3-tw.html#SP1_3_3_1_6">&#167;1.3.3.1.6</a>, <a href="3-tw.html#SP1_3_3_1_10_3_1">&#167;1.3.3.1.10.3.1</a>).</p>
<p class="endnote">The function Formats::subheading is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_3">&#167;1.3.4.1.3</a>, <a href="3-tw.html#SP1_3_4_1_6">&#167;1.3.4.1.6</a>, <a href="3-tw.html#SP1_3_4_1_10_3_1">&#167;1.3.4.1.10.3.1</a>).</p>
<p class="inwebparagraph"><a id="SP9"></a><b>&#167;9. </b>And now we do paragraph headings. This method has rather a lot of
arguments, but for most formats, some can be ignored. In particular
@ -286,7 +286,7 @@ the benefit of the TeX format, and all other formats can leave them be.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::paragraph_heading is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_10">&#167;1.3.3.1.10</a>).</p>
<p class="endnote">The function Formats::paragraph_heading is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_10">&#167;1.3.4.1.10</a>).</p>
<p class="inwebparagraph"><a id="SP10"></a><b>&#167;10. </b>The following method is expected to weave a piece of code, which has already
been syntax-coloured; there can also be some indentation, and perhaps even some
@ -316,7 +316,7 @@ been syntax-coloured; there can also be some indentation, and perhaps even some
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::source_code is used in <a href="#SP11">&#167;11</a>, 3/tw (<a href="3-tw.html#SP1_3_3_1_8_4">&#167;1.3.3.1.8.4</a>, <a href="3-tw.html#SP1_3_3_1_9">&#167;1.3.3.1.9</a>, <a href="3-tw.html#SP1_3_3_1_9_6">&#167;1.3.3.1.9.6</a>).</p>
<p class="endnote">The function Formats::source_code is used in <a href="#SP11">&#167;11</a>, 3/tw (<a href="3-tw.html#SP1_3_4_1_8_4">&#167;1.3.4.1.8.4</a>, <a href="3-tw.html#SP1_3_4_1_9">&#167;1.3.4.1.9</a>, <a href="3-tw.html#SP1_3_4_1_9_6">&#167;1.3.4.1.9.6</a>).</p>
<p class="inwebparagraph"><a id="SP11"></a><b>&#167;11. </b>More primitively, this method weaves a piece of code which has been coloured
drably in a uniform <code class="display"><span class="extract">EXTRACT_COLOUR</span></code> colour. This is used for weaving words like
@ -343,7 +343,7 @@ drably in a uniform <code class="display"><span class="extract">EXTRACT_COLOUR</
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::source_fragment is used in <a href="#SP24">&#167;24</a>.</p>
<p class="endnote">The function Formats::source_fragment is used in <a href="#SP27">&#167;27</a>.</p>
<p class="inwebparagraph"><a id="SP12"></a><b>&#167;12. </b>And this weaves a URL, hyperlinking it where possible.
</p>
@ -369,9 +369,85 @@ drably in a uniform <code class="display"><span class="extract">EXTRACT_COLOUR</
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::url is used in <a href="#SP24_2">&#167;24.2</a>, <a href="#SP24_3_1">&#167;24.3.1</a>, 5/hf (<a href="5-hf.html#SP10_1">&#167;10.1</a>, <a href="5-hf.html#SP10_2_1">&#167;10.2.1</a>).</p>
<p class="endnote">The function Formats::url is used in <a href="#SP27_2">&#167;27.2</a>, <a href="#SP27_4_1">&#167;27.4.1</a>, 5/hf (<a href="5-hf.html#SP10_1">&#167;10.1</a>, <a href="5-hf.html#SP10_2_1">&#167;10.2.1</a>).</p>
<p class="inwebparagraph"><a id="SP13"></a><b>&#167;13. </b>This method produces the <code class="display"><span class="extract">&gt;&gt; Example</span></code> bits of example source text, really
<p class="inwebparagraph"><a id="SP13"></a><b>&#167;13. </b>And this weaves a footnote cue.
</p>
<pre class="definitions">
<span class="definitionkeyword">enum</span> <span class="constant">FOOTNOTE_CUE_FOR_MTID</span>
</pre>
<pre class="display">
<span class="identifier">VMETHOD_TYPE</span><span class="plain">(</span><span class="constant">FOOTNOTE_CUE_FOR_MTID</span><span class="plain">, </span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">wf</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">cue</span><span class="plain">)</span>
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Formats::footnote_cue</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">cue</span><span class="plain">) {</span>
<span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">wf</span><span class="plain"> = </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">format</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Methods::provided</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">-&gt;</span><span class="identifier">methods</span><span class="plain">, </span><span class="constant">FOOTNOTE_CUE_FOR_MTID</span><span class="plain">)) {</span>
<span class="identifier">VMETHOD_CALL</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">FOOTNOTE_CUE_FOR_MTID</span><span class="plain">, </span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"[%S]"</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::footnote_cue is used in <a href="#SP27_3">&#167;27.3</a>.</p>
<p class="inwebparagraph"><a id="SP14"></a><b>&#167;14. </b>And this weaves a footnote text opening...
</p>
<pre class="definitions">
<span class="definitionkeyword">enum</span> <span class="constant">BEGIN_FOOTNOTE_TEXT_FOR_MTID</span>
</pre>
<pre class="display">
<span class="identifier">VMETHOD_TYPE</span><span class="plain">(</span><span class="constant">BEGIN_FOOTNOTE_TEXT_FOR_MTID</span><span class="plain">, </span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">wf</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">cue</span><span class="plain">)</span>
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Formats::begin_footnote_text</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">cue</span><span class="plain">) {</span>
<span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">wf</span><span class="plain"> = </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">format</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Methods::provided</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">-&gt;</span><span class="identifier">methods</span><span class="plain">, </span><span class="constant">BEGIN_FOOTNOTE_TEXT_FOR_MTID</span><span class="plain">)) {</span>
<span class="identifier">VMETHOD_CALL</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">BEGIN_FOOTNOTE_TEXT_FOR_MTID</span><span class="plain">, </span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"[%S]. "</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::begin_footnote_text is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_8_5">&#167;1.3.4.1.8.5</a>).</p>
<p class="inwebparagraph"><a id="SP15"></a><b>&#167;15. </b>...bookended by a footnote text closing. The weaver ensures that these occur
in pairs and do not nest.
</p>
<pre class="definitions">
<span class="definitionkeyword">enum</span> <span class="constant">END_FOOTNOTE_TEXT_FOR_MTID</span>
</pre>
<pre class="display">
<span class="identifier">VMETHOD_TYPE</span><span class="plain">(</span><span class="constant">END_FOOTNOTE_TEXT_FOR_MTID</span><span class="plain">, </span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">wf</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">cue</span><span class="plain">)</span>
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Formats::end_footnote_text</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">cue</span><span class="plain">) {</span>
<span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">wf</span><span class="plain"> = </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">format</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Methods::provided</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">-&gt;</span><span class="identifier">methods</span><span class="plain">, </span><span class="constant">END_FOOTNOTE_TEXT_FOR_MTID</span><span class="plain">)) {</span>
<span class="identifier">VMETHOD_CALL</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">END_FOOTNOTE_TEXT_FOR_MTID</span><span class="plain">, </span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"\n"</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::end_footnote_text is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_8_5_1">&#167;1.3.4.1.8.5.1</a>).</p>
<p class="inwebparagraph"><a id="SP16"></a><b>&#167;16. </b>This method produces the <code class="display"><span class="extract">&gt;&gt; Example</span></code> bits of example source text, really
a convenience for Inform 7 code commentary.
</p>
@ -391,9 +467,9 @@ a convenience for Inform 7 code commentary.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::display_line is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_8_1">&#167;1.3.3.1.8.1</a>).</p>
<p class="endnote">The function Formats::display_line is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_8_1">&#167;1.3.4.1.8.1</a>).</p>
<p class="inwebparagraph"><a id="SP14"></a><b>&#167;14. </b><code class="display"><span class="extract">ITEM_FOR_MTID</span></code> produces an item marker in a typical (a), (b), (c), ... sort
<p class="inwebparagraph"><a id="SP17"></a><b>&#167;17. </b><code class="display"><span class="extract">ITEM_FOR_MTID</span></code> produces an item marker in a typical (a), (b), (c), ... sort
of list. <code class="display"><span class="extract">depth</span></code> can be 1 or 2: you can have lists in lists, but not lists in
lists in lists. <code class="display"><span class="extract">label</span></code> is the marker text, e.g., <code class="display"><span class="extract">a</span></code>, <code class="display"><span class="extract">b</span></code>, <code class="display"><span class="extract">c</span></code>, ...; it can
also be empty, in which case the method should move to the matching level of
@ -425,9 +501,9 @@ indentation but not weave any bracketed marker.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::item is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_8_3">&#167;1.3.3.1.8.3</a>).</p>
<p class="endnote">The function Formats::item is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_8_3">&#167;1.3.4.1.8.3</a>).</p>
<p class="inwebparagraph"><a id="SP15"></a><b>&#167;15. </b>The "bar" is a horizontal line across the page, but it's woven only for
<p class="inwebparagraph"><a id="SP18"></a><b>&#167;18. </b>The "bar" is a horizontal line across the page, but it's woven only for
very old webs nowadays. New formats really needn't implement this.
</p>
@ -446,9 +522,9 @@ very old webs nowadays. New formats really needn't implement this.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::bar is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_7">&#167;1.3.3.1.7</a>).</p>
<p class="endnote">The function Formats::bar is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_7">&#167;1.3.4.1.7</a>).</p>
<p class="inwebparagraph"><a id="SP16"></a><b>&#167;16. </b><code class="display"><span class="extract">FIGURE_FOR_MTID</span></code> has to weave a figure, i.e., render an image in some way.
<p class="inwebparagraph"><a id="SP19"></a><b>&#167;19. </b><code class="display"><span class="extract">FIGURE_FOR_MTID</span></code> has to weave a figure, i.e., render an image in some way.
<code class="display"><span class="extract">figname</span></code> should be (the text of) a leafname within the <code class="display"><span class="extract">Figures</span></code> directory
of the web.
</p>
@ -470,9 +546,9 @@ of the web.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::figure is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_2_1">&#167;1.3.3.1.2.1</a>).</p>
<p class="endnote">The function Formats::figure is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_2_1">&#167;1.3.4.1.2.1</a>).</p>
<p class="inwebparagraph"><a id="SP17"></a><b>&#167;17. </b><code class="display"><span class="extract">EMBED_FOR_MTID</span></code> has to embed some Internet-sourced content. <code class="display"><span class="extract">service</span></code>
<p class="inwebparagraph"><a id="SP20"></a><b>&#167;20. </b><code class="display"><span class="extract">EMBED_FOR_MTID</span></code> has to embed some Internet-sourced content. <code class="display"><span class="extract">service</span></code>
here is something like <code class="display"><span class="extract">YouTube</span></code> or <code class="display"><span class="extract">Soundcloud</span></code>, and <code class="display"><span class="extract">ID</span></code> is whatever code
that service uses to identify the video/audio in question.
</p>
@ -494,9 +570,9 @@ that service uses to identify the video/audio in question.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::embed is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_2_2">&#167;1.3.3.1.2.2</a>).</p>
<p class="endnote">The function Formats::embed is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_2_2">&#167;1.3.4.1.2.2</a>).</p>
<p class="inwebparagraph"><a id="SP18"></a><b>&#167;18. </b>This method weaves an angle-bracketed paragraph macro name. <code class="display"><span class="extract">defn</span></code> is set
<p class="inwebparagraph"><a id="SP21"></a><b>&#167;21. </b>This method weaves an angle-bracketed paragraph macro name. <code class="display"><span class="extract">defn</span></code> is set
if and only if this is the place where the macro is defined &mdash; the usual
thing is to render some sort of equals sign after it, if so.
</p>
@ -517,9 +593,9 @@ thing is to render some sort of equals sign after it, if so.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::para_macro is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_9_6">&#167;1.3.3.1.9.6</a>).</p>
<p class="endnote">The function Formats::para_macro is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_9_6">&#167;1.3.4.1.9.6</a>).</p>
<p class="inwebparagraph"><a id="SP19"></a><b>&#167;19. </b>For many formats, page breaks are meaningless, and in that case this method
<p class="inwebparagraph"><a id="SP22"></a><b>&#167;22. </b>For many formats, page breaks are meaningless, and in that case this method
should not be provided. Inweb uses them only for cosmetic benefit (and rarely
at that), so no harm is done if there's no visual indication here.
</p>
@ -539,9 +615,9 @@ at that), so no harm is done if there's no visual indication here.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::pagebreak is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_2">&#167;1.3.3.1.2</a>, <a href="3-tw.html#SP1_3_3_1_10_1">&#167;1.3.3.1.10.1</a>).</p>
<p class="endnote">The function Formats::pagebreak is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_2">&#167;1.3.4.1.2</a>, <a href="3-tw.html#SP1_3_4_1_10_1">&#167;1.3.4.1.10.1</a>).</p>
<p class="inwebparagraph"><a id="SP20"></a><b>&#167;20. </b>"Blank line" here might better be called "vertical skip of some kind". The
<p class="inwebparagraph"><a id="SP23"></a><b>&#167;23. </b>"Blank line" here might better be called "vertical skip of some kind". The
following should render some kind of skip, and may want to take note of whether
this happens in commentary or in code: the <code class="display"><span class="extract">in_comment</span></code> flag provides this
information.
@ -563,9 +639,9 @@ information.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::blank_line is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_8_2">&#167;1.3.3.1.8.2</a>, <a href="3-tw.html#SP1_3_3_1_9_2">&#167;1.3.3.1.9.2</a>).</p>
<p class="endnote">The function Formats::blank_line is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_8_2">&#167;1.3.4.1.8.2</a>, <a href="3-tw.html#SP1_3_4_1_9_2">&#167;1.3.4.1.9.2</a>).</p>
<p class="inwebparagraph"><a id="SP21"></a><b>&#167;21. </b>Another opportunity for vertical tidying-up. At the beginning of a code
<p class="inwebparagraph"><a id="SP24"></a><b>&#167;24. </b>Another opportunity for vertical tidying-up. At the beginning of a code
line which occurs after a run of <code class="display"><span class="extract">@d</span></code> or <code class="display"><span class="extract">@e</span></code> definitions, this method is
called. It can then insert a little vertical gap to separate the code from
the definitions.
@ -586,9 +662,9 @@ the definitions.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::after_definitions is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_9">&#167;1.3.3.1.9</a>).</p>
<p class="endnote">The function Formats::after_definitions is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_9">&#167;1.3.4.1.9</a>).</p>
<p class="inwebparagraph"><a id="SP22"></a><b>&#167;22. </b>This method is called when the weaver changes "material" &mdash; for example,
<p class="inwebparagraph"><a id="SP25"></a><b>&#167;25. </b>This method is called when the weaver changes "material" &mdash; for example,
from <code class="display"><span class="extract">REGULAR_MATERIAL</span></code> to <code class="display"><span class="extract">CODE_MATERIAL</span></code>. The flag <code class="display"><span class="extract">content</span></code> is set if
the line on which this happens contains some content which will then be
woven; it will be clear for blank lines, or lines intercepted by the
@ -613,9 +689,9 @@ weaver and turned into something else (such as list items).
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::change_material is used in 3/tw (<a href="3-tw.html#SP1_3_3_1_1">&#167;1.3.3.1.1</a>, <a href="3-tw.html#SP1_3_3_1_8_3">&#167;1.3.3.1.8.3</a>, <a href="3-tw.html#SP1_3_3_1_8_4">&#167;1.3.3.1.8.4</a>, <a href="3-tw.html#SP1_3_3_1_9_1">&#167;1.3.3.1.9.1</a>, <a href="3-tw.html#SP1_3_3_2">&#167;1.3.3.2</a>).</p>
<p class="endnote">The function Formats::change_material is used in 3/tw (<a href="3-tw.html#SP1_3_4_1_1">&#167;1.3.4.1.1</a>, <a href="3-tw.html#SP1_3_4_1_8_3">&#167;1.3.4.1.8.3</a>, <a href="3-tw.html#SP1_3_4_1_8_4">&#167;1.3.4.1.8.4</a>, <a href="3-tw.html#SP1_3_4_1_9_1">&#167;1.3.4.1.9.1</a>, <a href="3-tw.html#SP1_3_4_2">&#167;1.3.4.2</a>).</p>
<p class="inwebparagraph"><a id="SP23"></a><b>&#167;23. </b>This is called on a change of colour. "Colour" is really a shorthand way
<p class="inwebparagraph"><a id="SP26"></a><b>&#167;26. </b>This is called on a change of colour. "Colour" is really a shorthand way
of saying something more like "style", but seemed less ambiguous. In HTML,
this might trigger a change of CSS span style; in plain text, it would do
nothing.
@ -639,7 +715,7 @@ nothing.
<p class="endnote">The function Formats::change_colour is used in 5/tf (<a href="5-tf.html#SP8_2">&#167;8.2</a>, <a href="5-tf.html#SP15">&#167;15</a>), 5/hf (<a href="5-hf.html#SP10_3">&#167;10.3</a>).</p>
<p class="inwebparagraph"><a id="SP24"></a><b>&#167;24. </b>The following takes text, divides it up at stroke-mark boundaries &mdash;
<p class="inwebparagraph"><a id="SP27"></a><b>&#167;27. </b>The following takes text, divides it up at stroke-mark boundaries &mdash;
that is, <code class="display"><span class="extract">this is inside</span></code>, this is outside &mdash; and sends contiguous pieces
of it either to <code class="display"><span class="extract">Formats::source_fragment</span></code> or <code class="display"><span class="extract">Formats::text_fragment</span></code>
as appropriate.
@ -658,17 +734,18 @@ as appropriate.
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">code_in_comments_notation</span><span class="plain"> =</span>
<span class="functiontext">Bibliographic::get_datum</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">weave_web</span><span class="plain">-&gt;</span><span class="element">md</span><span class="plain">,</span>
<span class="plain">(</span><span class="identifier">comments</span><span class="plain">)?(</span><span class="identifier">I</span><span class="string">"Code In Code Comments Notation"</span><span class="plain">):(</span><span class="identifier">I</span><span class="string">"Code In Commentary Notation"</span><span class="plain">));</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::ne</span><span class="plain">(</span><span class="identifier">code_in_comments_notation</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Off"</span><span class="plain">)) </span>&lt;<span class="cwebmacro">Split text and code extracts</span> <span class="cwebmacronumber">24.1</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::ne</span><span class="plain">(</span><span class="identifier">code_in_comments_notation</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Off"</span><span class="plain">)) </span>&lt;<span class="cwebmacro">Split text and code extracts</span> <span class="cwebmacronumber">27.1</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">within</span><span class="plain"> == </span><span class="constant">FALSE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Recognose hyperlinks</span> <span class="cwebmacronumber">24.2</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">within</span><span class="plain"> == </span><span class="constant">FALSE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Recognose hyperlinks</span> <span class="cwebmacronumber">27.2</span>&gt;<span class="plain">;</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">xref_notation</span><span class="plain"> = </span><span class="functiontext">Bibliographic::get_datum</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">weave_web</span><span class="plain">-&gt;</span><span class="element">md</span><span class="plain">,</span>
<span class="identifier">I</span><span class="string">"Cross-References Notation"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::ne</span><span class="plain">(</span><span class="identifier">xref_notation</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Off"</span><span class="plain">)) </span>&lt;<span class="cwebmacro">Recognise cross-references</span> <span class="cwebmacronumber">24.3</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::ne</span><span class="plain">(</span><span class="identifier">xref_notation</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Off"</span><span class="plain">)) </span>&lt;<span class="cwebmacro">Recognise cross-references</span> <span class="cwebmacronumber">27.4</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">within</span><span class="plain">) {</span>
<span class="functiontext">Formats::source_fragment</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">id</span><span class="plain">);</span>
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
&lt;<span class="cwebmacro">Detect use of footnotes</span> <span class="cwebmacronumber">27.3</span>&gt;<span class="plain">;</span>
<span class="functiontext">Formats::text_fragment</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">id</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="plain">}</span>
@ -676,14 +753,14 @@ as appropriate.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::text is used in 2/tgs (<a href="2-tgs.html#SP7">&#167;7</a>, <a href="2-tgs.html#SP7_1">&#167;7.1</a>), 3/tw (<a href="3-tw.html#SP1_3_3_1_8">&#167;1.3.3.1.8</a>, <a href="3-tw.html#SP1_3_3_1_8_4">&#167;1.3.3.1.8.4</a>, <a href="3-tw.html#SP1_3_3_1_10_5">&#167;1.3.3.1.10.5</a>, <a href="3-tw.html#SP2_1">&#167;2.1</a>, <a href="3-tw.html#SP2_2">&#167;2.2</a>, <a href="3-tw.html#SP2_2_1">&#167;2.2.1</a>, <a href="3-tw.html#SP2_3">&#167;2.3</a>), 5/ptf (<a href="5-ptf.html#SP3">&#167;3</a>), 5/tf (<a href="5-tf.html#SP4">&#167;4</a>), 5/hf (<a href="5-hf.html#SP7">&#167;7</a>).</p>
<p class="endnote">The function Formats::text is used in 2/tgs (<a href="2-tgs.html#SP7">&#167;7</a>, <a href="2-tgs.html#SP7_1">&#167;7.1</a>), 3/tw (<a href="3-tw.html#SP1_3_4_1_8">&#167;1.3.4.1.8</a>, <a href="3-tw.html#SP1_3_4_1_8_4">&#167;1.3.4.1.8.4</a>, <a href="3-tw.html#SP1_3_4_1_10_5">&#167;1.3.4.1.10.5</a>, <a href="3-tw.html#SP2_1">&#167;2.1</a>, <a href="3-tw.html#SP2_2">&#167;2.2</a>, <a href="3-tw.html#SP2_2_1">&#167;2.2.1</a>, <a href="3-tw.html#SP2_3">&#167;2.3</a>), 5/ptf (<a href="5-ptf.html#SP3">&#167;3</a>), 5/tf (<a href="5-tf.html#SP4">&#167;4</a>), 5/hf (<a href="5-hf.html#SP7">&#167;7</a>).</p>
<p class="endnote">The function Formats::text_comment is used in 5/tf (<a href="5-tf.html#SP24_2">&#167;24.2</a>), 5/hf (<a href="5-hf.html#SP10">&#167;10</a>).</p>
<p class="endnote">The function Formats::text_r is used in <a href="#SP24_1">&#167;24.1</a>, <a href="#SP24_2">&#167;24.2</a>, <a href="#SP24_3_1">&#167;24.3.1</a>.</p>
<p class="endnote">The function Formats::text_r is used in <a href="#SP27_1">&#167;27.1</a>, <a href="#SP27_2">&#167;27.2</a>, <a href="#SP27_3">&#167;27.3</a>, <a href="#SP27_4_1">&#167;27.4.1</a>.</p>
<p class="inwebparagraph"><a id="SP24_1"></a><b>&#167;24.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Split text and code extracts</span> <span class="cwebmacronumber">24.1</span>&gt; =
<p class="inwebparagraph"><a id="SP27_1"></a><b>&#167;27.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Split text and code extracts</span> <span class="cwebmacronumber">27.1</span>&gt; =
</code></p>
@ -707,10 +784,10 @@ as appropriate.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP24">&#167;24</a>.</p>
<p class="endnote">This code is used in <a href="#SP27">&#167;27</a>.</p>
<p class="inwebparagraph"><a id="SP24_2"></a><b>&#167;24.2. </b><code class="display">
&lt;<span class="cwebmacrodefn">Recognose hyperlinks</span> <span class="cwebmacronumber">24.2</span>&gt; =
<p class="inwebparagraph"><a id="SP27_2"></a><b>&#167;27.2. </b><code class="display">
&lt;<span class="cwebmacrodefn">Recognose hyperlinks</span> <span class="cwebmacronumber">27.2</span>&gt; =
</code></p>
@ -739,10 +816,36 @@ as appropriate.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP24">&#167;24</a>.</p>
<p class="endnote">This code is used in <a href="#SP27">&#167;27</a>.</p>
<p class="inwebparagraph"><a id="SP24_3"></a><b>&#167;24.3. </b><code class="display">
&lt;<span class="cwebmacrodefn">Recognise cross-references</span> <span class="cwebmacronumber">24.3</span>&gt; =
<p class="inwebparagraph"><a id="SP27_3"></a><b>&#167;27.3. </b><code class="display">
&lt;<span class="cwebmacrodefn">Detect use of footnotes</span> <span class="cwebmacronumber">27.3</span>&gt; =
</code></p>
<pre class="displaydefn">
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">before</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">cue</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">after</span><span class="plain">);</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">allow</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Parser::detect_footnote</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">weave_web</span><span class="plain">, </span><span class="identifier">id</span><span class="plain">, </span><span class="identifier">before</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">, </span><span class="identifier">after</span><span class="plain">)) {</span>
<span class="identifier">allow</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
<span class="functiontext">Formats::text_r</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">before</span><span class="plain">, </span><span class="identifier">within</span><span class="plain">, </span><span class="identifier">comments</span><span class="plain">);</span>
<span class="functiontext">Formats::footnote_cue</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="functiontext">Formats::text_r</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">after</span><span class="plain">, </span><span class="identifier">within</span><span class="plain">, </span><span class="identifier">comments</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">before</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">cue</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">after</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">allow</span><span class="plain">) </span><span class="reserved">return</span><span class="plain">;</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP27">&#167;27</a>.</p>
<p class="inwebparagraph"><a id="SP27_4"></a><b>&#167;27.4. </b><code class="display">
&lt;<span class="cwebmacrodefn">Recognise cross-references</span> <span class="cwebmacronumber">27.4</span>&gt; =
</code></p>
@ -760,7 +863,7 @@ as appropriate.
<span class="functiontext">Str::substr</span><span class="plain">(</span><span class="identifier">before</span><span class="plain">, </span><span class="functiontext">Str::start</span><span class="plain">(</span><span class="identifier">id</span><span class="plain">), </span><span class="functiontext">Str::at</span><span class="plain">(</span><span class="identifier">id</span><span class="plain">, </span><span class="identifier">i</span><span class="plain">));</span>
<span class="functiontext">Str::substr</span><span class="plain">(</span><span class="identifier">reference</span><span class="plain">, </span><span class="functiontext">Str::at</span><span class="plain">(</span><span class="identifier">id</span><span class="plain">, </span><span class="identifier">i</span><span class="plain"> + </span><span class="identifier">N</span><span class="plain">), </span><span class="functiontext">Str::at</span><span class="plain">(</span><span class="identifier">id</span><span class="plain">, </span><span class="identifier">j</span><span class="plain">));</span>
<span class="functiontext">Str::substr</span><span class="plain">(</span><span class="identifier">after</span><span class="plain">, </span><span class="functiontext">Str::at</span><span class="plain">(</span><span class="identifier">id</span><span class="plain">, </span><span class="identifier">j</span><span class="plain"> + </span><span class="identifier">N</span><span class="plain">), </span><span class="functiontext">Str::end</span><span class="plain">(</span><span class="identifier">id</span><span class="plain">));</span>
&lt;<span class="cwebmacro">Attempt to resolve the cross-reference</span> <span class="cwebmacronumber">24.3.1</span>&gt;<span class="plain">;</span>
&lt;<span class="cwebmacro">Attempt to resolve the cross-reference</span> <span class="cwebmacronumber">27.4.1</span>&gt;<span class="plain">;</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">before</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">reference</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">after</span><span class="plain">);</span>
@ -774,10 +877,10 @@ as appropriate.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP24">&#167;24</a>.</p>
<p class="endnote">This code is used in <a href="#SP27">&#167;27</a>.</p>
<p class="inwebparagraph"><a id="SP24_3_1"></a><b>&#167;24.3.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Attempt to resolve the cross-reference</span> <span class="cwebmacronumber">24.3.1</span>&gt; =
<p class="inwebparagraph"><a id="SP27_4_1"></a><b>&#167;27.4.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Attempt to resolve the cross-reference</span> <span class="cwebmacronumber">27.4.1</span>&gt; =
</code></p>
@ -785,7 +888,7 @@ as appropriate.
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Formats::resolve_reference_in_weave</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">reference</span><span class="plain">,</span>
<span class="identifier">current_weave_line</span><span class="plain">)) {</span>
<span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">current_weave_line</span><span class="plain">)) {</span>
<span class="functiontext">Formats::text_r</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">before</span><span class="plain">, </span><span class="identifier">within</span><span class="plain">, </span><span class="identifier">comments</span><span class="plain">);</span>
<span class="functiontext">Formats::url</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="constant">FALSE</span><span class="plain">);</span>
<span class="functiontext">Formats::text_r</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">after</span><span class="plain">, </span><span class="identifier">within</span><span class="plain">, </span><span class="identifier">comments</span><span class="plain">);</span>
@ -797,9 +900,9 @@ as appropriate.
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP24_3">&#167;24.3</a>.</p>
<p class="endnote">This code is used in <a href="#SP27_4">&#167;27.4</a>.</p>
<p class="inwebparagraph"><a id="SP25"></a><b>&#167;25. </b>The following must decide what a reference like "Chapter 3" should refer
<p class="inwebparagraph"><a id="SP28"></a><b>&#167;28. </b>The following must decide what a reference like "Chapter 3" should refer
to: that is, whether it makes unamgiguous sense, and if so, what URL we should
link to, and what the full text of the link might be.
</p>
@ -843,9 +946,9 @@ link to, and what the full text of the link might be.
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::resolve_reference_in_weave is used in <a href="#SP24_3_1">&#167;24.3.1</a>, 5/hf (<a href="5-hf.html#SP10_2_1">&#167;10.2.1</a>).</p>
<p class="endnote">The function Formats::resolve_reference_in_weave is used in <a href="#SP27_4_1">&#167;27.4.1</a>, 5/hf (<a href="5-hf.html#SP10_2_1">&#167;10.2.1</a>).</p>
<p class="inwebparagraph"><a id="SP26"></a><b>&#167;26. </b><code class="display"><span class="extract">COMMENTARY_TEXT_FOR_MTID</span></code> straightforwardly weaves out a run of contiguous
<p class="inwebparagraph"><a id="SP29"></a><b>&#167;29. </b><code class="display"><span class="extract">COMMENTARY_TEXT_FOR_MTID</span></code> straightforwardly weaves out a run of contiguous
text. Ordinarily, any formulae written in TeX notation (i.e., in dollar signs
used as brackets) will be transmogrified into a plain text paraphrase, but
the <code class="display"><span class="extract">PRESERVE_MATH_MODE_FOR_MTID</span></code> can prevent this. (And of course the TeX
@ -882,9 +985,9 @@ format does, because it wants to keep the formulae in all their glory.)
<p class="inwebparagraph"></p>
<p class="endnote">The function Formats::text_fragment is used in <a href="#SP24">&#167;24</a>.</p>
<p class="endnote">The function Formats::text_fragment is used in <a href="#SP27">&#167;27</a>.</p>
<p class="inwebparagraph"><a id="SP27"></a><b>&#167;27. </b>The weaver has special typographical support for the stand-alone Inform
<p class="inwebparagraph"><a id="SP30"></a><b>&#167;30. </b>The weaver has special typographical support for the stand-alone Inform
document of Preform grammar, and this is the hook for it. Most formats
should ignore it.
</p>
@ -913,7 +1016,7 @@ should ignore it.
<p class="endnote">The function Formats::preform_document is used in 4/is (<a href="4-is.html#SP16">&#167;16</a>).</p>
<p class="inwebparagraph"><a id="SP28"></a><b>&#167;28. </b>When the weaver adds one of its endnotes &mdash; "This function is used in...",
<p class="inwebparagraph"><a id="SP31"></a><b>&#167;31. </b>When the weaver adds one of its endnotes &mdash; "This function is used in...",
or some such &mdash; it calls this method twice, once before the start, with
<code class="display"><span class="extract">end</span></code> set to 1, and once after the end, with <code class="display"><span class="extract">end</span></code> set to 2.
</p>
@ -935,7 +1038,7 @@ or some such &mdash; it calls this method twice, once before the start, with
<p class="endnote">The function Formats::endnote is used in 2/tgs (<a href="2-tgs.html#SP7">&#167;7</a>, <a href="2-tgs.html#SP7_1">&#167;7.1</a>), 3/tw (<a href="3-tw.html#SP2_1">&#167;2.1</a>, <a href="3-tw.html#SP2_2">&#167;2.2</a>, <a href="3-tw.html#SP2_3">&#167;2.3</a>).</p>
<p class="inwebparagraph"><a id="SP29"></a><b>&#167;29. </b>"Locale" here isn't used in the Unix sense. It means text which describes
<p class="inwebparagraph"><a id="SP32"></a><b>&#167;32. </b>"Locale" here isn't used in the Unix sense. It means text which describes
a range of numbered paragraphs, from <code class="display"><span class="extract">par1</span></code> to <code class="display"><span class="extract">par2</span></code>, though <code class="display"><span class="extract">par2</span></code> can
instead be null, in which case the description is of just one para. (This
is often used in endnotes.)
@ -959,7 +1062,7 @@ is often used in endnotes.)
<p class="endnote">The function Formats::locale is used in 3/tw (<a href="3-tw.html#SP2_1">&#167;2.1</a>, <a href="3-tw.html#SP2_2_1">&#167;2.2.1</a>), 5/ptf (<a href="5-ptf.html#SP6">&#167;6</a>).</p>
<p class="inwebparagraph"><a id="SP30"></a><b>&#167;30. </b>And finally: the bottom of the woven file. The <code class="display"><span class="extract">comment</span></code> is, again, not
<p class="inwebparagraph"><a id="SP33"></a><b>&#167;33. </b>And finally: the bottom of the woven file. The <code class="display"><span class="extract">comment</span></code> is, again, not
intended for human eyes, and will be some sort of "End of weave" remark.
</p>
@ -981,7 +1084,7 @@ intended for human eyes, and will be some sort of "End of weave" remark.
<p class="endnote">The function Formats::tail is used in 3/tw (<a href="3-tw.html#SP1_5">&#167;1.5</a>).</p>
<p class="inwebparagraph"><a id="SP31"></a><b>&#167;31. Post-processing. </b>Consider what happens when Inweb makes a PDF, via TeX. The initial weave is
<p class="inwebparagraph"><a id="SP34"></a><b>&#167;34. Post-processing. </b>Consider what happens when Inweb makes a PDF, via TeX. The initial weave is
to a TeX file; it's then "post-processing" which will turn this into a PDF.
The following method calls allow such two-stage formats to function; in
this case, it would be the PDF format which provides the necessary methods
@ -1004,7 +1107,7 @@ to turn TeX into PDF. The important method is this one:
<p class="endnote">The function Formats::post_process_weave is used in 3/ts (<a href="3-ts.html#SP2">&#167;2</a>).</p>
<p class="inwebparagraph"><a id="SP32"></a><b>&#167;32. </b>Optionally, a fancy report can be printed out, to describe what has been
<p class="inwebparagraph"><a id="SP35"></a><b>&#167;35. </b>Optionally, a fancy report can be printed out, to describe what has been
done:
</p>
@ -1024,7 +1127,7 @@ done:
<p class="endnote">The function Formats::report_on_post_processing is used in 3/ts (<a href="3-ts.html#SP2_3">&#167;2.3</a>).</p>
<p class="inwebparagraph"><a id="SP33"></a><b>&#167;33. </b>After post-processing, an index file is sometimes needed. For example, if a
<p class="inwebparagraph"><a id="SP36"></a><b>&#167;36. </b>After post-processing, an index file is sometimes needed. For example, if a
big web is woven to a swarm of PDFs, one for each section, then we also want
to make an index page in HTML which provides annotated links to those PDFs.
</p>
@ -1049,7 +1152,7 @@ to make an index page in HTML which provides annotated links to those PDFs.
<p class="endnote">The function Formats::index_pdfs appears nowhere else.</p>
<p class="inwebparagraph"><a id="SP34"></a><b>&#167;34. </b>And in that index file, we may want to substitute in values for placeholder
<p class="inwebparagraph"><a id="SP37"></a><b>&#167;37. </b>And in that index file, we may want to substitute in values for placeholder
text like <code class="display"><span class="extract">[[PDF Size]]</span></code> in the template file. This is the <code class="display"><span class="extract">detail</span></code>.
</p>

View file

@ -27,7 +27,7 @@
<!--Weave of 'HTML Formats' generated by 7-->
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="index.html">inweb</a></li><li><a href="index.html#5">Chapter 5: Formats</a></li><li><b>HTML Formats</b></li></ul><p class="purpose">To provide for weaving into HTML and into EPUB books.</p>
<ul class="toc"><li><a href="#SP2">&#167;2. Current state</a></li><li><a href="#SP6">&#167;6. Methods</a></li><li><a href="#SP29">&#167;29. EPUB-only methods</a></li></ul><hr class="tocbar">
<ul class="toc"><li><a href="#SP2">&#167;2. Current state</a></li><li><a href="#SP6">&#167;6. Methods</a></li><li><a href="#SP32">&#167;32. EPUB-only methods</a></li></ul><hr class="tocbar">
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. </b></p>
@ -87,6 +87,9 @@
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">SOURCE_CODE_FOR_MTID</span><span class="plain">, </span><span class="functiontext">HTMLFormat::source_code</span><span class="plain">);</span>
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">INLINE_CODE_FOR_MTID</span><span class="plain">, </span><span class="functiontext">HTMLFormat::inline_code</span><span class="plain">);</span>
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">URL_FOR_MTID</span><span class="plain">, </span><span class="functiontext">HTMLFormat::url</span><span class="plain">);</span>
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">FOOTNOTE_CUE_FOR_MTID</span><span class="plain">, </span><span class="functiontext">HTMLFormat::footnote_cue</span><span class="plain">);</span>
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">BEGIN_FOOTNOTE_TEXT_FOR_MTID</span><span class="plain">, </span><span class="functiontext">HTMLFormat::begin_footnote_text</span><span class="plain">);</span>
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">END_FOOTNOTE_TEXT_FOR_MTID</span><span class="plain">, </span><span class="functiontext">HTMLFormat::end_footnote_text</span><span class="plain">);</span>
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">DISPLAY_LINE_FOR_MTID</span><span class="plain">, </span><span class="functiontext">HTMLFormat::display_line</span><span class="plain">);</span>
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">ITEM_FOR_MTID</span><span class="plain">, </span><span class="functiontext">HTMLFormat::item</span><span class="plain">);</span>
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">BAR_FOR_MTID</span><span class="plain">, </span><span class="functiontext">HTMLFormat::bar</span><span class="plain">);</span>
@ -151,13 +154,13 @@ but in fact that's fine here.)
<p class="inwebparagraph"></p>
<p class="endnote">The function HTMLFormat::p is used in <a href="#SP7">&#167;7</a>, <a href="#SP9">&#167;9</a>, <a href="#SP11">&#167;11</a>, <a href="#SP13">&#167;13</a>, <a href="#SP20">&#167;20</a>, <a href="#SP21">&#167;21</a>, <a href="#SP23">&#167;23</a>, <a href="#SP24">&#167;24</a>.</p>
<p class="endnote">The function HTMLFormat::p is used in <a href="#SP7">&#167;7</a>, <a href="#SP9">&#167;9</a>, <a href="#SP11">&#167;11</a>, <a href="#SP16">&#167;16</a>, <a href="#SP23">&#167;23</a>, <a href="#SP24">&#167;24</a>, <a href="#SP26">&#167;26</a>, <a href="#SP27">&#167;27</a>.</p>
<p class="endnote">The function HTMLFormat::cp is used in <a href="#SP4">&#167;4</a>, <a href="#SP7">&#167;7</a>, <a href="#SP13">&#167;13</a>, <a href="#SP23">&#167;23</a>.</p>
<p class="endnote">The function HTMLFormat::cp is used in <a href="#SP4">&#167;4</a>, <a href="#SP7">&#167;7</a>, <a href="#SP16">&#167;16</a>, <a href="#SP26">&#167;26</a>.</p>
<p class="endnote">The function HTMLFormat::pre is used in <a href="#SP21">&#167;21</a>.</p>
<p class="endnote">The function HTMLFormat::pre is used in <a href="#SP24">&#167;24</a>.</p>
<p class="endnote">The function HTMLFormat::cpre is used in <a href="#SP4">&#167;4</a>, <a href="#SP21">&#167;21</a>.</p>
<p class="endnote">The function HTMLFormat::cpre is used in <a href="#SP4">&#167;4</a>, <a href="#SP24">&#167;24</a>.</p>
<p class="inwebparagraph"><a id="SP3"></a><b>&#167;3. </b>Depth 1 means "inside a list entry"; depth 2, "inside an entry of a list
which is itself inside a list entry"; and so on.
@ -189,7 +192,7 @@ which is itself inside a list entry"; and so on.
<p class="inwebparagraph"></p>
<p class="endnote">The function HTMLFormat::go_to_depth is used in <a href="#SP4">&#167;4</a>, <a href="#SP14">&#167;14</a>.</p>
<p class="endnote">The function HTMLFormat::go_to_depth is used in <a href="#SP4">&#167;4</a>, <a href="#SP17">&#167;17</a>.</p>
<p class="inwebparagraph"><a id="SP4"></a><b>&#167;4. </b>The following generically gets us out of whatever we're currently into:
</p>
@ -206,7 +209,7 @@ which is itself inside a list entry"; and so on.
<p class="inwebparagraph"></p>
<p class="endnote">The function HTMLFormat::exit_current_paragraph is used in <a href="#SP3">&#167;3</a>, <a href="#SP7">&#167;7</a>, <a href="#SP8">&#167;8</a>, <a href="#SP9">&#167;9</a>, <a href="#SP13">&#167;13</a>, <a href="#SP15">&#167;15</a>, <a href="#SP16">&#167;16</a>, <a href="#SP17">&#167;17</a>, <a href="#SP19">&#167;19</a>, <a href="#SP20">&#167;20</a>, <a href="#SP21">&#167;21</a>, <a href="#SP23">&#167;23</a>, <a href="#SP27">&#167;27</a>.</p>
<p class="endnote">The function HTMLFormat::exit_current_paragraph is used in <a href="#SP3">&#167;3</a>, <a href="#SP7">&#167;7</a>, <a href="#SP8">&#167;8</a>, <a href="#SP9">&#167;9</a>, <a href="#SP16">&#167;16</a>, <a href="#SP18">&#167;18</a>, <a href="#SP19">&#167;19</a>, <a href="#SP20">&#167;20</a>, <a href="#SP22">&#167;22</a>, <a href="#SP23">&#167;23</a>, <a href="#SP24">&#167;24</a>, <a href="#SP26">&#167;26</a>, <a href="#SP30">&#167;30</a>.</p>
<p class="inwebparagraph"><a id="SP5"></a><b>&#167;5. </b>"Breadcrumbs" are the chain of links in a horizontal list at the top of
the page, and this drops one.
@ -560,7 +563,7 @@ the page, and this drops one.
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Formats::resolve_reference_in_weave</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">reference</span><span class="plain">,</span>
<span class="identifier">current_weave_line</span><span class="plain">)) {</span>
<span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">current_weave_line</span><span class="plain">)) {</span>
<span class="functiontext">Formats::url</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="constant">FALSE</span><span class="plain">);</span>
<span class="identifier">i</span><span class="plain"> = </span><span class="identifier">j</span><span class="plain"> + </span><span class="identifier">N</span><span class="plain">;</span>
<span class="plain">}</span>
@ -624,6 +627,58 @@ the page, and this drops one.
<p class="inwebparagraph"><a id="SP13"></a><b>&#167;13. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::footnote_cue</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">cue</span><span class="plain">) {</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">fn_plugin_name</span><span class="plain"> =</span>
<span class="functiontext">Bibliographic::get_datum</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">weave_web</span><span class="plain">-&gt;</span><span class="element">md</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Footnotes Plugin"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::ne_insensitive</span><span class="plain">(</span><span class="identifier">fn_plugin_name</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"None"</span><span class="plain">))</span>
<span class="functiontext">Swarm::ensure_plugin</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">fn_plugin_name</span><span class="plain">);</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"&lt;sup id=\"fnref:%S\"&gt;&lt;a href=\"#fn:%S\" rel=\"footnote\"&gt;%S&lt;/a&gt;&lt;/sup&gt;"</span><span class="plain">,</span>
<span class="identifier">cue</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The function HTMLFormat::footnote_cue is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP14"></a><b>&#167;14. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::begin_footnote_text</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">cue</span><span class="plain">) {</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">fn_plugin_name</span><span class="plain"> =</span>
<span class="functiontext">Bibliographic::get_datum</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">weave_web</span><span class="plain">-&gt;</span><span class="element">md</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Footnotes Plugin"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::ne_insensitive</span><span class="plain">(</span><span class="identifier">fn_plugin_name</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"None"</span><span class="plain">))</span>
<span class="functiontext">Swarm::ensure_plugin</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">fn_plugin_name</span><span class="plain">);</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"&lt;li class=\"footnote\" id=\"fn:%S\"&gt;&lt;p&gt;"</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The function HTMLFormat::begin_footnote_text is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP15"></a><b>&#167;15. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::end_footnote_text</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">cue</span><span class="plain">) {</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">fn_plugin_name</span><span class="plain"> =</span>
<span class="functiontext">Bibliographic::get_datum</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">weave_web</span><span class="plain">-&gt;</span><span class="element">md</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Footnotes Plugin"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::ne_insensitive</span><span class="plain">(</span><span class="identifier">fn_plugin_name</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"None"</span><span class="plain">))</span>
<span class="functiontext">Swarm::ensure_plugin</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">fn_plugin_name</span><span class="plain">);</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"&lt;a href=\"#fnref:%S\" title=\"return to text\"&gt; &amp;#x21A9;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;"</span><span class="plain">, </span><span class="identifier">cue</span><span class="plain">);</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The function HTMLFormat::end_footnote_text is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP16"></a><b>&#167;16. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::display_line</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">from</span><span class="plain">) {</span>
@ -640,7 +695,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::display_line is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP14"></a><b>&#167;14. </b></p>
<p class="inwebparagraph"><a id="SP17"></a><b>&#167;17. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::item</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">, </span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">depth</span><span class="plain">,</span>
@ -656,7 +711,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::item is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP15"></a><b>&#167;15. </b></p>
<p class="inwebparagraph"><a id="SP18"></a><b>&#167;18. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::bar</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">) {</span>
@ -669,7 +724,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::bar is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP16"></a><b>&#167;16. </b></p>
<p class="inwebparagraph"><a id="SP19"></a><b>&#167;19. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::figure</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
@ -691,7 +746,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::figure is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP17"></a><b>&#167;17. </b></p>
<p class="inwebparagraph"><a id="SP20"></a><b>&#167;20. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::embed</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
@ -718,7 +773,7 @@ the page, and this drops one.
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">embed_leaf</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">TextFiles::exists</span><span class="plain">(</span><span class="identifier">F</span><span class="plain">) == </span><span class="constant">FALSE</span><span class="plain">) {</span>
<span class="functiontext">Main::error_in_web</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"This is not a supported service"</span><span class="plain">, </span><span class="identifier">current_weave_line</span><span class="plain">);</span>
<span class="functiontext">Main::error_in_web</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"This is not a supported service"</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-&gt;</span><span class="element">current_weave_line</span><span class="plain">);</span>
<span class="reserved">return</span><span class="plain">;</span>
<span class="plain">}</span>
@ -737,7 +792,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::embed is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP18"></a><b>&#167;18. </b></p>
<p class="inwebparagraph"><a id="SP21"></a><b>&#167;21. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::para_macro</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
@ -759,7 +814,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::para_macro is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP19"></a><b>&#167;19. </b></p>
<p class="inwebparagraph"><a id="SP22"></a><b>&#167;22. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::pagebreak</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">) {</span>
@ -771,7 +826,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::pagebreak is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP20"></a><b>&#167;20. </b></p>
<p class="inwebparagraph"><a id="SP23"></a><b>&#167;23. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::blank_line</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
@ -791,7 +846,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::blank_line is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP21"></a><b>&#167;21. </b></p>
<p class="inwebparagraph"><a id="SP24"></a><b>&#167;24. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::change_material</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
@ -867,7 +922,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::change_material is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP22"></a><b>&#167;22. </b></p>
<p class="inwebparagraph"><a id="SP25"></a><b>&#167;25. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::change_colour</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
@ -895,7 +950,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::change_colour is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP23"></a><b>&#167;23. </b></p>
<p class="inwebparagraph"><a id="SP26"></a><b>&#167;26. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::endnote</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">, </span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">end</span><span class="plain">) {</span>
@ -912,7 +967,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::endnote is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP24"></a><b>&#167;24. </b></p>
<p class="inwebparagraph"><a id="SP27"></a><b>&#167;27. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::commentary_text</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
@ -940,7 +995,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::commentary_text is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP25"></a><b>&#167;25. </b></p>
<p class="inwebparagraph"><a id="SP28"></a><b>&#167;28. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::locale</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
@ -961,7 +1016,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::locale is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP26"></a><b>&#167;26. </b></p>
<p class="inwebparagraph"><a id="SP29"></a><b>&#167;29. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::section_URL</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">, </span><span class="reserved">section</span><span class="plain"> *</span><span class="identifier">from</span><span class="plain">) {</span>
@ -999,11 +1054,11 @@ the page, and this drops one.
<p class="inwebparagraph"></p>
<p class="endnote">The function HTMLFormat::section_URL is used in 5/fm (<a href="5-fm.html#SP25">&#167;25</a>).</p>
<p class="endnote">The function HTMLFormat::section_URL is used in 5/fm (<a href="5-fm.html#SP28">&#167;28</a>).</p>
<p class="endnote">The function HTMLFormat::xref is used in <a href="#SP8">&#167;8</a>, <a href="#SP9">&#167;9</a>, <a href="#SP25">&#167;25</a>.</p>
<p class="endnote">The function HTMLFormat::xref is used in <a href="#SP8">&#167;8</a>, <a href="#SP9">&#167;9</a>, <a href="#SP28">&#167;28</a>.</p>
<p class="inwebparagraph"><a id="SP27"></a><b>&#167;27. </b></p>
<p class="inwebparagraph"><a id="SP30"></a><b>&#167;30. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::tail</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
@ -1057,7 +1112,7 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::tail is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP28"></a><b>&#167;28. </b></p>
<p class="inwebparagraph"><a id="SP31"></a><b>&#167;31. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::sref</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">, </span><span class="reserved">section</span><span class="plain"> *</span><span class="identifier">S</span><span class="plain">) {</span>
@ -1073,9 +1128,9 @@ the page, and this drops one.
<p class="inwebparagraph"></p>
<p class="endnote">The function HTMLFormat::sref is used in <a href="#SP27">&#167;27</a>.</p>
<p class="endnote">The function HTMLFormat::sref is used in <a href="#SP30">&#167;30</a>.</p>
<p class="inwebparagraph"><a id="SP29"></a><b>&#167;29. EPUB-only methods. </b></p>
<p class="inwebparagraph"><a id="SP32"></a><b>&#167;32. EPUB-only methods. </b></p>
<pre class="display">
<span class="reserved">int</span><span class="plain"> </span><span class="functiontext">HTMLFormat::begin_weaving_EPUB</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">wf</span><span class="plain">, </span><span class="reserved">web</span><span class="plain"> *</span><span class="identifier">W</span><span class="plain">, </span><span class="reserved">weave_pattern</span><span class="plain"> *</span><span class="identifier">pattern</span><span class="plain">) {</span>

View file

@ -865,7 +865,7 @@ To do this, the weaver calls the following.
<p class="inwebparagraph"></p>
<p class="endnote">The function TeX::remove_math_mode is used in 5/fm (<a href="5-fm.html#SP26">&#167;26</a>).</p>
<p class="endnote">The function TeX::remove_math_mode is used in 5/fm (<a href="5-fm.html#SP29">&#167;29</a>).</p>
<p class="endnote">The function TeX::remove_math_mode_range is used in <a href="#SP28_1">&#167;28.1</a>, <a href="#SP28_2">&#167;28.2</a>, <a href="#SP28_3">&#167;28.3</a>.</p>

View file

@ -53,14 +53,19 @@
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">WeavePlugins::include</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">web</span><span class="plain"> *</span><span class="identifier">W</span><span class="plain">, </span><span class="reserved">weave_plugin</span><span class="plain"> *</span><span class="identifier">wp</span><span class="plain">,</span>
<span class="reserved">weave_pattern</span><span class="plain"> *</span><span class="identifier">pattern</span><span class="plain">) {</span>
<span class="reserved">pathname</span><span class="plain"> *</span><span class="identifier">P1</span><span class="plain"> = </span><span class="functiontext">Pathnames::subfolder</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">-&gt;</span><span class="element">md</span><span class="plain">-&gt;</span><span class="element">path_to_web</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Plugins"</span><span class="plain">);</span>
<span class="reserved">pathname</span><span class="plain"> *</span><span class="identifier">P2</span><span class="plain"> = </span><span class="functiontext">Pathnames::subfolder</span><span class="plain">(</span><span class="identifier">path_to_inweb</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Plugins"</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">embed_leaf</span><span class="plain">);</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">css_leaf</span><span class="plain">);</span>
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">embed_leaf</span><span class="plain">, </span><span class="string">"%S.html"</span><span class="plain">, </span><span class="identifier">wp</span><span class="plain">-&gt;</span><span class="element">plugin_name</span><span class="plain">);</span>
<span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">F</span><span class="plain"> = </span><span class="functiontext">Filenames::in_folder</span><span class="plain">(</span>
<span class="functiontext">Pathnames::subfolder</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">-&gt;</span><span class="element">md</span><span class="plain">-&gt;</span><span class="element">path_to_web</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Plugins"</span><span class="plain">), </span><span class="identifier">embed_leaf</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">TextFiles::exists</span><span class="plain">(</span><span class="identifier">F</span><span class="plain">) == </span><span class="constant">FALSE</span><span class="plain">)</span>
<span class="identifier">F</span><span class="plain"> = </span><span class="functiontext">Filenames::in_folder</span><span class="plain">(</span>
<span class="functiontext">Pathnames::subfolder</span><span class="plain">(</span><span class="identifier">path_to_inweb</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Plugins"</span><span class="plain">), </span><span class="identifier">embed_leaf</span><span class="plain">);</span>
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">css_leaf</span><span class="plain">, </span><span class="string">"%S.css"</span><span class="plain">, </span><span class="identifier">wp</span><span class="plain">-&gt;</span><span class="identifier">plugin_name</span><span class="plain">);</span>
<span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">F</span><span class="plain"> = </span><span class="identifier">P1</span><span class="plain">?(</span><span class="functiontext">Filenames::in_folder</span><span class="plain">(</span><span class="identifier">P1</span><span class="plain">, </span><span class="identifier">embed_leaf</span><span class="plain">)):</span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">TextFiles::exists</span><span class="plain">(</span><span class="identifier">F</span><span class="plain">) == </span><span class="constant">FALSE</span><span class="plain">) </span><span class="identifier">F</span><span class="plain"> = </span><span class="identifier">P2</span><span class="plain">?(</span><span class="functiontext">Filenames::in_folder</span><span class="plain">(</span><span class="identifier">P2</span><span class="plain">, </span><span class="identifier">embed_leaf</span><span class="plain">)):</span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">CF</span><span class="plain"> = </span><span class="identifier">P1</span><span class="plain">?(</span><span class="functiontext">Filenames::in_folder</span><span class="plain">(</span><span class="identifier">P1</span><span class="plain">, </span><span class="identifier">css_leaf</span><span class="plain">)):</span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">TextFiles::exists</span><span class="plain">(</span><span class="identifier">CF</span><span class="plain">) == </span><span class="constant">FALSE</span><span class="plain">) </span><span class="identifier">CF</span><span class="plain"> = </span><span class="identifier">P2</span><span class="plain">?(</span><span class="functiontext">Filenames::in_folder</span><span class="plain">(</span><span class="identifier">P2</span><span class="plain">, </span><span class="identifier">css_leaf</span><span class="plain">)):</span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">embed_leaf</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">css_leaf</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">TextFiles::exists</span><span class="plain">(</span><span class="identifier">F</span><span class="plain">) == </span><span class="constant">FALSE</span><span class="plain">) {</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">err</span><span class="plain">);</span>
@ -69,6 +74,11 @@
<span class="reserved">return</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="functiontext">Indexer::run</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">, </span><span class="identifier">I</span><span class="string">""</span><span class="plain">, </span><span class="identifier">F</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">pattern</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="constant">FALSE</span><span class="plain">, </span><span class="constant">TRUE</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">TextFiles::exists</span><span class="plain">(</span><span class="identifier">CF</span><span class="plain">)) {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"&lt;link href=\"%S.css\" rel=\"stylesheet\" rev=\"stylesheet\" type=\"text/css\"&gt;\n"</span><span class="plain">,</span>
<span class="identifier">wp</span><span class="plain">-&gt;</span><span class="element">plugin_name</span><span class="plain">);</span>
<span class="functiontext">Patterns::copy_file_into_weave</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">, </span><span class="identifier">CF</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="plain">}</span>
</pre>

352
docs/inweb/Bigfoot.css Normal file
View file

@ -0,0 +1,352 @@
.bigfoot-footnote__button {
position: relative;
z-index: 5;
top: -0.1em;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-moz-box-sizing: border-box;
display: inline-block;
padding: 0.35em;
margin: 0 0.1em 0 0.2em;
border: none;
border-radius: 0.3em;
cursor: pointer;
background-color: rgba(110, 110, 110, 0.2);
-webkit-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
font-size: 1rem;
line-height: 0;
vertical-align: middle;
text-decoration: none;
font-smoothing: antialiased;
-webkit-transition-property: background-color;
transition-property: background-color;
-webkit-transition-duration: 0.25s;
transition-duration: 0.25s;
}
.bigfoot-footnote__button:hover,
.bigfoot-footnote__button:focus {
outline: none;
background-color: rgba(110, 110, 110, 0.5);
}
.bigfoot-footnote__button:active {
background-color: rgba(110, 110, 110, 0.5);
}
.bigfoot-footnote__button.is-active {
background-color: #6e6e6e;
-webkit-transition-delay: 0.1s;
transition-delay: 0.1s;
}
.bigfoot-footnote__button:after {
content: '';
display: table;
clear: both;
}
.bigfoot-footnote__button__circle {
display: inline-block;
width: 0.25em;
height: 0.25em;
margin-right: 0.25em;
float: left;
}
.bigfoot-footnote__button__circle:last-child {
margin-right: 0;
}
.bigfoot-footnote__container {
display: inline-block;
position: relative;
text-indent: 0;
}
@media not print {
.footnote-print-only {
display: none !important;
}
}
@media print {
.bigfoot-footnote,
.bigfoot-footnote__button {
display: none !important;
}
}
.bigfoot-footnote {
position: absolute;
z-index: 10;
top: 0;
left: 0;
display: inline-block;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
max-width: 90%;
margin: 1.96924em 0;
background: #fafafa;
opacity: 0;
border-radius: 0.5em;
border: 1px solid #c3c3c3;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
line-height: 0;
-webkit-transition-property: opacity, -webkit-transform;
transition-property: opacity, transform;
-webkit-transition-duration: 0.25s;
transition-duration: 0.25s;
-webkit-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transform: scale(0.1) translateZ(0);
-ms-transform: scale(0.1) translateZ(0);
transform: scale(0.1) translateZ(0);
-webkit-transform-origin: 50% 0;
-ms-transform-origin: 50% 0;
transform-origin: 50% 0;
}
.bigfoot-footnote.is-positioned-top {
top: auto;
bottom: 0;
}
.bigfoot-footnote.is-active {
-webkit-transform: scale(1) translateZ(0);
-ms-transform: scale(1) translateZ(0);
transform: scale(1) translateZ(0);
opacity: 0.97;
}
.bigfoot-footnote.is-bottom-fixed {
position: fixed;
bottom: 0;
top: auto;
left: 0;
right: auto;
-webkit-transform: translateY(100%);
-ms-transform: translateY(100%);
transform: translateY(100%);
width: 100%;
margin: 0;
border-radius: 0;
opacity: 1;
border-width: 1px 0 0;
-webkit-transition: -webkit-transform 0.3s ease;
transition: transform 0.3s ease;
}
.bigfoot-footnote.is-bottom-fixed.is-active {
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0);
}
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__wrapper {
margin: 0 0 0 50%;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
max-width: 100%;
}
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__wrapper,
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__content {
border-radius: 0;
}
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__tooltip {
display: none;
}
.bigfoot-footnote.is-scrollable:after {
content: '';
position: absolute;
bottom: 0.3375em;
left: 0.3375em;
z-index: 14;
display: block;
height: 0.78125em;
width: 0.625em;
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTJweCIgaGVpZ2h0PSIxNXB4IiB2aWV3Qm94PSIwIDAgMTIgMTUiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pbllNaW4iPgogICAgPGcgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IkFycm93IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxLjAwMDAwMCwgMS4wMDAwMDApIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiPgogICAgICAgICAgICA8cGF0aCBkPSJNNSwwIEw1LDExLjUiIGlkPSJMaW5lIj48L3BhdGg+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLjUsNy41IEw1LjAyNzY5Mjc5LDEyLjAyNzY5MjgiIGlkPSJMaW5lIj48L3BhdGg+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik00LjUsNy41IEw5LjAyNzY5Mjc5LDEyLjAyNzY5MjgiIGlkPSJMaW5lLTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDcuMDAwMDAwLCAxMC4wMDAwMDApIHNjYWxlKC0xLCAxKSB0cmFuc2xhdGUoLTcuMDAwMDAwLCAtMTAuMDAwMDAwKSAiPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPgo=");
-webkit-background-size: cover;
background-size: cover;
opacity: 0.1;
transition-properties: opacity;
-webkit-transition-duration: 0.25s;
transition-duration: 0.25s;
-webkit-transition-timing-function: ease;
transition-timing-function: ease;
}
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:before,
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:after {
content: '';
position: absolute;
width: 100%;
z-index: 12;
left: 0;
}
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:before {
top: -1px;
height: 1.1em;
border-radius: 0.5em 0.5em 0 0;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fafafa), to(rgba(250, 250, 250, 0)));
background-image: -webkit-linear-gradient(top, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
background-image: linear-gradient(to bottom, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
}
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:after {
bottom: -1px;
height: 1.2em;
border-radius: 0 0 0.5em 0.5em;
background-image: -webkit-gradient(linear, left bottom, left top, from(#fafafa), to(rgba(250, 250, 250, 0)));
background-image: -webkit-linear-gradient(bottom, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
background-image: linear-gradient(to top, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
}
.bigfoot-footnote.is-scrollable ::-webkit-scrollbar {
display: none;
}
.bigfoot-footnote.is-fully-scrolled:after,
.bigfoot-footnote.is-fully-scrolled:before {
opacity: 0;
-webkit-transition-delay: 0;
transition-delay: 0;
}
.bigfoot-footnote__wrapper {
position: relative;
z-index: 14;
width: 22em;
display: inline-block;
-webkit-box-sizing: inherit;
-moz-box-sizing: inherit;
box-sizing: inherit;
overflow: hidden;
margin: 0;
background-color: #fafafa;
border-radius: 0.5em;
line-height: 0;
}
.bigfoot-footnote__content {
position: relative;
z-index: 8;
display: inline-block;
max-height: 15em;
padding: 1.1em 1.3em 1.2em;
-webkit-box-sizing: inherit;
-moz-box-sizing: inherit;
box-sizing: inherit;
overflow: auto;
-webkit-overflow-scrolling: touch;
background: #fafafa;
border-radius: 0.5em;
font-smoothing: subpixel-antialiased;
line-height: normal;
}
.bigfoot-footnote__content img {
max-width: 100%;
}
.bigfoot-footnote__content *:last-child {
margin-bottom: 0 !important;
}
.bigfoot-footnote__content *:first-child {
margin-top: 0 !important;
}
.bigfoot-footnote__tooltip {
position: absolute;
z-index: 12;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-left: -0.65em;
width: 1.3em;
height: 1.3em;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
background: #fafafa;
border: 1px solid #c3c3c3;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
border-top-left-radius: 0;
}
.is-positioned-bottom .bigfoot-footnote__tooltip {
top: -0.65em;
}
.is-positioned-top .bigfoot-footnote__tooltip {
bottom: -0.65em;
}
.bigfoot-footnote__button {
position: relative;
height: 0.95em;
width: 1.5em;
border-radius: 0.475em;
}
.bigfoot-footnote__button:after {
content: attr(data-footnote-number);
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
display: block;
font-size: 0.57em;
font-weight: bold;
color: rgba(0, 0, 0, 0.5);
-webkit-transition: color 0.25s ease;
transition: color 0.25s ease;
}
.bigfoot-footnote__button:hover:after,
.bigfoot-footnote__button.is-active:after {
color: white;
}
.bigfoot-footnote__button__circle {
display: none;
}
/* Dark Mode */
@media (prefers-color-scheme: dark) {
.bigfoot-footnote__content {
color: black;
}
.bigfoot-footnote__button {
background-color: rgba(255, 255, 255, 0.8);
}
}

View file

@ -27,7 +27,7 @@
<!--Weave of 'How to Write a Web' generated by 7-->
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="index.html">inweb</a></li><li><a href="index.html#M">Manual</a></li><li><b>How to Write a Web</b></li></ul><p class="purpose">How to mark up code for literate programming.</p>
<ul class="toc"><li><a href="#SP1">&#167;1. The title of a section</a></li><li><a href="#SP2">&#167;2. Paragraphing</a></li><li><a href="#SP6">&#167;6. Conditional compilation</a></li><li><a href="#SP7">&#167;7. Commentary</a></li><li><a href="#SP12">&#167;12. Code samples and other extraneous matter</a></li><li><a href="#SP13">&#167;13. Links</a></li><li><a href="#SP14">&#167;14. Cross-references</a></li><li><a href="#SP15">&#167;15. Figures</a></li><li><a href="#SP16">&#167;16. Embedded video</a></li><li><a href="#SP19">&#167;19. Mathematics notation</a></li></ul><hr class="tocbar">
<ul class="toc"><li><a href="#SP1">&#167;1. The title of a section</a></li><li><a href="#SP2">&#167;2. Paragraphing</a></li><li><a href="#SP6">&#167;6. Conditional compilation</a></li><li><a href="#SP7">&#167;7. Commentary</a></li><li><a href="#SP12">&#167;12. Code samples and other extraneous matter</a></li><li><a href="#SP13">&#167;13. Links</a></li><li><a href="#SP14">&#167;14. Cross-references</a></li><li><a href="#SP15">&#167;15. Figures</a></li><li><a href="#SP16">&#167;16. Embedded video</a></li><li><a href="#SP19">&#167;19. Mathematics notation</a></li><li><a href="#SP20">&#167;20. Footnotes</a></li></ul><hr class="tocbar">
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. The title of a section. </b>In any section file, there will be a few lines at the top which occur before
the first paragraph of code begins. (The first paragraph begins on the first
@ -729,7 +729,8 @@ be explained carefully. Formulae or equations are a real convenience for that.
algorithm on \(a\) and numbers coprime to \(a\) is:
$$ \tau (a)={\frac {12}{\pi ^{2}}}\ln 2\ln a+C+O(a^{-1/6-\varepsilon }) $$
where \(C\) is Porter's constant,
$$ C=-{\frac {1}{2}}+{\frac {6\ln 2}{\pi ^{2}}}\left(4\gamma -{\frac {24}{\pi ^{2}}}\zeta '(2)+3\ln 2-2\right)\approx 1.467 $$
$$ C=-{\frac {1}{2}}+{\frac {6\ln 2}{\pi ^{2}}}
\left(4\gamma - {\frac {24}{\pi ^{2}}}\zeta'(2)+3\ln 2-2\right)\approx 1.467 $$
which involves evaluating Euler's constant \(\gamma\) and the first derivative
of the Riemann zeta function \(\zeta'(z)\) at \(z=2\).
</p>
@ -743,7 +744,7 @@ of the Riemann zeta function \(\zeta'(z)\) at \(z=2\).
<span class="plain">$$ \tau (a)={\frac {12}{\pi ^{2}}}\ln 2\ln a+C+O(a^{-1/6-\varepsilon }) $$</span>
<span class="plain">where $C$ is Porter's constant,</span>
<span class="plain">$$ C=-{\frac {1}{2}}+{\frac {6\ln 2}{\pi ^{2}}}</span>
<span class="plain">\left(4\gamma -{\frac {24}{\pi^{2}}}\zeta '(2)+3\ln 2-2\right)\approx 1.467 $$</span>
<span class="plain">\left(4\gamma - {\frac {24}{\pi^{2}}}\zeta'(2)+3\ln 2-2\right)\approx 1.467 $$</span>
<span class="plain">which involves evaluating Euler's constant $\gamma$ and the first derivative</span>
<span class="plain">of the Riemann zeta function $\zeta'(z)$ at $z=2$.</span>
</pre>
@ -778,6 +779,71 @@ deactivated entirely by writing the following in the Contents section of a web:
<p class="inwebparagraph">(This is always <code class="display"><span class="extract">On</span></code>, the default, or <code class="display"><span class="extract">Off</span></code>.)
</p>
<p class="inwebparagraph"><a id="SP20"></a><b>&#167;20. Footnotes. </b>Not everyone likes footnotes,<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> but sometimes they're a tidy way to make
references.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>
</p>
<p class="inwebparagraph"><li class="footnote" id="fn:1"><p><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> But see Anthony Grafton, "The Footnote: A Curious History" (Harvard
University Press, 1999).
<a href="#fnref:1" title="return to text"> &#x21A9;</a></p></li><li class="footnote" id="fn:2"><p><sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> For example, to cite Donald Knuth, "Evaluation of Porter's constant",
Computers &amp; Mathematics with Applications, 2, 137-39 (1976).
<a href="#fnref:2" title="return to text"> &#x21A9;</a></p></li></p>
<p class="inwebparagraph"><a id="SP21"></a><b>&#167;21. </b>The content of that sentence was typed as follows:
</p>
<pre class="display">
<span class="plain">Not everyone likes footnotes,[1] but sometimes they're a tidy way to make</span>
<span class="plain">references.[2]</span>
<span class="identifier">[1]</span><span class="plain"> But see Anthony Grafton, "The Footnote: A Curious History" (Harvard</span>
<span class="plain">University Press, 1999).</span>
<span class="identifier">[2]</span><span class="plain"> For example, to cite Donald Knuth, "Evaluation of Porter's constant",</span>
<span class="plain">Computers &amp; Mathematics with Applications, 2, 137-39 (1976).</span>
</pre>
<p class="inwebparagraph">If you're reading this as a web page (with Javascript on), then you should
have seen clickable footnote blobs, which reveal the text. If Javascript is
off, there's a more conventionally textual presentation.
</p>
<p class="inwebparagraph">These blob-footnotes are fine for snarky asides or quick references, but long
discursive notes need more space, so if you intend to use those then you
should probably turn this rendering off altogether:
</p>
<pre class="display">
<span class="element">Footnotes Plugin</span><span class="plain">:</span><span class="string"> None</span>
</pre>
<p class="inwebparagraph">Footnotes are otherwise rendered by the <code class="display"><span class="extract">Bigfoot</span></code> plugin, which is the default
value of this; its big feet unfortunately tread on the <code class="display"><span class="extract">MathJax3</span></code> plugin, so
right now it's not possible to have mathematics in a footnote when <code class="display"><span class="extract">Bigfoot</span></code>
is in use.
</p>
<p class="inwebparagraph"><a id="SP22"></a><b>&#167;22. </b>Once again, notation may be an issue, and so it's controllable. By default,
we have:
</p>
<pre class="display">
<span class="element">Footnote Begins Notation</span><span class="plain">:</span><span class="string"> [</span>
<span class="element">Footnote Ends Notation</span><span class="plain">:</span><span class="string"> ]</span>
</pre>
<p class="inwebparagraph">but if you need squares for something else in your commentary, then perhaps:
</p>
<pre class="display">
<span class="element">Footnote Begins Notation</span><span class="plain">:</span><span class="string"> [fn</span>
<span class="element">Footnote Ends Notation</span><span class="plain">:</span><span class="string"> ]</span>
</pre>
<p class="inwebparagraph">would be sensible. The "cue" between these notations is required to be a
string of digits; each must occur just once in its section; and each must
have a text and a cue which match up correctly.
</p>
<hr class="tocbar">
<ul class="toc"><li><a href="M-wtaw.html">Back to 'Webs, Tangling and Weaving'</a></li><li><a href="M-tid.html">Continue with 'The InC Dialect'</a></li></ul><hr class="tocbar">
<!--End of weave-->
@ -795,6 +861,653 @@ MathJax = {
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>
<script src="http://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script type="text/javascript">
(function() {
(function($) {
return $.bigfoot = function(options) {
var addBreakpoint, baseFontSize, bigfoot, buttonHover, calculatePixelDimension, cleanFootnoteLinks, clickButton, createPopover, defaults, deleteEmptyOrHR, escapeKeypress, footnoteInit, getSetting, makeDefaultCallbacks, popoverStates, positionTooltip, removeBackLinks, removeBreakpoint, removePopovers, replaceWithReferenceAttributes, repositionFeet, roomCalc, settings, touchClick, unhoverFeet, updateSetting, viewportDetails;
bigfoot = void 0;
defaults = {
actionOriginalFN: "hide",
activateCallback: function() {},
activateOnHover: false,
allowMultipleFN: false,
anchorPattern: /(fn|footnote|note)[:\-_\d]/gi,
anchorParentTagname: 'sup',
breakpoints: {},
deleteOnUnhover: false,
footnoteParentClass: 'footnote',
footnoteTagname: 'li',
hoverDelay: 250,
numberResetSelector: void 0,
popoverDeleteDelay: 300,
popoverCreateDelay: 100,
positionContent: true,
preventPageScroll: true,
scope: false,
useFootnoteOnlyOnce: true,
contentMarkup: "<aside class=\"bigfoot-footnote is-positioned-bottom\" data-footnote-number=\"{{FOOTNOTENUM}}\" data-footnote-identifier=\"{{FOOTNOTEID}}\" alt=\"Footnote {{FOOTNOTENUM}}\"> <div class=\"bigfoot-footnote__wrapper\"> <div class=\"bigfoot-footnote__content\"> {{FOOTNOTECONTENT}} </div></div> <div class=\"bigfoot-footnote__tooltip\"></div> </aside>",
buttonMarkup: "<div class='bigfoot-footnote__container'> <button class=\"bigfoot-footnote__button\" id=\"{{SUP:data-footnote-backlink-ref}}\" data-footnote-number=\"{{FOOTNOTENUM}}\" data-footnote-identifier=\"{{FOOTNOTEID}}\" alt=\"See Footnote {{FOOTNOTENUM}}\" rel=\"footnote\" data-bigfoot-footnote=\"{{FOOTNOTECONTENT}}\"> <svg class=\"bigfoot-footnote__button__circle\" viewbox=\"0 0 6 6\" preserveAspectRatio=\"xMinYMin\"><circle r=\"3\" cx=\"3\" cy=\"3\" fill=\"white\"></circle></svg> <svg class=\"bigfoot-footnote__button__circle\" viewbox=\"0 0 6 6\" preserveAspectRatio=\"xMinYMin\"><circle r=\"3\" cx=\"3\" cy=\"3\" fill=\"white\"></circle></svg> <svg class=\"bigfoot-footnote__button__circle\" viewbox=\"0 0 6 6\" preserveAspectRatio=\"xMinYMin\"><circle r=\"3\" cx=\"3\" cy=\"3\" fill=\"white\"></circle></svg> </button></div>"
};
settings = $.extend(defaults, options);
popoverStates = {};
footnoteInit = function() {
var $curResetElement, $currentLastFootnoteLink, $footnoteAnchors, $footnoteButton, $lastResetElement, $parent, $relevantFNLink, $relevantFootnote, finalFNLinks, footnoteButton, footnoteButtonSearchQuery, footnoteContent, footnoteIDNum, footnoteLinks, footnoteNum, footnotes, i, _i, _ref, _results;
footnoteButtonSearchQuery = settings.scope ? "" + settings.scope + " a[href*=\"#\"]" : "a[href*=\"#\"]";
$footnoteAnchors = $(footnoteButtonSearchQuery).filter(function() {
var $this, relAttr;
$this = $(this);
relAttr = $this.attr("rel");
if (relAttr === "null" || (relAttr == null)) {
relAttr = "";
}
return ("" + ($this.attr("href")) + relAttr).match(settings.anchorPattern) && $this.closest("[class*=" + settings.footnoteParentClass + "]:not(a):not(" + settings.anchorParentTagname + ")").length < 1;
});
footnotes = [];
footnoteLinks = [];
finalFNLinks = [];
cleanFootnoteLinks($footnoteAnchors, footnoteLinks);
$(footnoteLinks).each(function() {
var $closestFootnoteEl, relatedFN;
relatedFN = $(this).data("footnote-ref").replace(/[:.+~*\]\[]/g, "\\$&");
if (settings.useFootnoteOnlyOnce) {
relatedFN = "" + relatedFN + ":not(.footnote-processed)";
}
$closestFootnoteEl = $(relatedFN).closest(settings.footnoteTagname);
if ($closestFootnoteEl.length > 0) {
footnotes.push($closestFootnoteEl.first().addClass("footnote-processed"));
return finalFNLinks.push(this);
}
});
$currentLastFootnoteLink = $("[data-footnote-identifier]:last");
footnoteIDNum = $currentLastFootnoteLink.length < 1 ? 0 : +$currentLastFootnoteLink.data("footnote-identifier");
_results = [];
for (i = _i = 0, _ref = footnotes.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
footnoteContent = removeBackLinks($(footnotes[i]).html().trim(), $(finalFNLinks[i]).data("footnote-backlink-ref"));
footnoteContent = footnoteContent.replace(/"/g, "&quot;").replace(/&lt;/g, "&ltsym;").replace(/&gt;/g, "&gtsym;");
footnoteIDNum += 1;
footnoteButton = "";
$relevantFNLink = $(finalFNLinks[i]);
$relevantFootnote = $(footnotes[i]);
if (settings.numberResetSelector != null) {
$curResetElement = $relevantFNLink.closest(settings.numberResetSelector);
if ($curResetElement.is($lastResetElement)) {
footnoteNum += 1;
} else {
footnoteNum = 1;
}
$lastResetElement = $curResetElement;
} else {
footnoteNum = footnoteIDNum;
}
if (footnoteContent.indexOf("<") !== 0) {
footnoteContent = "<p>" + footnoteContent + "</p>";
}
footnoteButton = settings.buttonMarkup.replace(/\{\{FOOTNOTENUM\}\}/g, footnoteNum).replace(/\{\{FOOTNOTEID\}\}/g, footnoteIDNum).replace(/\{\{FOOTNOTECONTENT\}\}/g, footnoteContent);
footnoteButton = replaceWithReferenceAttributes(footnoteButton, "SUP", $relevantFNLink);
footnoteButton = replaceWithReferenceAttributes(footnoteButton, "FN", $relevantFootnote);
$footnoteButton = $(footnoteButton).insertBefore($relevantFNLink);
$parent = $relevantFootnote.parent();
switch (settings.actionOriginalFN.toLowerCase()) {
case "hide":
$relevantFNLink.addClass("footnote-print-only");
$relevantFootnote.addClass("footnote-print-only");
_results.push(deleteEmptyOrHR($parent));
break;
case "delete":
$relevantFNLink.remove();
$relevantFootnote.remove();
_results.push(deleteEmptyOrHR($parent));
break;
default:
_results.push($relevantFNLink.addClass("footnote-print-only"));
}
}
return _results;
};
cleanFootnoteLinks = function($footnoteAnchors, footnoteLinks) {
var $parent, $supChild, linkHREF, linkID;
if (footnoteLinks == null) {
footnoteLinks = [];
}
$parent = void 0;
$supChild = void 0;
linkHREF = void 0;
linkID = void 0;
$footnoteAnchors.each(function() {
var $child, $this;
$this = $(this);
linkHREF = "#" + ($this.attr("href")).split("#")[1];
$parent = $this.closest(settings.anchorParentTagname);
$child = $this.find(settings.anchorParentTagname);
if ($parent.length > 0) {
linkID = ($parent.attr("id") || "") + ($this.attr("id") || "");
return footnoteLinks.push($parent.attr({
"data-footnote-backlink-ref": linkID,
"data-footnote-ref": linkHREF
}));
} else if ($child.length > 0) {
linkID = ($child.attr("id") || "") + ($this.attr("id") || "");
return footnoteLinks.push($this.attr({
"data-footnote-backlink-ref": linkID,
"data-footnote-ref": linkHREF
}));
} else {
linkID = $this.attr("id") || "";
return footnoteLinks.push($this.attr({
"data-footnote-backlink-ref": linkID,
"data-footnote-ref": linkHREF
}));
}
});
};
deleteEmptyOrHR = function($el) {
var $parent;
$parent = void 0;
if ($el.is(":empty") || $el.children(":not(.footnote-print-only)").length === 0) {
$parent = $el.parent();
if (settings.actionOriginalFN.toLowerCase() === "delete") {
$el.remove();
} else {
$el.addClass("footnote-print-only");
}
return deleteEmptyOrHR($parent);
} else if ($el.children(":not(.footnote-print-only)").length === $el.children("hr:not(.footnote-print-only)").length) {
$parent = $el.parent();
if (settings.actionOriginalFN.toLowerCase() === "delete") {
$el.remove();
} else {
$el.children("hr").addClass("footnote-print-only");
$el.addClass("footnote-print-only");
}
return deleteEmptyOrHR($parent);
}
};
removeBackLinks = function(footnoteHTML, backlinkID) {
var regex;
if (backlinkID.indexOf(' ') >= 0) {
backlinkID = backlinkID.trim().replace(/\s+/g, "|").replace(/(.*)/g, "($1)");
}
regex = new RegExp("(\\s|&nbsp;)*<\\s*a[^#<]*#" + backlinkID + "[^>]*>(.*?)<\\s*/\\s*a>", "g");
return footnoteHTML.replace(regex, "").replace("[]", "");
};
replaceWithReferenceAttributes = function(string, referenceKeyword, $referenceElement) {
var refMatches, refRegex, refReplaceRegex, refReplaceText;
refRegex = new RegExp("\\{\\{" + referenceKeyword + ":([^\\}]*)\\}\\}", "g");
refMatches = void 0;
refReplaceText = void 0;
refReplaceRegex = void 0;
refMatches = refRegex.exec(string);
while (refMatches) {
if (refMatches[1]) {
refReplaceText = $referenceElement.attr(refMatches[1]) || "";
string = string.replace("{{" + referenceKeyword + ":" + refMatches[1] + "}}", refReplaceText);
}
refMatches = refRegex.exec(string);
}
return string;
};
buttonHover = function(event) {
var $buttonHovered, dataIdentifier, otherPopoverSelector;
if (settings.activateOnHover) {
$buttonHovered = $(event.target).closest(".bigfoot-footnote__button");
dataIdentifier = "[data-footnote-identifier=\"" + ($buttonHovered.attr("data-footnote-identifier")) + "\"]";
if ($buttonHovered.hasClass("is-active")) {
return;
}
$buttonHovered.addClass("is-hover-instantiated");
if (!settings.allowMultipleFN) {
otherPopoverSelector = ".bigfoot-footnote:not(" + dataIdentifier + ")";
removePopovers(otherPopoverSelector);
}
createPopover(".bigfoot-footnote__button" + dataIdentifier).addClass("is-hover-instantiated");
}
};
touchClick = function(event) {
var $nearButton, $nearFootnote, $target;
$target = $(event.target);
$nearButton = $target.closest(".bigfoot-footnote__button");
$nearFootnote = $target.closest(".bigfoot-footnote");
if ($nearButton.length > 0) {
event.preventDefault();
clickButton($nearButton);
} else if ($nearFootnote.length < 1) {
if ($(".bigfoot-footnote").length > 0) {
removePopovers();
}
}
};
clickButton = function($button) {
var dataIdentifier;
$button.blur();
dataIdentifier = "data-footnote-identifier=\"" + ($button.attr("data-footnote-identifier")) + "\"";
if ($button.hasClass("changing")) {
return;
} else if (!$button.hasClass("is-active")) {
$button.addClass("changing");
setTimeout((function() {
return $button.removeClass("changing");
}), settings.popoverCreateDelay);
createPopover(".bigfoot-footnote__button[" + dataIdentifier + "]");
$button.addClass("is-click-instantiated");
if (!settings.allowMultipleFN) {
removePopovers(".bigfoot-footnote:not([" + dataIdentifier + "])");
}
} else {
if (!settings.allowMultipleFN) {
removePopovers();
} else {
removePopovers(".bigfoot-footnote[" + dataIdentifier + "]");
}
}
};
createPopover = function(selector) {
var $buttons, $popoversCreated;
$buttons = void 0;
if (typeof selector !== "string" && settings.allowMultipleFN) {
$buttons = selector;
} else if (typeof selector !== "string") {
$buttons = selector.first();
} else if (settings.allowMultipleFN) {
$buttons = $(selector).closest(".bigfoot-footnote__button");
} else {
$buttons = $(selector + ":first").closest(".bigfoot-footnote__button");
}
$popoversCreated = $();
$buttons.each(function() {
var $content, $contentContainer, $this, content;
$this = $(this);
content = void 0;
try {
content = settings.contentMarkup.replace(/\{\{FOOTNOTENUM\}\}/g, $this.attr("data-footnote-number")).replace(/\{\{FOOTNOTEID\}\}/g, $this.attr("data-footnote-identifier")).replace(/\{\{FOOTNOTECONTENT\}\}/g, $this.attr("data-bigfoot-footnote")).replace(/\&gtsym\;/g, "&gt;").replace(/\&ltsym\;/g, "&lt;");
return content = replaceWithReferenceAttributes(content, "BUTTON", $this);
} finally {
$content = $(content);
try {
settings.activateCallback($content, $this);
} catch (_error) {}
$content.insertAfter($buttons);
popoverStates[$this.attr("data-footnote-identifier")] = "init";
$content.attr("bigfoot-max-width", calculatePixelDimension($content.css("max-width"), $content));
$content.css("max-width", 10000);
$contentContainer = $content.find(".bigfoot-footnote__content");
$content.attr("data-bigfoot-max-height", calculatePixelDimension($contentContainer.css("max-height"), $contentContainer));
repositionFeet();
$this.addClass("is-active");
$content.find(".bigfoot-footnote__content").bindScrollHandler();
$popoversCreated = $popoversCreated.add($content);
}
});
setTimeout((function() {
return $popoversCreated.addClass("is-active");
}), settings.popoverCreateDelay);
return $popoversCreated;
};
baseFontSize = function() {
var el, size;
el = document.createElement("div");
el.style.cssText = "display:inline-block;padding:0;line-height:1;position:absolute;visibility:hidden;font-size:1em;";
el.appendChild(document.createElement("M"));
document.body.appendChild(el);
size = el.offsetHeight;
document.body.removeChild(el);
return size;
};
calculatePixelDimension = function(dim, $el) {
if (dim === "none") {
dim = 10000;
} else if (dim.indexOf("rem") >= 0) {
dim = parseFloat(dim) * baseFontSize();
} else if (dim.indexOf("em") >= 0) {
dim = parseFloat(dim) * parseFloat($el.css("font-size"));
} else if (dim.indexOf("px") >= 0) {
dim = parseFloat(dim);
if (dim <= 60) {
dim = dim / parseFloat($el.parent().css("width"));
}
} else if (dim.indexOf("%") >= 0) {
dim = parseFloat(dim) / 100;
}
return dim;
};
$.fn.bindScrollHandler = function() {
if (!settings.preventPageScroll) {
return $(this);
}
$(this).on("DOMMouseScroll mousewheel", function(event) {
var $popover, $this, delta, height, prevent, scrollHeight, scrollTop, up;
$this = $(this);
scrollTop = $this.scrollTop();
scrollHeight = $this[0].scrollHeight;
height = parseInt($this.css("height"));
$popover = $this.closest(".bigfoot-footnote");
if ($this.scrollTop() > 0 && $this.scrollTop() < 10) {
$popover.addClass("is-scrollable");
}
if (!$popover.hasClass("is-scrollable")) {
return;
}
delta = event.type === "DOMMouseScroll" ? event.originalEvent.detail * -40 : event.originalEvent.wheelDelta;
up = delta > 0;
prevent = function() {
event.stopPropagation();
event.preventDefault();
event.returnValue = false;
return false;
};
if (!up && -delta > scrollHeight - height - scrollTop) {
$this.scrollTop(scrollHeight);
$popover.addClass("is-fully-scrolled");
return prevent();
} else if (up && delta > scrollTop) {
$this.scrollTop(0);
$popover.removeClass("is-fully-scrolled");
return prevent();
} else {
return $popover.removeClass("is-fully-scrolled");
}
});
return $(this);
};
unhoverFeet = function(e) {
if (settings.deleteOnUnhover && settings.activateOnHover) {
return setTimeout((function() {
var $target;
$target = $(e.target).closest(".bigfoot-footnote, .bigfoot-footnote__button");
if ($(".bigfoot-footnote__button:hover, .bigfoot-footnote:hover").length < 1) {
return removePopovers();
}
}), settings.hoverDelay);
}
};
escapeKeypress = function(event) {
if (event.keyCode === 27) {
return removePopovers();
}
};
removePopovers = function(footnotes, timeout) {
var $buttonsClosed, $linkedButton, $this, footnoteID;
if (footnotes == null) {
footnotes = ".bigfoot-footnote";
}
if (timeout == null) {
timeout = settings.popoverDeleteDelay;
}
$buttonsClosed = $();
footnoteID = void 0;
$linkedButton = void 0;
$this = void 0;
$(footnotes).each(function() {
$this = $(this);
footnoteID = $this.attr("data-footnote-identifier");
$linkedButton = $(".bigfoot-footnote__button[data-footnote-identifier=\"" + footnoteID + "\"]");
if (!$linkedButton.hasClass("changing")) {
$buttonsClosed = $buttonsClosed.add($linkedButton);
$linkedButton.removeClass("is-active is-hover-instantiated is-click-instantiated").addClass("changing");
$this.removeClass("is-active").addClass("disapearing");
return setTimeout((function() {
$this.remove();
delete popoverStates[footnoteID];
return $linkedButton.removeClass("changing");
}), timeout);
}
});
return $buttonsClosed;
};
repositionFeet = function(e) {
var type;
if (settings.positionContent) {
type = e ? e.type : "resize";
$(".bigfoot-footnote").each(function() {
var $button, $contentWrapper, $mainWrap, $this, dataIdentifier, identifier, lastState, marginSize, maxHeightInCSS, maxHeightOnScreen, maxWidth, maxWidthInCSS, positionOnTop, relativeToWidth, roomLeft, totalHeight;
$this = $(this);
identifier = $this.attr("data-footnote-identifier");
dataIdentifier = "data-footnote-identifier=\"" + identifier + "\"";
$contentWrapper = $this.find(".bigfoot-footnote__content");
$button = $this.siblings(".bigfoot-footnote__button");
roomLeft = roomCalc($button);
marginSize = parseFloat($this.css("margin-top"));
maxHeightInCSS = +($this.attr("data-bigfoot-max-height"));
totalHeight = 2 * marginSize + $this.outerHeight();
maxHeightOnScreen = 10000;
positionOnTop = roomLeft.bottomRoom < totalHeight && roomLeft.topRoom > roomLeft.bottomRoom;
lastState = popoverStates[identifier];
if (positionOnTop) {
if (lastState !== "top") {
popoverStates[identifier] = "top";
$this.addClass("is-positioned-top").removeClass("is-positioned-bottom");
$this.css("transform-origin", (roomLeft.leftRelative * 100) + "% 100%");
}
maxHeightOnScreen = roomLeft.topRoom - marginSize - 15;
} else {
if (lastState !== "bottom" || lastState === "init") {
popoverStates[identifier] = "bottom";
$this.removeClass("is-positioned-top").addClass("is-positioned-bottom");
$this.css("transform-origin", (roomLeft.leftRelative * 100) + "% 0%");
}
maxHeightOnScreen = roomLeft.bottomRoom - marginSize - 15;
}
$this.find(".bigfoot-footnote__content").css({
"max-height": Math.min(maxHeightOnScreen, maxHeightInCSS) + "px"
});
if (type === "resize") {
maxWidthInCSS = parseFloat($this.attr("bigfoot-max-width"));
$mainWrap = $this.find(".bigfoot-footnote__wrapper");
maxWidth = maxWidthInCSS;
if (maxWidthInCSS <= 1) {
relativeToWidth = (function() {
var jq, userSpecifiedRelativeElWidth;
userSpecifiedRelativeElWidth = 10000;
if (settings.maxWidthRelativeTo) {
jq = $(settings.maxWidthRelativeTo);
if (jq.length > 0) {
userSpecifiedRelativeElWidth = jq.outerWidth();
}
}
return Math.min(window.innerWidth, userSpecifiedRelativeElWidth);
})();
maxWidth = relativeToWidth * maxWidthInCSS;
}
maxWidth = Math.min(maxWidth, $this.find(".bigfoot-footnote__content").outerWidth() + 1);
$mainWrap.css("max-width", maxWidth + "px");
$this.css({
left: (-roomLeft.leftRelative * maxWidth + parseFloat($button.css("margin-left")) + $button.outerWidth() / 2) + "px"
});
positionTooltip($this, roomLeft.leftRelative);
}
if (parseInt($this.outerHeight()) < $this.find(".bigfoot-footnote__content")[0].scrollHeight) {
return $this.addClass("is-scrollable");
}
});
}
};
positionTooltip = function($popover, leftRelative) {
var $tooltip;
if (leftRelative == null) {
leftRelative = 0.5;
}
$tooltip = $popover.find(".bigfoot-footnote__tooltip");
if ($tooltip.length > 0) {
$tooltip.css("left", "" + (leftRelative * 100) + "%");
}
};
roomCalc = function($el) {
var elHeight, elLeftMargin, elWidth, leftRoom, topRoom, w;
elLeftMargin = parseFloat($el.css("margin-left"));
elWidth = parseFloat($el.outerWidth()) - elLeftMargin;
elHeight = parseFloat($el.outerHeight());
w = viewportDetails();
topRoom = $el.offset().top - w.scrollY + elHeight / 2;
leftRoom = $el.offset().left - w.scrollX + elWidth / 2;
return {
topRoom: topRoom,
bottomRoom: w.height - topRoom,
leftRoom: leftRoom,
rightRoom: w.width - leftRoom,
leftRelative: leftRoom / w.width,
topRelative: topRoom / w.height
};
};
viewportDetails = function() {
var $window;
$window = $(window);
return {
width: window.innerWidth,
height: window.innerHeight,
scrollX: $window.scrollLeft(),
scrollY: $window.scrollTop()
};
};
addBreakpoint = function(size, trueCallback, falseCallback, deleteDelay, removeOpen) {
var falseDefaultPositionSetting, minMax, mqListener, mql, query, s, trueDefaultPositionSetting;
if (deleteDelay == null) {
deleteDelay = settings.popoverDeleteDelay;
}
if (removeOpen == null) {
removeOpen = true;
}
mql = void 0;
minMax = void 0;
s = void 0;
if (typeof size === "string") {
s = size.toLowerCase() === "iphone" ? "<320px" : size.toLowerCase() === "ipad" ? "<768px" : size;
minMax = s.charAt(0) === ">" ? "min" : s.charAt(0) === "<" ? "max" : null;
query = minMax ? "(" + minMax + "-width: " + (s.substring(1)) + ")" : s;
mql = window.matchMedia(query);
} else {
mql = size;
}
if (mql.media && mql.media === "invalid") {
return {
added: false,
mq: mql,
listener: null
};
}
trueDefaultPositionSetting = minMax === "min";
falseDefaultPositionSetting = minMax === "max";
trueCallback = trueCallback || makeDefaultCallbacks(removeOpen, deleteDelay, trueDefaultPositionSetting, function($popover) {
return $popover.addClass("is-bottom-fixed");
});
falseCallback = falseCallback || makeDefaultCallbacks(removeOpen, deleteDelay, falseDefaultPositionSetting, function() {});
mqListener = function(mq) {
if (mq.matches) {
trueCallback(removeOpen, bigfoot);
} else {
falseCallback(removeOpen, bigfoot);
}
};
mql.addListener(mqListener);
mqListener(mql);
settings.breakpoints[size] = {
added: true,
mq: mql,
listener: mqListener
};
return settings.breakpoints[size];
};
makeDefaultCallbacks = function(removeOpen, deleteDelay, position, callback) {
return function(removeOpen, bigfoot) {
var $closedPopovers;
$closedPopovers = void 0;
if (removeOpen) {
$closedPopovers = bigfoot.close();
bigfoot.updateSetting("activateCallback", callback);
}
return setTimeout((function() {
bigfoot.updateSetting("positionContent", position);
if (removeOpen) {
return bigfoot.activate($closedPopovers);
}
}), deleteDelay);
};
};
removeBreakpoint = function(target, callback) {
var b, breakpoint, mq, mqFound;
mq = null;
b = void 0;
mqFound = false;
if (typeof target === "string") {
mqFound = settings.breakpoints[target] !== undefined;
} else {
for (b in settings.breakpoints) {
if (settings.breakpoints.hasOwnProperty(b) && settings.breakpoints[b].mq === target) {
mqFound = true;
}
}
}
if (mqFound) {
breakpoint = settings.breakpoints[b || target];
if (callback) {
callback({
matches: false
});
} else {
breakpoint.listener({
matches: false
});
}
breakpoint.mq.removeListener(breakpoint.listener);
delete settings.breakpoints[b || target];
}
return mqFound;
};
updateSetting = function(newSettings, value) {
var oldValue, prop;
oldValue = void 0;
if (typeof newSettings === "string") {
oldValue = settings[newSettings];
settings[newSettings] = value;
} else {
oldValue = {};
for (prop in newSettings) {
if (newSettings.hasOwnProperty(prop)) {
oldValue[prop] = settings[prop];
settings[prop] = newSettings[prop];
}
}
}
return oldValue;
};
getSetting = function(setting) {
return settings[setting];
};
$(document).ready(function() {
footnoteInit();
$(document).on("mouseenter", ".bigfoot-footnote__button", buttonHover);
$(document).on("touchend click", touchClick);
$(document).on("mouseout", ".is-hover-instantiated", unhoverFeet);
$(document).on("keyup", escapeKeypress);
$(window).on("scroll resize", repositionFeet);
return $(document).on("gestureend", function() {
return repositionFeet();
});
});
bigfoot = {
removePopovers: removePopovers,
close: removePopovers,
createPopover: createPopover,
activate: createPopover,
repositionFeet: repositionFeet,
reposition: repositionFeet,
addBreakpoint: addBreakpoint,
removeBreakpoint: removeBreakpoint,
getSetting: getSetting,
updateSetting: updateSetting
};
return bigfoot;
};
})(jQuery);
}).call(this);
</script>
<script type="text/javascript">
$.bigfoot();
</script>
<link href="Bigfoot.css" rel="stylesheet" rev="stylesheet" type="text/css">
</main>
</body>
</html>

View file

@ -69,6 +69,9 @@ void Bibliographic::initialise_data(web_md *Wm) {
bd = Bibliographic::set_datum(Wm, I"Strict Usage Rules", I"Off"); bd->on_or_off = TRUE;
bd = Bibliographic::set_datum(Wm, I"TeX Mathematics Notation", I"On"); bd->on_or_off = TRUE;
bd = Bibliographic::set_datum(Wm, I"TeX Mathematics Plugin", I"MathJax3");
bd = Bibliographic::set_datum(Wm, I"Footnote Begins Notation", I"[");
bd = Bibliographic::set_datum(Wm, I"Footnote Ends Notation", I"]");
bd = Bibliographic::set_datum(Wm, I"Footnotes Plugin", I"Bigfoot");
bd = Bibliographic::set_datum(Wm, I"Code In Commentary Notation", I"|");
bd = Bibliographic::set_datum(Wm, I"Code In Code Comments Notation", I"|");
bd = Bibliographic::set_datum(Wm, I"Cross-References Notation", I"//");