<
L->is_commentary = FALSE;
Regexp::dispose_of(&mr);
- This code is used in §1.1.7.5.1 (twice).
§1.1.7.5.1.8. Here we handle paragraph breaks which may or may not be headings. In
-version 1,
was a heading, and
a grander heading, while plain
+version 1, was a heading, and a grander heading, while plain
is no heading at all. The use of "p" was a little confusing, and went back
to CWEB, which used the term "paragraph" differently from us: it was "p"
-short for what CWEB called a "paragraph". We now use
or equivalently
-
for a heading.
+short for what CWEB called a "paragraph". We now use or equivalently
+ for a heading.
The noteworthy thing here is the way we fool around with the text on the line
@@ -881,14 +881,14 @@ of French weaving" and the remainder,
int next_child_number;
struct paragraph *parent_paragraph;
- int weight;
+ int weight;
int starts_on_new_page;
struct para_macro *defines_macro;
- struct linked_list *functions;
- struct linked_list *structures;
- struct linked_list *taggings;
- struct linked_list *footnotes;
+ struct linked_list *functions;
+ struct linked_list *structures;
+ struct linked_list *taggings;
+ struct linked_list *footnotes;
struct source_line *first_line_in_paragraph;
struct section *under_section;
MEMORY_MANAGEMENT
@@ -945,7 +945,7 @@ of French weaving" and the remainder,
L->text_operand = Str::duplicate(mr.exp[0]);
}
Regexp::dispose_of(&mr);
-
- This code is used in §1.1.7.
§1.1.7.9. Note that in an
definition, a blank line is treated as the end of the
+
- This code is used in §1.1.7.
§1.1.7.9. Note that in an definition, a blank line is treated as the end of the
definition. (This is unnecessary for C, and is a point of difference with
CWEB, but is needed for languages which don't allow multi-line definitions.)
@@ -972,7 +972,7 @@ CWEB, but is needed for languages which don't allow multi-line definitions.)
LanguageMethods::subcategorise_line(S->sect_language, L);
- This code is used in §1.1.7.
§1.1.4.1. The purpose text occurs just below the heading. In version 1 it's cued with
-a
command; in version 2 it is unmarked. The following routine
+a command; in version 2 it is unmarked. The following routine
is not elegant but handles the back end of both possibilities.
@@ -995,8 +995,8 @@ is not elegant but handles the back end of both possibilities.
typedef struct footnote {
- int footnote_cue_number;
- int footnote_text_number;
+ int footnote_cue_number;
+ int footnote_text_number;
struct text_stream *cue_text;
int cued_already;
MEMORY_MANAGEMENT
diff --git a/docs/inweb/2-tr.html b/docs/inweb/2-tr.html
index 5b4b268..73c79fb 100644
--- a/docs/inweb/2-tr.html
+++ b/docs/inweb/2-tr.html
@@ -59,13 +59,13 @@ stand-alone files called "tangle targets". By default there is just one
of these.
-We use the
function of
to read the structure
-of the web in from the file system. This produces a
metadata
-structure for the web itself, which contains a list of
-structures for the chapters, each in turn containing a list of
s.
+
We use the function of to read the structure
+of the web in from the file system. This produces a metadata
+structure for the web itself, which contains a list of
+structures for the chapters, each in turn containing a list of s.
We will imitate that structure exactly, but because we want to attach a lot
-of semantics at each level, we will make a
with a list of
s
-each of which has a list of
s.
+of semantics at each level, we will make a with a list of s
+each of which has a list of s.
Here are the semantics for a web:
@@ -74,33 +74,33 @@ each of which has a list of
- The structure web is accessed in 1/pc, 1/ts, 1/ptt, 2/lc, 2/tp, 2/pn, 3/ta, 3/ti, 3/tw, 3/twot, 3/tt, 4/pl, 4/taf, 4/as, 4/cl, 4/is, 5/ptf, 5/tf, 5/hf, 5/df, 5/wp, 6/mkf, 6/rw, 6/cln and here.
§2. And for a chapter:
typedef struct chapter {
struct chapter_md *md;
struct web *owning_web;
- struct linked_list *sections;
+ struct linked_list *sections;
- struct weave_order *ch_weave;
+ struct weave_order *ch_weave;
int titling_line_inserted;
struct programming_language *ch_language;
MEMORY_MANAGEMENT
@@ -118,26 +118,26 @@ each of which has a list of
- The structure section is accessed in 1/pc, 1/ts, 1/ptt, 2/lc, 2/tp, 2/pm, 2/tgs, 2/pn, 3/ta, 3/ti, 3/tw, 3/twot, 3/tt, 4/pl, 4/taf, 4/lm, 4/as, 4/is, 5/ptf, 5/tf, 5/hf, 5/df, 6/mkf, 6/rw, 6/cln and here.
§4. The following routine makes the
-
-
tree out of a
-
-
-
tree:
+
- The structure section is accessed in 1/pc, 1/ts, 1/ptt, 2/lc, 2/tp, 2/pm, 2/tgs, 2/pn, 3/ta, 3/ti, 3/tw, 3/twot, 3/tt, 4/pl, 4/taf, 4/lm, 4/as, 4/is, 5/ptf, 5/tf, 5/hf, 5/df, 6/mkf, 6/rw, 6/cln and here.
§4. The following routine makes the -- tree out of a
+-- tree:
@@ -364,7 +364,7 @@ tangled for.
-pathname *Reader::woven_folder(web *W) {
+pathname *Reader::woven_folder(web *W) {
pathname *P = Pathnames::down(W->md->path_to_web, I"Woven");
if (Pathnames::create_in_file_system(P) == FALSE)
Errors::fatal_with_path("unable to create Woven subdirectory", P);
@@ -423,8 +423,8 @@ in large webs, and lookup is performed only a few times.
return NULL;
}
§10. Ranges and containment. This provides a sort of partial ordering on ranges, testing if the portion
-of the web represented by
is contained inside the portion represented
-by
. Note that
means the entire web, and is what the word
+of the web represented by is contained inside the portion represented
+by . Note that means the entire web, and is what the word
translates to when it's used on the command line.
@@ -466,7 +466,7 @@ a web contains just one target, which contains all of the sections.
return tt;
}
§13. And the following provides a way to iterate through the lines in a tangle,
-while keeping the variables
,
and
pointing to the current chapter,
+while keeping the variables , and pointing to the current chapter,
section and line.
diff --git a/docs/inweb/3-ta.html b/docs/inweb/3-ta.html
index cf61a22..469b839 100644
--- a/docs/inweb/3-ta.html
+++ b/docs/inweb/3-ta.html
@@ -141,8 +141,8 @@ these identifiers.
- define ELEMENT_ACCESS_USAGE 0x00000001
- define FCALL_USAGE 0x00000002
+ define ELEMENT_ACCESS_USAGE 0x00000001
+ define FCALL_USAGE 0x00000002
define PREFORM_IN_CODE_USAGE 0x00000004
define PREFORM_IN_GRAMMAR_USAGE 0x00000008
define MISC_USAGE 0x00000010
@@ -150,7 +150,7 @@ these identifiers.
§4. The main analysis routine goes through a web as follows. Note that we only
perform the search here, we don't comment on the results; any action to be
-taken must be handled by
when we're done.
+taken must be handled by when we're done.
@@ -184,7 +184,7 @@ below) to look for names of particular functions it knows about.
In Version 1 webs, this code is also expected to parse any Interface lines in
a section which it recognises, marking those by setting their
-
flags. Any that are left must be erroneous.
+ flags. Any that are left must be erroneous.
Version 2 removed Interface altogeter as being cumbersome for no real gain in
practice.
@@ -221,7 +221,7 @@ practice.
Analyser::analyse_as_code(W, L, L->text, ANY_USAGE, 0);
}
§4.4. Lines in a Preform grammar generally take the form of some BNF grammar, where
-we want only to identify any nonterminals mentioned, then a
divider,
+we want only to identify any nonterminals mentioned, then a divider,
and then some C code to deal with a match. The code is subjected to analysis
just as any other code would be.
@@ -234,17 +234,17 @@ just as any other code would be.
Analyser::analyse_as_code(W, L, L->text_operand2, ANY_USAGE, 0);
Analyser::analyse_as_code(W, L, L->text_operand, PREFORM_IN_CODE_USAGE, PREFORM_IN_GRAMMAR_USAGE);
-
§5. Identifier searching. Here's what we actually do, then. We take the code fragment
, drawn
-from part or all of source line
from web
, and look for any identifier
-names used in one of the contexts in the bitmap
. Any that we find are
-passed to
, along with the context they were found in (or, if
-
is nonzero, with
as their context).
+
§5. Identifier searching. Here's what we actually do, then. We take the code fragment , drawn
+from part or all of source line from web , and look for any identifier
+names used in one of the contexts in the bitmap . Any that we find are
+passed to , along with the context they were found in (or, if
+ is nonzero, with as their context).
What we do is to look for instances of an identifier, defined as a maximal
-string of
characters or hyphens not followed by
characters. (Thus
-
counts, but
is not an identifier when it occurs in
-
.)
+string of characters or hyphens not followed by characters. (Thus
+ counts, but is not an identifier when it occurs in
+.)
@@ -315,7 +315,7 @@ in Aho, Sethi and Ullman, "Compilers: Principles, Techniques and Tools"
typedef struct hash_table {
- struct linked_list *analysis_hash[HASH_TAB_SIZE];
+ struct linked_list *analysis_hash[HASH_TAB_SIZE];
int analysis_hash_initialised;
} hash_table;
- The structure hash_table is accessed in 2/tr, 4/pl and here.
§8. Where we define:
@@ -325,7 +325,7 @@ in Aho, Sethi and Ullman, "Compilers: Principles, Techniques and Tools"
typedef struct hash_table_entry {
text_stream *hash_key;
int reserved_word;
- struct linked_list *usages;
+ struct linked_list *usages;
struct source_line *definition_line;
struct language_function *as_function;
MEMORY_MANAGEMENT
@@ -422,7 +422,7 @@ same paragraph of code.
typedef struct hash_table_entry_usage {
struct paragraph *usage_recorded_at;
- int form_of_usage;
+ int form_of_usage;
MEMORY_MANAGEMENT
} hash_table_entry_usage;
- The structure hash_table_entry_usage is accessed in 3/tw, 4/as, 4/is and here.
§12. And here's how we create these usages:
diff --git a/docs/inweb/3-ti.html b/docs/inweb/3-ti.html
index 889a05f..907a93c 100644
--- a/docs/inweb/3-ti.html
+++ b/docs/inweb/3-ti.html
@@ -45,16 +45,16 @@ function togglePopup(material_id) {
To construct indexes of the material woven, following a template.
-
+
§1. Cover sheets. The indexer offers two basic services. One, which is much simpler, makes
cover sheets, and has only simple escapes (except that it has the ability
-to call the fuller indexing service if need be, using
-or
).
+to call the fuller indexing service if need be, using
+or ).
-void Indexer::cover_sheet_maker(OUTPUT_STREAM, web *W, text_stream *unextended_leafname,
+void Indexer::cover_sheet_maker(OUTPUT_STREAM, web *W, text_stream *unextended_leafname,
weave_order *wt, int halves) {
cover_sheet_state state;
<Clear the cover sheet state 1.2>;
@@ -68,7 +68,7 @@ or Indexer::scan_cover_line, NULL, (void *) &state);
}
§1.1. 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
.
+the bottom half, of the template; they are divided by the marker .
@@ -109,20 +109,13 @@ structure.
TEMPORARY_TEXT(matter);
Str::copy(matter, line);
match_results mr = Regexp::create_mr();
- if ((include) &&
- ((state->target->self_contained) || (state->target->pattern->embed_CSS)) &&
- (Regexp::match(&mr, matter, L" *%<link href=%\"(%c+?)\"%c*"))) {
- filename *CSS_file = Patterns::obtain_filename(state->target->pattern, mr.exp[0]);
- Indexer::transcribe_CSS(matter, CSS_file);
- } else {
- while (Regexp::match(&mr, matter, L"(%c*?)%[%[(%c*?)%]%](%c*)")) {
- text_stream *left = mr.exp[0];
- text_stream *command = mr.exp[1];
- text_stream *right = mr.exp[2];
- if (include) WRITE("%S", left);
- <Deal with a double-squares escape in a cover sheet 2.1>;
- Str::copy(matter, right);
- }
+ while (Regexp::match(&mr, matter, L"(%c*?)%[%[(%c*?)%]%](%c*)")) {
+ text_stream *left = mr.exp[0];
+ text_stream *command = mr.exp[1];
+ text_stream *right = mr.exp[2];
+ if (include) WRITE("%S", left);
+ <Deal with a double-squares escape in a cover sheet 2.1>;
+ Str::copy(matter, right);
}
Regexp::dispose_of(&mr);
if (include) WRITE("%S\n", matter);
@@ -139,40 +132,23 @@ structure.
} else if (Str::eq_wide_string(command, L"Plugins")) {
if (include) {
WeavePlugins::begin_inclusions();
- Patterns::include_plugins(OUT, state->target->weave_web,
+ Patterns::include_plugins(OUT, state->target->weave_web,
state->target->pattern, state->target->weave_to);
Swarm::include_plugins(OUT, state->target->weave_web,
state->target, state->target->weave_to);
}
- } else if (Str::eq_wide_string(command, L"Cover Sheet")) {
- if (include) <Weave in the parent pattern's cover sheet 2.1.1>;
- } else if (Regexp::match(&mr2, command, L"Navigation")) {
- if (include) <Weave in navigation 2.1.2>;
- } else if (Regexp::match(&mr2, command, L"Template (%c*?)")) {
- if (include) <Weave in an index 2.1.3>;
- } else if (Bibliographic::data_exists(state->target->weave_web->md, command)) {
- if (include) <Weave in the value of this variable name 2.1.4>;
- } else {
- if (include) WRITE("[[%S]]", command);
- }
- Regexp::dispose_of(&mr2);
-§2.1.1.
-<Weave in the parent pattern's cover sheet 2.1.1> =
-
-
-
- if (state->target->pattern->based_on) {
- weave_pattern *saved = state->target->pattern;
- state->target->pattern = state->target->pattern->based_on;
- Indexer::cover_sheet_maker(OUT, state->target->weave_web,
- I"cover-sheet", state->target,
- (state->halves & (WEAVE_FIRST_HALF + WEAVE_SECOND_HALF)));
- state->target->pattern = saved;
+ } else if (Regexp::match(&mr2, command, L"Navigation")) {
+ if (include) <Weave in navigation 2.1.1>;
+ } else if (Regexp::match(&mr2, command, L"Template (%c*?)")) {
+ if (include) <Weave in an index 2.1.2>;
+ } else if (Bibliographic::data_exists(state->target->weave_web->md, command)) {
+ if (include) <Weave in the value of this variable name 2.1.3>;
} else {
- Errors::in_text_file("cover sheet recursively includes itself", tfp);
+ if (include) WRITE("[[%S]]", command);
}
-
- This code is used in §2.1.
§2.1.2.
-<Weave in navigation 2.1.2> =
+ Regexp::dispose_of(&mr2);
+§2.1.1.
+<Weave in navigation 2.1.1> =
@@ -184,8 +160,8 @@ structure.
} else {
PRINT("Warning: no sidebar links will be generated, as -navigation is unset");
}
-
- This code is used in §2.1.
§2.1.3.
-<Weave in an index 2.1.3> =
+- This code is used in §2.1.
§2.1.2.
+<Weave in an index 2.1.2> =
@@ -194,8 +170,8 @@ structure.
Errors::in_text_file("pattern does not provide this template file", tfp);
else
Indexer::incorporate_template_for_target(OUT, state->target, CF);
-
- This code is used in §2.1.
§2.1.4.
-<Weave in the value of this variable name 2.1.4> =
+- This code is used in §2.1.
§2.1.3.
+<Weave in the value of this variable name 2.1.3> =
@@ -217,7 +193,7 @@ being accessed directly.
Indexer::incorporate_template(OUT, W, I"", F, pattern, NULL, NULL);
}
-void Indexer::incorporate_template_for_target(text_stream *OUT, weave_order *wv,
+void Indexer::incorporate_template_for_target(text_stream *OUT, weave_order *wv,
filename *F) {
Indexer::incorporate_template(OUT, wv->weave_web, wv->weave_range, F, wv->pattern,
wv->navigation, wv->breadcrumbs);
@@ -299,7 +275,7 @@ being accessed directly.
void Indexer::run_engine(text_stream *OUT, index_engine_state *ies) {
- filename *save_cf = Indexer::current_file();
+ filename *save_cf = Indexer::current_file();
int lpos = 0;
while (lpos < ies->no_tlines) {
match_results mr = Regexp::create_mr();
@@ -313,7 +289,7 @@ being accessed directly.
}
if (ies->inside_navigation_submenu) WRITE("</ul>");
ies->inside_navigation_submenu = FALSE;
- Indexer::set_current_file(save_cf);
+ Indexer::set_current_file(save_cf);
}
§6.1.
<Make any necessary substitutions to turn tl into final output 6.1> =
@@ -323,12 +299,6 @@ being accessed directly.
if (Regexp::match(&mr, tl, L"(%c*?) ")) Str::copy(tl, mr.exp[0]);
if (TRACE_CI_EXECUTION)
<Print line and contents of repeat stack 6.1.1>;
- if ((ies->nav_pattern->embed_CSS) &&
- (Regexp::match(&mr, tl, L" *%<link href=%\"(%c+?)\"%c*"))) {
- filename *CSS_file = Patterns::obtain_filename(ies->nav_pattern, mr.exp[0]);
- Indexer::transcribe_CSS(OUT, CSS_file);
- Str::clear(tl);
- }
if ((Regexp::match(&mr, tl, L"%[%[(%c+)%]%]")) ||
(Regexp::match(&mr, tl, L" %[%[(%c+)%]%]"))) {
TEMPORARY_TEXT(command);
@@ -498,8 +468,8 @@ chapter as its value during the sole iteration.
ies->repeat_stack_variable[ies->stack_pointer-1])
goto CYCLE;
}
-
- This code is used in §6.1.
§6.1.6. If called with level
, this returns the topmost chapter number
-on the stack; and similarly for
.
+
- This code is used in §6.1.
§6.1.6. If called with level , this returns the topmost chapter number
+on the stack; and similarly for .
@@ -610,7 +580,7 @@ its square-bracketed parts.
DISCARD_TEXT(substituted);
DISCARD_TEXT(right_part);
}
-- This code is used in §6.1.
§6.1.8.1. This is why, for instance,
is replaced by the author's name:
+
- This code is used in §6.1.
§6.1.8.1. This is why, for instance, is replaced by the author's name:
@@ -620,7 +590,7 @@ its square-bracketed parts.
Str::copy(substituted, Bibliographic::get_datum(ies->for_web->md, varname));
-
- This code is used in §6.1.8.
§6.1.8.2.
substitutes to the content of the sidebar navigation file;
+
- This code is used in §6.1.8.
§6.1.8.2. substitutes to the content of the sidebar navigation file;
this will recursively call the Indexer, in fact.
@@ -648,9 +618,9 @@ this will recursively call the Indexer, in fact.
- Colonies::drop_initial_breadcrumbs(substituted, Indexer::current_file(),
+ Colonies::drop_initial_breadcrumbs(substituted, Indexer::current_file(),
ies->crumbs);
-
- This code is used in §6.1.8.
§6.1.8.4.
here expands to material needed by any plugins required
+
- This code is used in §6.1.8.
§6.1.8.4. here expands to material needed by any plugins required
by the weave ies->nav_pattern itself; it doesn't include optional extras for a
specific page because, of course, the Indexer is used for cover sheets and
not pages. (Except for navigation purposes, and navigation files should never
@@ -664,7 +634,7 @@ use this.)
WeavePlugins::begin_inclusions();
- Patterns::include_plugins(OUT, ies->for_web, ies->nav_pattern, Indexer::current_file());
+ Patterns::include_plugins(OUT, ies->for_web, ies->nav_pattern, Indexer::current_file());
- This code is used in §6.1.8.
§6.1.8.5. A list of all modules in the current web.
@@ -784,7 +754,7 @@ navigation purposes.
Pathnames::relative_URL(substituted,
- Filenames::up(Indexer::current_file()),
+ Filenames::up(Indexer::current_file()),
Pathnames::from_text(Colonies::home()));
- This code is used in §6.1.8.
§6.1.8.10.
<Substitute a URL 6.1.8.10> =
@@ -792,7 +762,7 @@ navigation purposes.
Pathnames::relative_URL(substituted,
- Filenames::up(Indexer::current_file()),
+ Filenames::up(Indexer::current_file()),
Pathnames::from_text(link_text));
- This code is used in §6.1.8.
§6.1.8.11.
<Substitute a Link 6.1.8.11> =
@@ -800,7 +770,7 @@ navigation purposes.
WRITE_TO(substituted, "<a href=\"");
- Colonies::reference_URL(substituted, link_text, Indexer::current_file());
+ Colonies::reference_URL(substituted, link_text, Indexer::current_file());
WRITE_TO(substituted, "\">");
- This code is used in §6.1.8.
§6.1.8.12.
<Substitute a Menu 6.1.8.12> =
@@ -830,7 +800,7 @@ navigation purposes.
TEMPORARY_TEXT(url);
- Colonies::reference_URL(url, link_text, Indexer::current_file());
+ Colonies::reference_URL(url, link_text, Indexer::current_file());
<Substitute an item at this URL 6.1.8.14.1>;
DISCARD_TEXT(url);
- This code is used in §6.1.8.
§6.1.8.15.
@@ -839,7 +809,7 @@ navigation purposes.
TEMPORARY_TEXT(url);
- Colonies::link_URL(url, link_text, Indexer::current_file());
+ Colonies::link_URL(url, link_text, Indexer::current_file());
<Substitute an item at this URL 6.1.8.14.1>;
DISCARD_TEXT(url);
- This code is used in §6.1.8.
§6.1.8.14.1.
@@ -850,7 +820,7 @@ navigation purposes.
if (ies->inside_navigation_submenu == FALSE) WRITE_TO(substituted, "<ul>");
ies->inside_navigation_submenu = TRUE;
WRITE_TO(substituted, "<li>");
- if (Str::eq(url, Filenames::get_leafname(Indexer::current_file()))) {
+ if (Str::eq(url, Filenames::get_leafname(Indexer::current_file()))) {
WRITE_TO(substituted, "<span class=\"unlink\">");
<Substitute icon and name 6.1.8.14.1.1>;
WRITE_TO(substituted, "</span>");
@@ -876,7 +846,7 @@ navigation purposes.
pathname *I = Colonies::assets_path();
if (I == NULL) I = Pathnames::from_text(Colonies::home());
Pathnames::relative_URL(substituted,
- Filenames::up(Indexer::current_file()), I);
+ Filenames::up(Indexer::current_file()), I);
WRITE_TO(substituted, "%S\" height=18> ", icon_text);
}
WRITE_TO(substituted, "%S", item_name);
@@ -896,28 +866,14 @@ navigation purposes.
LOOP_OVER_LINKED_LIST(N, module, M->dependencies)
Indexer::list_module(OUT, N, TRUE);
}
-§8. Transcribing CSS.
-
-
-void Indexer::transcribe_CSS(OUTPUT_STREAM, filename *CSS_file) {
- WRITE("<style type=\"text/css\">\n");
- TextFiles::read(CSS_file, FALSE, "can't open CSS file",
- TRUE, Indexer::copy_CSS, NULL, OUT);
- WRITE("\n</style>\n");
-}
-
-void Indexer::copy_CSS(text_stream *line, text_file_position *tfp, void *X) {
- text_stream *OUT = (text_stream *) X;
- WRITE("%S\n", line);
-}
-
§9. Tracking the file being written to.
+§8. Tracking the file being written to.
filename *file_being_woven = NULL;
-filename *Indexer::current_file(void) {
+filename *Indexer::current_file(void) {
return file_being_woven;
}
-void Indexer::set_current_file(filename *F) {
+void Indexer::set_current_file(filename *F) {
file_being_woven = F;
}
diff --git a/docs/inweb/3-tt.html b/docs/inweb/3-tt.html
index 5ddbc9e..8d49b04 100644
--- a/docs/inweb/3-tt.html
+++ b/docs/inweb/3-tt.html
@@ -47,7 +47,7 @@ function togglePopup(material_id) {
-§1. The Master Tangler. Here's what has happened so far, on a
run of Inweb: on any
+
§1. The Master Tangler. Here's what has happened so far, on a run of Inweb: on any
other sort of run, of course, we would never be in this section of code.
The web was read completely into memory, and then fully parsed, with all
of the arrays and hashes populated. Program Control then sent us straight
@@ -96,7 +96,7 @@ of which can be seen below.
if ((P->placed_very_early) && (P->defines_macro == NULL))
Tangler::tangle_paragraph(OUT, P);
-
+
<Tangle all the constant definitions in section order 1.1.1>;
@@ -114,7 +114,7 @@ of which can be seen below.
LanguageMethods::gnabehs(OUT, lang, W);
-
§1.1.1. This is the result of all those
definitions; note that these sometimes
+
§1.1.1. This is the result of all those definitions; note that these sometimes
extend across multiple lines.
@@ -163,7 +163,7 @@ extend across multiple lines.
LOOP_OVER_LINKED_LIST(F, filename, W->headers)
Shell::copy(F, Reader::tangled_folder(W), "");
§2. So here is the main tangler for a single paragraph. We basically expect to
-act only on
lines (those containing actual code), unless
+act only on lines (those containing actual code), unless
something quirky has been done to support a language feature.
@@ -203,7 +203,7 @@ else; if so, here's where we use it.
LanguageMethods::insert_line_marker(OUT, P->under_section->sect_language, L);
}
- This code is used in §2 (twice).
§3. The Code Tangler. All of the final tangled code passes through the following routine.
-Almost all of the time, it simply prints
verbatim to the file
.
+Almost all of the time, it simply prints verbatim to the file .
@@ -226,17 +226,17 @@ example, we handle
if (banana_count == 0) @<Yes, we have no bananas@>;
-by calling the lower-level tangler on
(a substring
+
by calling the lower-level tangler on (a substring
which we know can't involve any macros, since we are detecting macros from
left to right, and this is to the left of the one we found); then by tangling
the definition of "Yes, we have no bananas"; then by calling the upper-level
-code tangler on
. (In this case, of course, there's nothing much there,
+code tangler on . (In this case, of course, there's nothing much there,
but in principle it could contain further macros.)
Note that when we've expanded "Yes, we have no bananas" we have certainly
placed code into the tangled file from a different location; that will insert
-a
marker for the definition location; and we don't want the eventual
+a marker for the definition location; and we don't want the eventual
C compiler to think that the code which follows is also from that location.
So we insert a fresh line marker.
@@ -284,11 +284,11 @@ page) and substitutes that, so that we end up with (say)
printf("This is build 5Q47.\n");
In some languages there are also special expansions (for example, in
-InC
has a special meaning).
+InC has a special meaning).
If the text in double-squares isn't recognised, that's not an error: it simply
-passes straight through. So
becomes just
.
+passes straight through. So becomes just .
diff --git a/docs/inweb/3-tw.html b/docs/inweb/3-tw.html
index f23bd8a..912d632 100644
--- a/docs/inweb/3-tw.html
+++ b/docs/inweb/3-tw.html
@@ -54,14 +54,14 @@ to swarm a mass of individual weaves, or to make just a single weave, with the
target in each case being identified by its range. A further decoding layer
then translated each range into rather more basic details of what to weave and
where to put the result: and so we arrive at the front door of the routine
-
below.
+ below.
int Weaver::weave(weave_order *wv) {
web *W = wv->weave_web;
- Indexer::set_current_file(wv->weave_to);
+ Indexer::set_current_file(wv->weave_to);
heterogeneous_tree *tree = WeaveTree::new_tree(wv);
TEMPORARY_TEXT(banner);
WRITE_TO(banner, "Weave of '%S' generated by Inweb", wv->booklet_title);
@@ -90,7 +90,7 @@ where to put the result: and so we arrive at the front door of the routine
Errors::fatal_with_file("unable to write woven file", wv->weave_to);
Formats::render(OUT, tree);
STREAM_CLOSE(OUT);
- Indexer::set_current_file(NULL);
+ Indexer::set_current_file(NULL);
return lines;
}
§1.1.
@@ -196,14 +196,14 @@ where to put the result: and so we arrive at the front door of the routine
enum REGULAR_MATERIAL from 1
enum MACRO_MATERIAL
- enum DEFINITION_MATERIAL
+ enum DEFINITION_MATERIAL
enum CODE_MATERIAL
enum ENDNOTES_MATERIAL
enum FOOTNOTES_MATERIAL
typedef struct weaver_state {
- int kind_of_material;
+ int kind_of_material;
int line_break_pending;
int next_heading_without_vertical_skip;
int horizontal_rule_just_drawn;
@@ -462,7 +462,7 @@ we only have to transcribe it. But not quite!
WRITE_TO(matter, "\n");
Weaver::commentary_text(tree, wv, state->ap, matter);
continue;
-
- This code is used in §2.7.2.3.
§2.7.2.3.1.1. Displayed source is the material marked with
arrows in column 1.
+
- This code is used in §2.7.2.3.
§2.7.2.3.1.1. Displayed source is the material marked with arrows in column 1.
@@ -496,7 +496,7 @@ add a vertical skip between them to show the division more clearly.
continue;
}
- This code is used in §2.7.2.3.1.
§2.7.2.3.1.3. Here our extension is simply to provide a tidier way to use TeX's standard
-
and
macros for indented list items.
+ and macros for indented list items.
@@ -565,7 +565,7 @@ in the source is set indented in code style.
if (F->cued_already == FALSE) Main::error_in_web(I"footnote never cued", L);
state->ap = FN;
}
-- This code is used in §2.7.2.3.1.
§2.7.2.3.2. Code-like matter. Even though Inweb's approach, unlike
's, is to respect the layout
+
- This code is used in §2.7.2.3.1.
§2.7.2.3.2. Code-like matter. Even though Inweb's approach, unlike 's, is to respect the layout
of the original, this is still quite typographically complex: commentary
and macro usage is rendered differently.
@@ -615,7 +615,7 @@ and macro usage is rendered differently.
DISCARD_TEXT(prefatory);
ClumsyLabel: ;
-- This code is used in §2.7.2.3.
§2.7.2.3.2.1. Code is typeset between the
and
macros in TeX,
+
- This code is used in §2.7.2.3.
§2.7.2.3.2.1. Code is typeset between the and macros in TeX,
hence the name of the following paragraph:
@@ -682,7 +682,7 @@ otherwise, they are set flush right.
}
DISCARD_TEXT(part_before_comment);
DISCARD_TEXT(part_within_comment);
-- This code is used in §2.7.2.3.2.
§2.7.2.3.2.4. Set the
definition escape very slightly more fancily:
+
- This code is used in §2.7.2.3.2.
§2.7.2.3.2.4. Set the definition escape very slightly more fancily:
@@ -753,7 +753,7 @@ otherwise, they are set flush right.
}
Regexp::dispose_of(&mr);
- This code is used in §2.7.2.3.2.
§3. Endnotes. The endnotes describe function calls from far away, or unexpected
-structure usage, or how
-style code substitutions were made.
+structure usage, or how -style code substitutions were made.
@@ -1018,7 +1018,7 @@ structure usage, or how
§7. Section tables of contents. These appear at the top of each woven section, and give links to the paragraphs
-marked as
headings.
+marked as headings.
diff --git a/docs/inweb/3-twot.html b/docs/inweb/3-twot.html
index 1c3217d..e6e95d2 100644
--- a/docs/inweb/3-twot.html
+++ b/docs/inweb/3-twot.html
@@ -48,8 +48,8 @@ function togglePopup(material_id) {
§1. Commentary text. The following takes text, divides it up at stroke-mark boundaries —
-that is,
, this is outside — and sends contiguous pieces
-of it either to
or
+that is, , this is outside — and sends contiguous pieces
+of it either to or
as appropriate.
diff --git a/docs/inweb/4-as.html b/docs/inweb/4-as.html
index 2682837..8149cc1 100644
--- a/docs/inweb/4-as.html
+++ b/docs/inweb/4-as.html
@@ -99,8 +99,8 @@ actually called ACME: the 6502 assembler of the same name.
if (Methods::provided(pl->methods, SYNTAX_COLOUR_WEA_MTID) == FALSE)
METHOD_ADD(pl, SYNTAX_COLOUR_WEA_MTID, ACMESupport::syntax_colour);
}
-§2. This utility does a very limited
-like job. (We don't want to use
-the actual
because that would make it possible for malicious language
+
§2. This utility does a very limited -like job. (We don't want to use
+the actual because that would make it possible for malicious language
files to crash Inweb.)
@@ -300,7 +300,7 @@ files to crash Inweb.)
}
§6. The following is an opportunity for us to scold the author for any
violation of the namespace rules. We're going to look for functions named
-
whose definitions are not in the
section;
+ whose definitions are not in the section;
in other words, we police the rule that functions actually are defined in the
namespace which their names imply. This can be turned off with a special
bibliographic variable, but don't do that.
diff --git a/docs/inweb/4-cl.html b/docs/inweb/4-cl.html
index 5d3c03b..22bf144 100644
--- a/docs/inweb/4-cl.html
+++ b/docs/inweb/4-cl.html
@@ -87,10 +87,10 @@ The structure definitions in this Inweb web all take the required form,
of course, and provide many more examples.
-Note that a
structure contains a
structure (in fact, five of
-them), but only contains pointers to
structures and itself.
-C requires therefore that the structure definition for
must occur
-earlier in the code than that for
. This is a nuisance, so Inweb
+
Note that a structure contains a structure (in fact, five of
+them), but only contains pointers to structures and itself.
+C requires therefore that the structure definition for must occur
+earlier in the code than that for . This is a nuisance, so Inweb
takes care of it automatically.
@@ -128,7 +128,7 @@ the sake of an illustrative example, let's suppose that line is:
unsigned long long int *val;
-We need to extract the element name,
, and make a note of it.
+
We need to extract the element name, , and make a note of it.
@@ -155,7 +155,7 @@ the sake of an illustrative example, let's suppose that line is:
}
}
DISCARD_TEXT(p);
-- This code is used in §2.1.
§2.1.1.1. The following reduces
to just
.
+
- This code is used in §2.1.
§2.1.1.1. The following reduces to just .
@@ -177,8 +177,8 @@ the sake of an illustrative example, let's suppose that line is:
break;
}
}
-- This code is used in §2.1.1.
§2.1.1.2. At this point
has been reduced to
, but the following moves
-
to point to the
:
+
- This code is used in §2.1.1.
§2.1.1.2. At this point has been reduced to , but the following moves
+ to point to the :
@@ -189,7 +189,7 @@ the sake of an illustrative example, let's suppose that line is:
while ((Str::get(pos)) && (Characters::is_space_or_tab(Str::get(pos)) == FALSE))
pos = Str::forward(pos);
-
- This code is used in §2.1.1.
§2.1.1.3. And this moves it past the
to point to the
in
:
+
- This code is used in §2.1.1.
§2.1.1.3. And this moves it past the to point to the in :
@@ -200,8 +200,8 @@ the sake of an illustrative example, let's suppose that line is:
while ((Characters::is_space_or_tab(Str::get(pos))) || (Str::get(pos) == '*') ||
(Str::get(pos) == '(') || (Str::get(pos) == ')')) pos = Str::forward(pos);
-
- This code is used in §2.1.1.
§2.1.1.4. This then first copies the substring
into
, then cuts that
-down to just the identifier characters at the front, i.e., to
.
+
- This code is used in §2.1.1.
§2.1.1.4. This then first copies the substring into , then cuts that
+down to just the identifier characters at the front, i.e., to .
@@ -212,14 +212,14 @@ down to just the identifier characters at the front, i.e., to
Str::substr(elname, pos, Str::end(p));
if (Regexp::match(&mr, elname, L"(%i+)%c*")) Str::copy(elname, mr.exp[0]);
-- This code is used in §2.1.1.
§2.2. Structure dependency. We say that S depends on T if
has an element whose type is
-
. That matters because if so then
has to be defined
-before
in the tangled output.
+
- This code is used in §2.1.1.
§2.2. Structure dependency. We say that S depends on T if has an element whose type is
+. That matters because if so then has to be defined
+before in the tangled output.
-It's important to note that
merely having a member of type
-
does not create a dependency. In the code below, because
-matches only identifier characters and
is not one of those, a line like
+
It's important to note that merely having a member of type
+ does not create a dependency. In the code below, because
+matches only identifier characters and is not one of those, a line like
@@ -256,7 +256,7 @@ matches only identifier characters and if ((str != current_str) &&
(Str::eq(used_structure, str->structure_name)))
ADD_TO_LINKED_LIST(str, language_type, current_str->incorporates);
-
- This code is used in §2.2.
§3. Functions. This time, we will need to keep track of
and
pairs
+
- This code is used in §2.2.
§3. Functions. This time, we will need to keep track of and pairs
in the source. This matters because we will want to predeclare functions;
but if functions are declared in conditional compilation, then their
predeclarations have to be made under the same conditions.
@@ -314,8 +314,8 @@ source line being scanned lies within.
type identifier(args...
-where we parse
only minimally. In InC (only), the identifier can
-contain namespace dividers written
. Function declarations, we will assume,
+
where we parse only minimally. In InC (only), the identifier can
+contain namespace dividers written . Function declarations, we will assume,
always begin on column 1 of their source files, and we expect them to take
modern ANSI C style, not the long-deprecated late 1970s C style.
@@ -349,7 +349,7 @@ modern ANSI C style, not the long-deprecated late 1970s C style.
}
§3.2.1. C has a whole soup of reserved words applying to types, but most of them
can't apply to the return type of a function. We do, however, iterate so that
-forms like
will work.
+forms like will work.
@@ -392,9 +392,9 @@ forms like
§5. Tangling extras. "Additional early matter" is used for the inclusions of the ANSI library
files. We need to do that early, because otherwise types declared in them
-(such as
) won't exist in time for the structure definitions we will
+(such as ) won't exist in time for the structure definitions we will
be tangling next.
-It might seem reasonable to move all
files up front this way,
+
It might seem reasonable to move all files up front this way,
not just the ANSI ones. But that would defeat any conditional compilation
around the inclusions; which Inform (for instance) needs in order to make
platform-specific details to handle directories without POSIX in Windows.
@@ -482,7 +482,7 @@ structures.
<Predeclare the functions 6.4>;
}
§6.1. A "simple typedef" here means one that is aliasing something other than
-a structure: for example
would be a simple typedef.
+a structure: for example would be a simple typedef.
@@ -504,8 +504,8 @@ a structure: for example
@@ -541,7 +541,7 @@ finished.
Tags::close_ifdefs(OUT, str->structure_header_at->owning_paragraph);
}
§6.4. Functions are rather easier to deal with. In general, if a function was
-defined within some number of nested
or
directives, then
+defined within some number of nested or directives, then
we reproduce those around the predeclaration: except, as a special trick,
if the line contains a particular comment. For example:
diff --git a/docs/inweb/4-is.html b/docs/inweb/4-is.html
index 474b1a7..9fd5e27 100644
--- a/docs/inweb/4-is.html
+++ b/docs/inweb/4-is.html
@@ -106,13 +106,13 @@ all of those methods, it has a whole lot more of its own.
}
§3.1. Parsing Preform grammar. This is where we look for declarations of nonterminals. Very little about
the following code will make sense unless you've first read the Preform
-section of the
module, which is what we're supporting, and seen
+section of the module, which is what we're supporting, and seen
some examples of Preform being used in the Inform source code.
-In parsing, we categorise the opening lines
. Subsequent lines
-of grammar are
; but the lines of InC code inside an
-
definition remain just plain
lines.
+
In parsing, we categorise the opening lines . Subsequent lines
+of grammar are ; but the lines of InC code inside an
+ definition remain just plain lines.
@@ -135,9 +135,9 @@ of grammar are
-- (a)
tangles to code which initialises the Preform
+- (a) tangles to code which initialises the Preform
grammar. (The grammar defines the meaning of nonterminals such as
-
. They're not terminal in the sense that they are defined
+. They're not terminal in the sense that they are defined
as combinations of other things.) In practice, this needs to appear once
in any program using Preform. For the Inform project, that's done in the
-
module of the Inform 7 compiler.
- - (b)
tangles to code which initialises the I-literals.
+ module of the Inform 7 compiler.
+ - (b) tangles to code which initialises the I-literals.
@@ -533,12 +533,12 @@ in any program using Preform. For the Inform project, that's done in the
§6. Time to predeclare things. InC is going to create a special function, right
at the end of the code, which "registers" the nonterminals, creating their
run-time data structures; we must predeclare this function. It will set values
-for the pointers
, and so on; these are global variables,
-which we initially declare as
.
+for the pointers , and so on; these are global variables,
+which we initially declare as .
-We also declare the nonterminal variables like
, initialising
-all integers to zero and all pointers to
.
+
We also declare the nonterminal variables like , initialising
+all integers to zero and all pointers to .
We do something similar, but simpler, to declare text stream constants.
@@ -604,7 +604,7 @@ They make use of macros and data structures defined in the Inform 7 web.
to how to tangle the lines we've given special categories to.
-We need to tangle
lines (those holding nonterminal declarations)
+
We need to tangle lines (those holding nonterminal declarations)
in a special way...
@@ -626,9 +626,9 @@ In the case of an internal definition, like
int k_kind_for_template_NTM(wording W, int *X, void **XP) {
-that is, to a function which returns
if it makes a match on the text
-excerpt in Inform's source text,
otherwise; if it matches and produces
-an integer and/or pointer result, these are copied into
and
. The
+
that is, to a function which returns if it makes a match on the text
+excerpt in Inform's source text, otherwise; if it matches and produces
+an integer and/or pointer result, these are copied into and . The
remaining lines of the function are tangled unaltered, i.e., following the
same rules as for the body of any other C function.
@@ -659,16 +659,16 @@ Thus the opening line
int action_clause_NTMC(int *X, void **XP, int *R, void **RP, wording *FW, wording W) {
-Subsequent lines of the nonterminal are categorised
+
Subsequent lines of the nonterminal are categorised
and thus won't tangle to code at all, by the usual rules; so we tangle from
them directly here.
Composition is what happens after a successful match of the text in the
-word range
. The idea is that, especially if the pattern was
+word range . The idea is that, especially if the pattern was
complicated, we will need to "compose" the results of parsing individual
pieces of it into a result for the whole. These partial results can be found
-in the arrays
and
passed as parameters; recall that every
+in the arrays and passed as parameters; recall that every
nonterminal has in principle both an integer and a pointer result, though
often one or both is undefined.
@@ -680,8 +680,8 @@ often one or both is undefined.
<cardinal-number> + <cardinal-number> ==> R[1] + R[2]
where the composition function would be called on a match of, say, "\(5 + 7\)",
-and would find the values 5 and 7 in
and
respectively. It would
-then add these together, store 12 in
, and return
to show that all
+and would find the values 5 and 7 in and respectively. It would
+then add these together, store 12 in , and return to show that all
was well.
@@ -693,10 +693,10 @@ was well.
which says that the composite result — the right-hand formula — is formed by
calling a particular routine on the integer result of subexpression 2
-(
) and the pointer result of subexpression 1
-(
). The answer, the composite result, that is, must be
-placed in
and
. (Composition functions are also allowed to
-invalidate the result, by returning
, and have other tricks up their
+() and the pointer result of subexpression 1
+(). The answer, the composite result, that is, must be
+placed in and . (Composition functions are also allowed to
+invalidate the result, by returning , and have other tricks up their
sleeves, but none of that is handled by Inweb: see the Inform 7 web for more
on this.)
@@ -716,7 +716,7 @@ on this.)
if (needs_collation) <At least one of the grammar lines provided an arrow and formula 9.1.2>
else <None of the grammar lines provided an arrow and formula 9.1.1>;
WRITE("\treturn TRUE;\n");
-§9.1.1. In the absence of any
formulae, we simply set
to the default
+
§9.1.1. In the absence of any formulae, we simply set to the default
result supplied; this is the production number within the grammar (0 for the
first line, 1 for the second, and so on) by default, with an undefined pointer.
@@ -756,11 +756,11 @@ and that it produces an integer or a pointer according to what the
non-terminal expects as its main result. But we make one exception: if
the formula begins with a paragraph macro, then it can't be an expression,
and instead we read it as code in a void context. (This code will, we
-assume, set
and/or
in some ingenious way of its own.)
+assume, set and/or in some ingenious way of its own.)
-Within the body of the formula, we allow a pseudo-macro to work:
-expands to word range
in the match which we're compositing. This actually
+
Within the body of the formula, we allow a pseudo-macro to work:
+expands to word range in the match which we're compositing. This actually
expands like so:
@@ -821,10 +821,10 @@ we also provide for some other special extensions to C.
PUT(Str::get_at(original, i));
}
}
-§10.1. For example, a function name like
must be rewritten
-as
since colons aren't valid in C identifiers. The
+
§10.1. For example, a function name like must be rewritten
+as since colons aren't valid in C identifiers. The
following is prone to all kinds of misreadings, of course; it picks up any use
-of
between an alphanumberic character and a letter. In particular, code
+of between an alphanumberic character and a letter. In particular, code
like
@@ -854,9 +854,9 @@ Inform, where no misreadings occur.
continue;
}
- This code is used in §10.
§10.2. Angle brackets around a valid Preform variable name expand into its
-C identifier; for example,
becomes
.
-We take no action if it's not a valid name, so
becomes
-just
.
+C identifier; for example, becomes .
+We take no action if it's not a valid name, so becomes
+just .
@@ -880,7 +880,7 @@ just
DISCARD_TEXT(check_this);
Regexp::dispose_of(&mr);
-- This code is used in §10.
§10.3. Similarly for nonterminals;
might become
.
+
- This code is used in §10.
§10.3. Similarly for nonterminals; might become .
Here, though, there's a complication:
@@ -894,8 +894,8 @@ Here, though, there's a complication:
if (Text__Languages__parse_nt_against_word_range(k_kind_NTM, W, NULL, NULL)) { ...
This is all syntactic sugar to make it easier to see parsing in action.
-Anyway, it means we have to set
to remember to add in the
-two
arguments when we hit the
a little later. We're doing all
+Anyway, it means we have to set to remember to add in the
+two arguments when we hit the a little later. We're doing all
of this fairly laxly, but as before: it only needs to work for Inform,
and Inform doesn't cause any trouble.
@@ -947,7 +947,7 @@ the size of Inform 7, there's no significant gain from speeding them up
return pnt;
return NULL;
}
-§12. The special variables
and
hold the results,
+
§12. The special variables and hold the results,
integer and pointer, for the most recent successful match. They're defined
in the Inform 7 web (see the code for parsing text against Preform grammars),
not by Inweb.
@@ -971,7 +971,7 @@ Inweb.
So what does happen to it? The answer is that it's transcribed into an
-auxiliary file called
, which Inform, once it is compiled,
+auxiliary file called , which Inform, once it is compiled,
will read in at run-time. This is how that happens:
@@ -1121,7 +1121,7 @@ nonterminal definitions:
WRITE("\n\n");
}
- This code is used in §14.
§15. Weaving methods. If we're weaving just a document of Preform grammar, then we skip any lines
-of C code which appear in
nonterminal definitions:
+of C code which appear in nonterminal definitions:
@@ -1151,7 +1151,7 @@ of C code which appear in
§17. In paragraphs where we spot Preform nonterminals being defined, we're
-going to automatically apply the tag
, but only if it already
+going to automatically apply the tag , but only if it already
exists. We watch for it here:
diff --git a/docs/inweb/4-lm.html b/docs/inweb/4-lm.html
index c018b56..4712d3a 100644
--- a/docs/inweb/4-lm.html
+++ b/docs/inweb/4-lm.html
@@ -51,7 +51,7 @@ function togglePopup(material_id) {
independent of the programming language being written, woven or tangled;
Knuth began literate programming with Pascal, but now uses C, and the original
Pascal webs were mechanically translated into C ones with remarkably little
-fuss or bother. Modern LP tools, such as
, aim to be language-agnostic.
+fuss or bother. Modern LP tools, such as , aim to be language-agnostic.
But of course if you act the same on all languages, you give up the benefits
which might follow from knowing something about the languages you actually
write in.
@@ -74,7 +74,7 @@ the web into chapters, sections and paragraphs, but for some languages we will
need a more detailed picture.
-
gives a language to look for type declarations.
+
gives a language to look for type declarations.
@@ -86,7 +86,7 @@ need a more detailed picture.
void LanguageMethods::parse_types(web *W, programming_language *pl) {
VMETHOD_CALL(pl, PARSE_TYPES_PAR_MTID, W);
}
-§3.
is, similarly, for function declarations.
+
§3. is, similarly, for function declarations.
@@ -98,7 +98,7 @@ need a more detailed picture.
void LanguageMethods::parse_functions(web *W, programming_language *pl) {
VMETHOD_CALL(pl, PARSE_FUNCTIONS_PAR_MTID, W);
}
-§4.
is "further" in that it is called when the main
+
§4. is "further" in that it is called when the main
parser has finished work; it typically looks over the whole web for something
of interest.
@@ -112,7 +112,7 @@ of interest.
void LanguageMethods::further_parsing(web *W, programming_language *pl) {
VMETHOD_CALL(pl, FURTHER_PARSING_PAR_MTID, W);
}
-§5.
looks at a single line, after the main parser
+
§5. looks at a single line, after the main parser
has given it a category. The idea is not so much to second-guess the parser
(although we can) but to change to a more exotic category which it would
otherwise never produce.
@@ -128,7 +128,7 @@ otherwise never produce.
VMETHOD_CALL(pl, SUBCATEGORISE_LINE_PAR_MTID, L);
}
§6. Comments have different syntax in different languages. The method here is
-expected to look for a comment on the
, and if so to return
,
+expected to look for a comment on the , and if so to return ,
but not before splicing the non-comment parts of the line before and
within the comment into the supplied strings.
@@ -151,8 +151,8 @@ the top to the bottom of the file.
The top of the tangled file is a header called the "shebang". By default,
-there's nothing there, but
allows the language to add one.
-For example, Perl prints
here.
+there's nothing there, but allows the language to add one.
+For example, Perl prints here.
@@ -194,10 +194,10 @@ at tangled (therefore not original) material.
VMETHOD_CALL(pl, ADDITIONAL_EARLY_MATTER_TAN_MTID, OUT, W, target);
}
§10. A tangled file then normally declares "definitions". The following write a
-definition of the constant named
as the value given. If the value spans
-multiple lines, the first-line part is supplied to
and
-then subsequent lines are fed in order to
. At the end,
-
is called.
+definition of the constant named as the value given. If the value spans
+multiple lines, the first-line part is supplied to and
+then subsequent lines are fed in order to . At the end,
+ is called.
@@ -264,8 +264,8 @@ the more routine matter, tangling ordinary paragraphs into code.
return (rv)?FALSE:TRUE;
}
§13. Inweb supports very few "tangle commands", that is, instructions written
-inside double squares
. These can be handled by attaching methods
-as follows, which return
if they recognised and acted on the command.
+inside double squares . These can be handled by attaching methods
+as follows, which return if they recognised and acted on the command.
@@ -281,7 +281,7 @@ as follows, which return
§17. It's a sad necessity, but sometimes we have to unconditionally tangle code
for a preprocessor to conditionally read: that is, to tangle code which contains
-
or similar preprocessor directive.
+ or similar preprocessor directive.
@@ -369,7 +369,7 @@ for a preprocessor to conditionally read: that is, to tangle code which contains
}
§19. The inner code tangler now acts on all code known not to contain CWEB
macros or double-square substitutions. In almost every language this simply
-passes the code straight through, printing
to
.
+passes the code straight through, printing to .
@@ -474,7 +474,7 @@ sake, which minimises the knock-on effect of any colouring mistakes.
matter, colouring);
return rv;
}
-§26. This method is called for each code line to be woven. If it returns
, the
+
§26. This method is called for each code line to be woven. If it returns , the
weaver carries on in the normal way. If not, it does nothing, assuming that the
method has already woven something more attractive.
@@ -492,7 +492,7 @@ method has already woven something more attractive.
IMETHOD_CALL(rv, pl, WEAVE_CODE_LINE_WEA_MTID, OUT, wv, W, C, S, L, matter, concluding_comment);
return rv;
}
-§27. When Inweb creates a new
, it lets everybody know about that.
+
§27. When Inweb creates a new , it lets everybody know about that.
diff --git a/docs/inweb/4-pl.html b/docs/inweb/4-pl.html
index 04bb4bf..40e1fbc 100644
--- a/docs/inweb/4-pl.html
+++ b/docs/inweb/4-pl.html
@@ -47,7 +47,7 @@ function togglePopup(material_id) {
-§1. Languages. Programming languages are identified by name: for example,
or
.
+
§1. Languages. Programming languages are identified by name: for example, or .
§2.
@@ -191,16 +191,16 @@ into the following structure (one per language):
int suppress_disclaimer;
int C_like;
- struct linked_list *reserved_words;
+ struct linked_list *reserved_words;
struct hash_table built_in_keywords;
struct colouring_language_block *program;
METHOD_CALLS
MEMORY_MANAGEMENT
} programming_language;
-- The structure programming_language is accessed in 1/pc, 3/tt, 4/taf, 4/lm, 4/as, 4/tp, 5/hf, 5/df and here.
§7. This is a simple one-pass compiler. The
provides
+
- The structure programming_language is accessed in 1/pc, 3/tt, 4/taf, 4/lm, 4/as, 4/tp, 5/hf, 5/df and here.
§7. This is a simple one-pass compiler. The provides
the only state preserved as we work through line by line, except of course
-that we are also working on the programming language it is
. The
-
is the braced block of colouring instructions we are
+that we are also working on the programming language it is . The
+ is the braced block of colouring instructions we are
currently inside.
@@ -267,7 +267,7 @@ the language whose name is InC gets even more, without having to ask.
Languages have effect through their method calls, which is how those
-extra features are provided. The call to
+extra features are provided. The call to
adds generic method calls to give effect to the settings in the definition.
@@ -449,7 +449,7 @@ runs of a given colour, or give an if-X-then-Y rule:
Errors::in_text_file("line in colouring block illegible", tfp);
}
}
-§9. Blocks. These are code blocks of colouring instructions. A block whose
is
+
§9. Blocks. These are code blocks of colouring instructions. A block whose is
represents a complete program.
@@ -464,12 +464,12 @@ represents a complete program.
typedef struct colouring_language_block {
- struct linked_list *rules;
- struct colouring_language_block *parent;
- int run;
- struct text_stream *run_instance;
- struct text_stream *char_set;
- wchar_t match_regexp_text[MAX_ILDF_REGEXP_LENGTH];
+ struct linked_list *rules;
+ struct colouring_language_block *parent;
+ int run;
+ struct text_stream *run_instance;
+ struct text_stream *char_set;
+ wchar_t match_regexp_text[MAX_ILDF_REGEXP_LENGTH];
struct match_results mr;
@@ -500,28 +500,28 @@ little context before it (where available).
define NOT_A_RULE_PREFIX 1
- define UNSPACED_RULE_PREFIX 2
- define SPACED_RULE_PREFIX 3
- define OPTIONALLY_SPACED_RULE_PREFIX 4
- define UNSPACED_RULE_SUFFIX 5
- define SPACED_RULE_SUFFIX 6
- define OPTIONALLY_SPACED_RULE_SUFFIX 7
+ define UNSPACED_RULE_PREFIX 2
+ define SPACED_RULE_PREFIX 3
+ define OPTIONALLY_SPACED_RULE_PREFIX 4
+ define UNSPACED_RULE_SUFFIX 5
+ define SPACED_RULE_SUFFIX 6
+ define OPTIONALLY_SPACED_RULE_SUFFIX 7
define MAX_ILDF_REGEXP_LENGTH 64
typedef struct colouring_rule {
- int sense;
- int match_colour;
- int match_keyword_of_colour;
+ int sense;
+ int match_colour;
+ int match_keyword_of_colour;
struct text_stream *match_text;
- int match_prefix;
+ int match_prefix;
wchar_t match_regexp_text[MAX_ILDF_REGEXP_LENGTH];
- int number;
- int number_of;
+ int number;
+ int number_of;
- struct colouring_language_block *execute_block;
+ struct colouring_language_block *execute_block;
int set_to_colour;
int set_prefix_to_colour;
int debug;
@@ -634,7 +634,7 @@ little context before it (where available).
} else {
Errors::in_text_file("action after '=>' illegible", tfp);
}
-
- This code is used in §13.
§14. Reserved words. Note that these can come in any colour, though usually it's
.
+
- This code is used in §13.
§14. Reserved words. Note that these can come in any colour, though usually it's .
@@ -702,7 +702,7 @@ but which are not expressible in the syntax of this file.
return PLAIN_COLOUR;
}
}
-
§16. A boolean must be written as
or
.
+
§16. A boolean must be written as or .
@@ -714,8 +714,8 @@ but which are not expressible in the syntax of this file.
return FALSE;
}
}
-
§17. In text,
represents a newline,
a space and
a tab. Spaces
-can be given in the ordinary way inside a text in any case.
is a
+
§17. In text, represents a newline, a space and a tab. Spaces
+can be given in the ordinary way inside a text in any case. is a
literal backslash.
diff --git a/docs/inweb/4-taf.html b/docs/inweb/4-taf.html
index e94dc95..a2a12d1 100644
--- a/docs/inweb/4-taf.html
+++ b/docs/inweb/4-taf.html
@@ -47,17 +47,17 @@ function togglePopup(material_id) {
-§1. For each
we find, we will make one of these:
+
§1. For each we find, we will make one of these:
typedef struct language_type {
struct text_stream *structure_name;
int tangled;
- struct source_line *structure_header_at;
- struct source_line *typedef_ends;
- struct linked_list *incorporates;
- struct linked_list *elements;
+ struct source_line *structure_header_at;
+ struct source_line *typedef_ends;
+ struct linked_list *incorporates;
+ struct linked_list *elements;
struct language_type *next_cst_alphabetically;
MEMORY_MANAGEMENT
} language_type;
@@ -120,13 +120,13 @@ function togglePopup(material_id) {
}
if (placed == FALSE) last->next_cst_alphabetically = str;
}
-
§3. A language can also create an instance of
to record the
-existence of the element
, and add it to the linked list of elements of
+
§3. A language can also create an instance of to record the
+existence of the element , and add it to the linked list of elements of
the structure being defined.
In InC, only, certain element names used often in Inform's source code are
-given mildly special treatment. This doesn't amount to much.
+given mildly special treatment. This doesn't amount to much.
has no effect on tangling, so it doesn't change the program. It simply
affects the reports in the woven code about where structures are used.
@@ -168,9 +168,9 @@ affects the reports in the woven code about where structures are used.
typedef struct language_function {
- struct text_stream *function_name;
- struct text_stream *function_type;
- struct text_stream *function_arguments;
+ struct text_stream *function_name;
+ struct text_stream *function_type;
+ struct text_stream *function_arguments;
struct source_line *function_header_at;
int within_namespace;
int called_from_other_sections;
@@ -254,7 +254,7 @@ part of the function structure. We'll need it when predeclaring the function.
DISCARD_TEXT(err_mess);
}
Regexp::dispose_of(&mr);
-
§8. Cataloguing. This implements the additional information in the
and
+
§8. Cataloguing. This implements the additional information in the and
forms of section catalogue.
diff --git a/docs/inweb/4-tp.html b/docs/inweb/4-tp.html
index 8804ba6..1ab11b9 100644
--- a/docs/inweb/4-tp.html
+++ b/docs/inweb/4-tp.html
@@ -48,15 +48,15 @@ function togglePopup(material_id) {
§1. This is a very simple syntax colouring algorithm. The work is done by the
-function
, which can in principle be applied to texts
+function , which can in principle be applied to texts
of any length. But it's usually convenient to run it on a long file one line
-at a time, so that it is called repeatedly. The variable
+at a time, so that it is called repeatedly. The variable
remembers where we were at the end of the previous line, so that we can pick
up again later at the start of the next.
Because of that, we need to call the following before we begin a run of calls
-to
:
+to :
@@ -65,16 +65,16 @@ to colouring_state = PLAIN_COLOUR;
painter_count = 1;
}
-
§2. As we begin, the text to colour is in
, while
is an
+
§2. As we begin, the text to colour is in , while is an
equal-length text where each character represents the colour of its
-corresponding character in
. For example, we might start as:
+corresponding character in . For example, we might start as:
int x = 55;
ppppppppppp
-with every character having
, but end up with:
+
with every character having , but end up with:
@@ -220,7 +220,7 @@ its colouring program.
§2.3. For the moment, we always adopt the C rules on identifiers: they have to
begin with an underscore or letter, then continue with underscores or
alphanumeric characters, except that if the language allows it then they
-can contain a
namespace divider.
+can contain a namespace divider.
@@ -353,12 +353,12 @@ rule across the whole snippet before moving on to the next.
- define UNSPACED_RULE_PREFIX 2
- define SPACED_RULE_PREFIX 3
- define OPTIONALLY_SPACED_RULE_PREFIX 4
- define UNSPACED_RULE_SUFFIX 5
- define SPACED_RULE_SUFFIX 6
- define OPTIONALLY_SPACED_RULE_SUFFIX 7
+ define UNSPACED_RULE_PREFIX 2
+ define SPACED_RULE_PREFIX 3
+ define OPTIONALLY_SPACED_RULE_PREFIX 4
+ define UNSPACED_RULE_SUFFIX 5
+ define SPACED_RULE_SUFFIX 6
+ define OPTIONALLY_SPACED_RULE_SUFFIX 7
int Painter::satisfies(hash_table *HT, colouring_rule *rule, text_stream *matter,
diff --git a/docs/inweb/5-df.html b/docs/inweb/5-df.html
index d1a7dfd..5814e5d 100644
--- a/docs/inweb/5-df.html
+++ b/docs/inweb/5-df.html
@@ -122,7 +122,7 @@ function togglePopup(material_id) {
WRITE("\n");
return TRUE;
}
-
- The structure debugging_render_state is accessed in 1/ptt, 3/twot, 5/wt, 5/fm, 5/ptf, 5/tf, 5/hf, 6/rw and here.
§2.1.
+- The structure debugging_render_state is accessed in 1/ptt, 3/twot, 5/wt, 5/fm, 5/ptf, 5/tf, 5/hf, 5/wp, 6/rw and here.
§2.1.
<Render document 2.1> =
diff --git a/docs/inweb/5-fm.html b/docs/inweb/5-fm.html
index b3b905b..f72389a 100644
--- a/docs/inweb/5-fm.html
+++ b/docs/inweb/5-fm.html
@@ -67,7 +67,7 @@ through optional method calls.
return wf;
}
-weave_format *Formats::find_by_name(text_stream *name) {
+weave_format *Formats::find_by_name(text_stream *name) {
weave_format *wf;
LOOP_OVER(wf, weave_format)
if (Str::eq_insensitive(name, wf->format_name))
@@ -76,8 +76,8 @@ through optional method calls.
}
- The structure weave_format is accessed in 1/ts, 5/wp and here.
§2. Note that this is the file extension before any post-processing. For
example, PDFs are made by weaving a TeX file and then running this through
-
. The extension here will be
because that's what the weave
-stage produces, even though we will later end up with a
.
+. The extension here will be because that's what the weave
+stage produces, even though we will later end up with a .
@@ -98,13 +98,13 @@ stage produces, even though we will later end up with a
-
is called before any output is generated, indeed,
+
is called before any output is generated, indeed,
before even the filename(s) for the output are worked out. Note that it
-can return a
code to change the swarm behaviour of the weave to come;
+can return a code to change the swarm behaviour of the weave to come;
this is helpful for EPUB weaving.
-More simply,
is called when all weaving is done.
+
More simply, is called when all weaving is done.
@@ -124,7 +124,7 @@ this is helpful for EPUB weaving.
void Formats::end_weaving(web *W, weave_pattern *pattern) {
VMETHOD_CALL(pattern->pattern_format, END_WEAVING_FOR_MTID, W, pattern);
}
-
§5.
renders the weave tree in the given format: a format must
+
§5. renders the weave tree in the given format: a format must
provide this.
@@ -225,7 +225,7 @@ to make an index page in HTML which provides annotated links to those PDFs.
return rv;
}
§11. And in that index file, we may want to substitute in values for placeholder
-text like
in the template file. This is the
.
+text like in the template file. This is the .
diff --git a/docs/inweb/5-hf.html b/docs/inweb/5-hf.html
index 4fcb357..e938063 100644
--- a/docs/inweb/5-hf.html
+++ b/docs/inweb/5-hf.html
@@ -85,7 +85,7 @@ but in fact that's fine here.)
int html_in_para = HTML_OUT;
-int item_depth = 0;
+int item_depth = 0;
void HTMLFormat::p(OUTPUT_STREAM, char *class) {
if (class) HTML_OPEN_WITH("p", "class=\"%s\"", class)
@@ -246,7 +246,7 @@ which is itself inside a list entry"; and so on.
else internal_error("unable to render unknown node");
return TRUE;
}
-
- The structure HTML_render_state is accessed in 1/ptt, 3/twot, 5/wt, 5/fm, 5/ptf, 5/tf, 5/df, 6/rw and here.
§5.1.
+- The structure HTML_render_state is accessed in 1/ptt, 3/twot, 5/wt, 5/fm, 5/ptf, 5/tf, 5/df, 5/wp, 6/rw and here.
§5.1.
<Render head 5.1> =
@@ -365,7 +365,7 @@ which is itself inside a list entry"; and so on.
filename *RF = Filenames::from_text(C->figname);
HTML_OPEN("center");
HTML::image_to_dimensions(OUT, RF, C->w, C->h);
- Patterns::copy_file_into_weave(hrs->wv->weave_web, F, NULL, NULL);
+ Patterns::copy_file_into_weave(hrs->wv->weave_web, F, NULL, NULL);
HTML_CLOSE("center");
WRITE("\n");
§5.12.
@@ -448,8 +448,8 @@ which is itself inside a list entry"; and so on.
hrs->last_material_seen = C->material_type;
}
return FALSE;
-§5.13. This has to embed some Internet-sourced content.
-here is something like
or
, and
is whatever code
+
§5.13. This has to embed some Internet-sourced content.
+here is something like or , and is whatever code
that service uses to identify the video/audio in question.
@@ -659,9 +659,8 @@ that service uses to identify the video/audio in question.
weave_footnote_cue_node *C = RETRIEVE_POINTER_weave_footnote_cue_node(N->content);
- text_stream *fn_plugin_name =
- Bibliographic::get_datum(hrs->wv->weave_web->md, I"Footnotes Plugin");
- if (Str::ne_insensitive(fn_plugin_name, I"None"))
+ text_stream *fn_plugin_name = hrs->wv->pattern->footnotes_plugin;
+ if (Str::len(fn_plugin_name) > 0)
Swarm::ensure_plugin(hrs->wv, fn_plugin_name);
WRITE("<sup id=\"fnref:%S\"><a href=\"#fn:%S\" rel=\"footnote\">%S</a></sup>",
C->cue_text, C->cue_text, C->cue_text);
@@ -671,9 +670,8 @@ that service uses to identify the video/audio in question.
weave_begin_footnote_text_node *C = RETRIEVE_POINTER_weave_begin_footnote_text_node(N->content);
- text_stream *fn_plugin_name =
- Bibliographic::get_datum(hrs->wv->weave_web->md, I"Footnotes Plugin");
- if (Str::ne_insensitive(fn_plugin_name, I"None"))
+ text_stream *fn_plugin_name = hrs->wv->pattern->footnotes_plugin;
+ if (Str::len(fn_plugin_name) > 0)
Swarm::ensure_plugin(hrs->wv, fn_plugin_name);
WRITE("<li class=\"footnote\" id=\"fn:%S\"><p class=\"inwebfootnote\">", C->cue_text);
for (tree_node *M = N->child; M; M = M->next)
@@ -733,10 +731,10 @@ that service uses to identify the video/audio in question.
- HTML_OPEN_WITH("code", "class=\"display\"");
+ HTML_OPEN_WITH("span", "class=\"extract\"");
for (tree_node *M = N->child; M; M = M->next)
Trees::traverse_from(M, &HTMLFormat::render_visit, (void *) hrs, L+1);
- HTML_CLOSE("code");
+ HTML_CLOSE("span");
return FALSE;
§5.34.
<Render locale 5.34> =
@@ -759,9 +757,8 @@ that service uses to identify the video/audio in question.
weave_maths_node *C = RETRIEVE_POINTER_weave_maths_node(N->content);
- text_stream *plugin_name =
- Bibliographic::get_datum(hrs->wv->weave_web->md, I"TeX Mathematics Plugin");
- if (Str::eq_insensitive(plugin_name, I"None")) {
+ text_stream *plugin_name = hrs->wv->pattern->mathematics_plugin;
+ if (Str::len(plugin_name) == 0) {
TEMPORARY_TEXT(R);
TeX::remove_math_mode(R, C->content);
HTMLFormat::escape_text(OUT, R);
diff --git a/docs/inweb/5-ptf.html b/docs/inweb/5-ptf.html
index 0b6a4a7..ff23ab5 100644
--- a/docs/inweb/5-ptf.html
+++ b/docs/inweb/5-ptf.html
@@ -120,7 +120,7 @@ function togglePopup(material_id) {
else internal_error("unable to render unknown node");
return TRUE;
}
-
- The structure PlainText_render_state is accessed in 1/ptt, 3/twot, 5/wt, 5/fm, 5/tf, 5/hf, 5/df, 6/rw and here.
§2.1.
+- The structure PlainText_render_state is accessed in 1/ptt, 3/twot, 5/wt, 5/fm, 5/tf, 5/hf, 5/df, 5/wp, 6/rw and here.
§2.1.
<Render head 2.1> =
diff --git a/docs/inweb/5-rtt.html b/docs/inweb/5-rtt.html
index 3bad94e..0c0fd28 100644
--- a/docs/inweb/5-rtt.html
+++ b/docs/inweb/5-rtt.html
@@ -47,13 +47,13 @@ function togglePopup(material_id) {
-§1. Running TeX. Although we are running
, a modern variant of TeX, rather than the
+
§1. Running TeX. Although we are running , a modern variant of TeX, rather than the
original, they are very similar as command-line tools; the difference is
that the output is a PDF file rather than a DVI file, Knuth's original stab
at the same basic idea.
-In particular, we call it in
so that any errors
+
In particular, we call it in so that any errors
whizz by rather than interrupting or halting the session. Because of that, we
spool the output onto a console file which we can then read in and parse to
find the number of errors actually generated. Prime among errors is the
diff --git a/docs/inweb/5-tf.html b/docs/inweb/5-tf.html
index ed4ab34..f18551e 100644
--- a/docs/inweb/5-tf.html
+++ b/docs/inweb/5-tf.html
@@ -172,7 +172,7 @@ function togglePopup(material_id) {
else internal_error("unable to render unknown node");
return TRUE;
}
-
- The structure TeX_render_state is accessed in 1/ptt, 3/twot, 5/wt, 5/fm, 5/ptf, 5/hf, 5/df, 6/rw and here.
§2.1.
+- The structure TeX_render_state is accessed in 1/ptt, 3/twot, 5/wt, 5/fm, 5/ptf, 5/hf, 5/df, 5/wp, 6/rw and here.
§2.1.
<Render head 2.1> =
@@ -249,7 +249,7 @@ function togglePopup(material_id) {
§2.11. TeX itself has an almost defiant lack of support for anything pictorial,
which is one reason it didn't live up to its hope of being the definitive basis
for typography; even today the loose confederation of TeX-like programs and
-extensions lack standard approaches. Here we're going to use
features,
+extensions lack standard approaches. Here we're going to use features,
having nothing better. All we're trying for is to insert a picture, scaled
to a given width, into the text at the current position.
@@ -371,11 +371,7 @@ to a given width, into the text at the current position.
- weave_toc_node *C = RETRIEVE_POINTER_weave_toc_node(N->content);
- if (trs->wv->pattern->show_abbrevs)
- WRITE("\\medskip\\hrule\\smallskip\\par\\noindent{\\usagefont %S.", C->text1);
- else
- WRITE("\\medskip\\hrule\\smallskip\\par\\noindent{\\usagefont ");
+ WRITE("\\medskip\\hrule\\smallskip\\par\\noindent{\\usagefont ");
for (tree_node *M = N->child; M; M = M->next) {
Trees::traverse_from(M, &HTMLFormat::render_visit, (void *) trs, L+1);
if (M->next) WRITE("; ");
@@ -495,9 +491,9 @@ to a given width, into the text at the current position.
if (C->displayed) WRITE("$$"); else WRITE("$");
WRITE("%S", C->content);
if (C->displayed) WRITE("$$"); else WRITE("$");
-
§2.1.1. We don't use TeX's
mechanism for macros because it is so prone to
+
§2.1.1. We don't use TeX's mechanism for macros because it is so prone to
failures when searching directories (especially those with spaces in the
-names) and then locking TeX into a repeated prompt for help from
+names) and then locking TeX into a repeated prompt for help from
which is rather hard to escape from.
@@ -554,10 +550,7 @@ which is rather hard to escape from.
text_stream *text1, text_stream *text2, paragraph *P) {
switch (stage) {
case 1:
- if (wv->pattern->show_abbrevs)
- WRITE("\\medskip\\hrule\\smallskip\\par\\noindent{\\usagefont %S.", text1);
- else
- WRITE("\\medskip\\hrule\\smallskip\\par\\noindent{\\usagefont ");
+ WRITE("\\medskip\\hrule\\smallskip\\par\\noindent{\\usagefont ");
break;
case 2:
WRITE("; ");
@@ -580,7 +573,6 @@ which is rather hard to escape from.
LOOP_OVER_LINKED_LIST(S, section, C->sections) {
WRITE("\\smallskip\\noindent ");
if (wv->pattern->number_sections) WRITE("%d. ", S->printed_number);
- if (wv->pattern->show_abbrevs) WRITE("|%S|: ", S->md->sect_range);
WRITE("{\\it %S}\\qquad\n%S", S->md->sect_title, S->sect_purpose);
}
}
@@ -605,7 +597,7 @@ which is rather hard to escape from.
Str::clear(modified);
WRITE_TO(modified, "{\\sinchhigh %S}\\quad %S", mr.exp[0], mr.exp[1]);
}
- if ((weight == 2) && ((S->md->is_a_singleton) || (wv->pattern->show_abbrevs == FALSE)))
+ if (weight == 2)
WRITE("\\%S{%S}{%S}{%S}{\\%S}{%S}%%\n",
TeX_macro, N, modified, mark, orn, NULL);
else
@@ -626,9 +618,9 @@ to pass the weight that way. Instead we use
\weavesectionss
\weavesectionsss
-where the weight is the number of terminal
s, 0 to 3. (TeX macros,
+
where the weight is the number of terminal s, 0 to 3. (TeX macros,
lamentably, are not allowed digits in their name.) In the cases 0 and 1, we
-also have variants
and
which are
+also have variants and which are
the same, but with the initial vertical spacing removed; these allow us to
prevent unsightly excess white space in certain configurations of a section.
@@ -664,7 +656,7 @@ 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.
-The ornament has to be set in math mode, even in the mark.
and
,
+
The ornament has to be set in math mode, even in the mark. and ,
making a section sign and a pilcrow respectively, only work in math mode
because they abbreviate characters found in math fonts but not regular ones,
in TeX's deeply peculiar font encoding system.
@@ -684,8 +676,7 @@ in TeX's deeply peculiar font encoding system.
}
if (weight == 2) {
Str::copy(sectionmark, S->md->sect_title);
- if (wv->pattern->show_abbrevs == FALSE) Str::clear(chaptermark);
- else if (Str::len(S->md->sect_range) > 0) Str::copy(chaptermark, S->md->sect_range);
+ Str::clear(chaptermark);
if (Str::len(chaptermark) > 0) {
Str::clear(sectionmark);
WRITE_TO(sectionmark, " - %S", S->md->sect_title);
@@ -714,7 +705,7 @@ mode once again:
}
colour_wanted = PLAIN_COLOUR; <Adjust code colour as necessary 8.2>;
}
-
§8.1. We actually use
horizontal spaces rather than risk using TeX's
+
§8.1. We actually use horizontal spaces rather than risk using TeX's
messy alignment system:
@@ -952,8 +943,8 @@ the special Preform grammar document.
return RunningTeX::substitute_post_processing_data(OUT, wv, detail);
}
§20. Removing math mode. "Math mode", in TeX jargon, is what happens when a mathematical formula
-is written inside dollar signs: in
, the math mode
-content is
. But since math mode doesn't (easily) exist in HTML,
+is written inside dollar signs: in , the math mode
+content is . But since math mode doesn't (easily) exist in HTML,
for example, we want to strip it out if the format is not TeX-related.
To do this, the weaver calls the following.
@@ -986,7 +977,7 @@ To do this, the weaver calls the following.
}
}
}
-§20.1. Here we remove
, converting it to
.
+
§20.1. Here we remove , converting it to .
@@ -1027,7 +1018,7 @@ To do this, the weaver calls the following.
TeX::remove_math_mode_range(OUT, text, j+2, to);
return;
}
-- This code is used in §20.
§20.2. Here we remove
, converting it to
, and similarly
.
+
- This code is used in §20.
§20.2. Here we remove , converting it to , and similarly .
@@ -1049,8 +1040,8 @@ To do this, the weaver calls the following.
TeX::remove_math_mode_range(OUT, text, j+1, to);
return;
}
-- This code is used in §20.
§20.3. Here we remove
, converting it to
. As a special case,
-we also look out for
for cube root.
+
- This code is used in §20.
§20.3. Here we remove , converting it to . As a special case,
+we also look out for for cube root.
@@ -1214,7 +1205,7 @@ we also look out for
-void WeavePlugins::include_plugin(OUTPUT_STREAM, web *W, weave_plugin *wp,
+void WeavePlugins::include_plugin(OUTPUT_STREAM, web *W, weave_plugin *wp,
weave_pattern *pattern, filename *from) {
if (wp->last_included_in_round == current_inclusion_round) return;
wp->last_included_in_round = current_inclusion_round;
@@ -149,28 +149,27 @@ inclusion of that, and also copy the file into the weave destination.
Indexer::incorporate_template_for_web_and_pattern(OUT,
W, pattern, F);
} else {
- Patterns::copy_file_into_weave(W, F, AP, NULL);
+ <Use shell scripting to copy the file over 5.1>;
}
} else {
if (html_mode) {
TEMPORARY_TEXT(ext);
Filenames::write_extension(ext, F);
if (Str::eq_insensitive(ext, I".css")) {
- TEMPORARY_TEXT(url);
- if (AP) Pathnames::relative_URL(url, Filenames::up(from), AP);
- WRITE_TO(url, "%S", leafname);
- WRITE("<link href=\"%S\" rel=\"stylesheet\" rev=\"stylesheet\" type=\"text/css\">\n", url);
- DISCARD_TEXT(url);
- }
- if (Str::eq_insensitive(ext, I".js")) {
+ WeavePlugins::include_CSS_file(OUT, W, F, leafname, NULL, pattern, from);
+ } else if (Str::eq_insensitive(ext, I".js")) {
TEMPORARY_TEXT(url);
if (AP) Pathnames::relative_URL(url, Filenames::up(from), AP);
WRITE_TO(url, "%S", leafname);
WRITE("<script src=\"%S\"></script>\n", url);
DISCARD_TEXT(url);
+ <Use shell scripting to copy the file over 5.1>;
+ } else {
+ <Use shell scripting to copy the file over 5.1>;
}
+ } else {
+ <Use shell scripting to copy the file over 5.1>;
}
- Patterns::copy_file_into_weave(W, F, AP, NULL);
}
finds++;
}
@@ -187,15 +186,24 @@ inclusion of that, and also copy the file into the weave destination.
}
DISCARD_TEXT(required);
}
-
§6.
+§5.1.
+<Use shell scripting to copy the file over 5.1> =
+
-void WeavePlugins::include_colour_scheme(OUTPUT_STREAM, web *W, colour_scheme *cs,
+ Patterns::copy_file_into_weave(W, F, AP, NULL);
+ if (W->as_ebook) {
+ filename *rel = Filenames::in(NULL, leafname);
+ Epub::note_image(W->as_ebook, rel);
+ }
+
- This code is used in §5 (four times).
§6.
+
+
+void WeavePlugins::include_colour_scheme(OUTPUT_STREAM, web *W, colour_scheme *cs,
weave_pattern *pattern, filename *from) {
if (cs->last_included_in_round == current_inclusion_round) return;
cs->last_included_in_round = current_inclusion_round;
if (Str::eq(pattern->pattern_format->format_name, I"HTML")) {
- pathname *AP = Colonies::assets_path();
TEMPORARY_TEXT(css);
WRITE_TO(css, "%S.css", cs->scheme_name);
filename *F = Patterns::find_asset(pattern, I"Colouring", css);
@@ -207,16 +215,36 @@ inclusion of that, and also copy the file into the weave destination.
Main::error_in_web(err, NULL);
DISCARD_TEXT(err);
} else {
- TEMPORARY_TEXT(url);
- if (AP) Pathnames::relative_URL(url, Filenames::up(from), AP);
- WRITE_TO(url, "%S", css);
- WRITE("<link href=\"%S\" rel=\"stylesheet\" rev=\"stylesheet\" type=\"text/css\">\n", url);
- DISCARD_TEXT(url);
- Patterns::copy_file_into_weave(W, F, AP, cs->prefix);
+ WeavePlugins::include_CSS_file(OUT, W, F, css, cs->prefix, pattern, from);
}
DISCARD_TEXT(css);
}
}
+
+void WeavePlugins::include_CSS_file(OUTPUT_STREAM, web *W, filename *F, text_stream *css,
+ text_stream *trans, weave_pattern *pattern, filename *from) {
+ if (pattern->embed_CSS) {
+ WRITE("<style type=\"text/css\">\n");
+ css_file_transformation cft;
+ cft.OUT = OUT;
+ cft.trans = trans;
+ TextFiles::read(F, FALSE, "can't open CSS file", TRUE,
+ Patterns::transform_CSS, NULL, (void *) &cft);
+ WRITE("</style>\n");
+ } else {
+ pathname *AP = Colonies::assets_path();
+ TEMPORARY_TEXT(url);
+ if (AP) Pathnames::relative_URL(url, Filenames::up(from), AP);
+ WRITE_TO(url, "%S", css);
+ WRITE("<link href=\"%S\" rel=\"stylesheet\" rev=\"stylesheet\" type=\"text/css\">\n", url);
+ DISCARD_TEXT(url);
+ Patterns::copy_file_into_weave(W, F, AP, trans);
+ if (W->as_ebook) {
+ filename *rel = Filenames::in(NULL, css);
+ Epub::note_image(W->as_ebook, rel);
+ }
+ }
+}
diff --git a/docs/inweb/5-wt.html b/docs/inweb/5-wt.html
index 45a8933..a255a52 100644
--- a/docs/inweb/5-wt.html
+++ b/docs/inweb/5-wt.html
@@ -546,7 +546,7 @@ function togglePopup(material_id) {
C->h = h;
return Trees::new_node(tree, weave_embed_node_type, STORE_POINTER_weave_embed_node(C));
}
-§3. This node weaves an angle-bracketed paragraph macro name.
is set
+
§3. This node weaves an angle-bracketed paragraph macro name. is set
if and only if this is the place where the macro is defined — the usual
thing is to render some sort of equals sign after it, if so.
@@ -559,7 +559,7 @@ thing is to render some sort of equals sign after it, if so.
return Trees::new_node(tree, weave_pmac_node_type, STORE_POINTER_weave_pmac_node(C));
}
§4. The following should render some kind of skip, and may want to take note of
-whether this happens in commentary or in code: the
flag provides this
+whether this happens in commentary or in code: the flag provides this
information.
@@ -570,7 +570,7 @@ information.
return Trees::new_node(tree, weave_vskip_node_type, STORE_POINTER_weave_vskip_node(C));
}
§5. An opportunity for vertical tidying-up. At the beginning of a code
-line which occurs after a run of
or
definitions, this node is
+line which occurs after a run of or definitions, this node is
placed. It can then insert a little vertical gap to separate the code from
the definitions.
@@ -685,7 +685,7 @@ definition has just occurred.
C->fn = fn;
return Trees::new_node(tree, weave_function_defn_node_type, STORE_POINTER_weave_function_defn_node(C));
}
-§8. This node produces the
bits of example source text, really
+
§8. This node produces the bits of example source text, really
a convenience for Inform 7 code commentary.
@@ -696,18 +696,18 @@ a convenience for Inform 7 code commentary.
return Trees::new_node(tree, weave_display_line_node_type, STORE_POINTER_weave_display_line_node(C));
}
§9. An item node produces an item marker in a typical (a), (b), (c), ... sort
-of list.
can be 1 or 2: you can have lists in lists, but not lists in
-lists in lists.
is the marker text, e.g.,
,
,
, ...; it can
+of list. can be 1 or 2: you can have lists in lists, but not lists in
+lists in lists. is the marker text, e.g., , , , ...; it can
also be empty, in which case the method should move to the matching level of
indentation but not weave any bracketed marker.
-