diff --git a/Chapter 3/The Weaver of Text.w b/Chapter 3/The Weaver of Text.w
index ddd731e..eaf129f 100644
--- a/Chapter 3/The Weaver of Text.w
+++ b/Chapter 3/The Weaver of Text.w
@@ -25,8 +25,6 @@ void TextWeaver::commentary_r(heterogeneous_tree *tree, tree_node *ap, text_stre
(in_code)?(I"Code In Code Comments Notation"):(I"Code In Commentary Notation"));
if (Str::ne(code_in_comments_notation, I"Off")) @
§2. Computer verification has been made up to around \(10^{18}\), but by rather
diff --git a/docs/goldbach/goldbach-test.txt b/docs/goldbach/goldbach-test.txt
index 26cba74..f52f0b2 100644
--- a/docs/goldbach/goldbach-test.txt
+++ b/docs/goldbach/goldbach-test.txt
@@ -42,7 +42,7 @@ document weave order 0
commentary To manage the weaving of commentary or source code text. §1. Commentary text. The following takes text, divides it up at stroke-mark boundaries —
that is, this is inside, this is outside — and sends contiguous pieces
@@ -74,8 +74,6 @@ as appropriate.
(in_code)?(I"Code In Code Comments Notation"):(I"Code In Commentary Notation"));
if (Str::ne(code_in_comments_notation, I"Off")) Split text and code extracts1.1;
- if (within == FALSE) Recognose hyperlinks1.2;
-
int display_flag = TRUE;
text_stream *tex_notation = Bibliographic::get_datum(wv->weave_web->md,
I"TeX Mathematics Displayed Notation");
@@ -90,10 +88,11 @@ as appropriate.
if (Str::ne(xref_notation, I"Off")) Recognise cross-references1.5;
if (within) {
- TextWeaver::inline_code_fragment(tree, ap, matter);
+ TextWeaver::inline_code_fragment(tree, ap, matter);
} else {
+ Recognise hyperlinks1.2;
Detect use of footnotes1.4;
- TextWeaver::commentary_fragment(tree, ap, matter, in_code);
+ TextWeaver::commentary_fragment(tree, ap, matter, in_code);
}
}
@@ -118,7 +117,7 @@ as appropriate.
}
§1.2. Recognose hyperlinks1.2 =
+ §1.2. Recognise hyperlinks1.2 =
§2. This tests whether a cross-reference is allowed to begin or end: it must
+begin after and finish before a "boundary character".
+ Note the one-sided treatment of :, which is a boundary after but not before,
+so that http:// won't trigger a cross-reference with the standard //
+xref notation.
+ §3.1. Pick up hyperlinking at the eleventh hour3.1 =
+ §4.1. Pick up hyperlinking at the eleventh hour4.1 =
§3.2. Pick up cross-references at the eleventh hour3.2 =
+ §4.2. Pick up cross-references at the eleventh hour4.2 =
§3.2.1. Attempt to resolve the cross-reference at the eleventh hour3.2.1 =
+ §4.2.1. Attempt to resolve the cross-reference at the eleventh hour4.2.1 =
§3.3. Spot the function3.3 =
+
-void Weaver::show_function_usage(heterogeneous_tree *tree, weave_order *wv,
+void Weaver::show_function_usage(heterogeneous_tree *tree, weave_order *wv,
tree_node *ap, paragraph *P, language_function *fn, int as_list) {
tree_node *body = ap;
fn->usage_described = TRUE;
diff --git a/docs/inweb/3-twot.html b/docs/inweb/3-twot.html
index 158ddda..8278cae 100644
--- a/docs/inweb/3-twot.html
+++ b/docs/inweb/3-twot.html
@@ -49,7 +49,7 @@ function togglePopup(material_id) {
+
-
@@ -131,6 +130,15 @@ as appropriate.
Str::substr(after, Str::at(matter, i), Str::end(matter));
match_results mr = Regexp::create_mr();
if (Regexp::match(&mr, after, L"(https*://%C+)(%c*)")) {
+ while (TextWeaver::boundary_character(FALSE, Str::get_last_char(mr.exp[0]))) {
+ wchar_t c = Str::get_last_char(mr.exp[0]);
+ Str::delete_last_character(mr.exp[0]);
+ TEMPORARY_TEXT(longer);
+ WRITE_TO(longer, "%c%S", c, mr.exp[1]);
+ Str::clear(mr.exp[1]);
+ Str::copy(mr.exp[1], longer);
+ DISCARD_TEXT(longer);
+ }
TextWeaver::commentary_r(tree, ap, before, within, in_code);
Trees::make_child(WeaveTree::url(tree, mr.exp[0], mr.exp[0], TRUE), ap);
TextWeaver::commentary_r(tree, ap, mr.exp[1], within, in_code);
@@ -209,10 +217,14 @@ as appropriate.
int N = Str::len(xref_notation);
for (int i=0; i < Str::len(matter); i++) {
- if ((within == FALSE) && (Str::includes_at(matter, i, xref_notation))) {
+ if ((within == FALSE) && (Str::includes_at(matter, i, xref_notation)) &&
+ ((i == 0) || (TextWeaver::boundary_character(TRUE,
+ Str::get_at(matter, i-1))))) {
int j = i + N+1;
while (j < Str::len(matter)) {
- if (Str::includes_at(matter, j, xref_notation)) {
+ if ((Str::includes_at(matter, j, xref_notation)) &&
+ (TextWeaver::boundary_character(FALSE,
+ Str::get_at(matter, j+Str::len(xref_notation))))) {
int allow = FALSE;
TEMPORARY_TEXT(before);
TEMPORARY_TEXT(reference);
@@ -238,10 +250,11 @@ as appropriate.
TEMPORARY_TEXT(url);
TEMPORARY_TEXT(title);
+ int ext = FALSE;
if (Colonies::resolve_reference_in_weave(url, title, wv->weave_to, reference,
- wv->weave_web->md, wv->current_weave_line)) {
+ wv->weave_web->md, wv->current_weave_line, &ext)) {
TextWeaver::commentary_r(tree, ap, before, within, in_code);
- Trees::make_child(WeaveTree::url(tree, url, title, FALSE), ap);
+ Trees::make_child(WeaveTree::url(tree, url, title, ext), ap);
TextWeaver::commentary_r(tree, ap, after, within, in_code);
allow = TRUE;
}
@@ -249,16 +262,35 @@ as appropriate.
DISCARD_TEXT(title);
-
+
-void TextWeaver::commentary_fragment(heterogeneous_tree *tree, tree_node *ap,
+int TextWeaver::boundary_character(int before, wchar_t c) {
+ if (c == 0) return TRUE;
+ if (Characters::is_whitespace(c)) return TRUE;
+ if ((c == '.') || (c == ',') || (c == '!') || (c == '?') || (c == ';') ||
+ (c == '(')|| (c == ')')) return TRUE;
+ if ((before == FALSE) && (c == ':')) return TRUE;
+ return FALSE;
+}
+
+
+
+
+void TextWeaver::commentary_fragment(heterogeneous_tree *tree, tree_node *ap,
text_stream *fragment, int in_code) {
if (Str::len(fragment) > 0)
Trees::make_child(WeaveTree::commentary(tree, fragment, in_code), ap);
}
-void TextWeaver::inline_code_fragment(heterogeneous_tree *tree, tree_node *ap, text_stream *fragment) {
+void TextWeaver::inline_code_fragment(heterogeneous_tree *tree, tree_node *ap, text_stream *fragment) {
tree_node *I = WeaveTree::inline(tree);
Trees::make_child(I, ap);
TEMPORARY_TEXT(colouring);
@@ -268,10 +300,10 @@ as appropriate.
Trees::make_child(SC, I);
}
-
+
-void TextWeaver::source_code(heterogeneous_tree *tree, tree_node *ap,
+void TextWeaver::source_code(heterogeneous_tree *tree, tree_node *ap,
text_stream *matter, text_stream *colouring, int linked) {
weave_document_node *C = RETRIEVE_POINTER_weave_document_node(tree->root->content);
weave_order *wv = C->wv;
@@ -279,11 +311,11 @@ as appropriate.
int from = 0;
for (int i=0; i < Str::len(matter); i++) {
if (linked) {
- Pick up hyperlinking at the eleventh hour3.1;
+ Pick up hyperlinking at the eleventh hour4.1;
text_stream *xref_notation = Bibliographic::get_datum(wv->weave_web->md,
I"Cross-References Notation");
if (Str::ne(xref_notation, I"Off"))
- Pick up cross-references at the eleventh hour3.2;
+ Pick up cross-references at the eleventh hour4.2;
}
if ((Str::get_at(colouring, i) == FUNCTION_COLOUR) &&
(wv->current_weave_line->category != TEXT_EXTRACT_LCAT)) {
@@ -293,16 +325,16 @@ as appropriate.
PUT_TO(fname, Str::get_at(matter, j++));
if (Analyser::is_reserved_word_for_section(
wv->current_weave_line->owning_section, fname, FUNCTION_COLOUR))
- Spot the function3.3;
+ Spot the function4.3;
DISCARD_TEXT(fname);
}
}
if (from < Str::len(matter))
- TextWeaver::source_code_piece(tree, ap, matter, colouring, from, Str::len(matter));
+ TextWeaver::source_code_piece(tree, ap, matter, colouring, from, Str::len(matter));
}
-
@@ -313,7 +345,7 @@ as appropriate.
match_results mr = Regexp::create_mr();
if (Regexp::match(&mr, after, L"(https*://%C+)(%c*)")) {
tree_node *U = WeaveTree::url(tree, mr.exp[0], mr.exp[0], TRUE);
- TextWeaver::source_code_piece(tree, ap, matter, colouring, from, i);
+ TextWeaver::source_code_piece(tree, ap, matter, colouring, from, i);
Trees::make_child(U, ap);
i += Str::len(mr.exp[0]);
from = i;
@@ -321,8 +353,8 @@ as appropriate.
DISCARD_TEXT(after);
}
-
-
+
@@ -333,7 +365,7 @@ as appropriate.
if (Str::includes_at(matter, j, xref_notation)) {
TEMPORARY_TEXT(reference);
Str::substr(reference, Str::at(matter, i + N), Str::at(matter, j));
- Attempt to resolve the cross-reference at the eleventh hour3.2.1;
+ Attempt to resolve the cross-reference at the eleventh hour4.2.1;
DISCARD_TEXT(reference);
break;
}
@@ -341,17 +373,18 @@ as appropriate.
}
}
-
-
+
TEMPORARY_TEXT(url);
TEMPORARY_TEXT(title);
+ int ext = FALSE;
if (Colonies::resolve_reference_in_weave(url, title, wv->weave_to, reference,
- wv->weave_web->md, wv->current_weave_line)) {
- tree_node *U = WeaveTree::url(tree, url, title, FALSE);
- TextWeaver::source_code_piece(tree, ap, matter, colouring, from, i);
+ wv->weave_web->md, wv->current_weave_line, &ext)) {
+ tree_node *U = WeaveTree::url(tree, url, title, ext);
+ TextWeaver::source_code_piece(tree, ap, matter, colouring, from, i);
Trees::make_child(U, ap);
i = j + N;
from = i;
@@ -359,8 +392,8 @@ as appropriate.
DISCARD_TEXT(url);
DISCARD_TEXT(title);
-
-
+
@@ -370,7 +403,7 @@ as appropriate.
source_line *defn_line = fn->function_header_at;
if (wv->current_weave_line == defn_line) {
if (fn->usage_described == FALSE) {
- TextWeaver::source_code_piece(tree, ap, matter, colouring, from, i);
+ TextWeaver::source_code_piece(tree, ap, matter, colouring, from, i);
tree_node *FD = WeaveTree::function_defn(tree, fn);
Trees::make_child(FD, ap);
Weaver::show_function_usage(tree, wv, FD,
@@ -379,7 +412,7 @@ as appropriate.
from = i+1;
}
} else {
- TextWeaver::source_code_piece(tree, ap, matter, colouring, from, i);
+ TextWeaver::source_code_piece(tree, ap, matter, colouring, from, i);
TEMPORARY_TEXT(url)
Colonies::paragraph_URL(url, defn_line->owning_paragraph, wv->weave_to);
tree_node *U = WeaveTree::function_usage(tree, url, fn);
@@ -389,11 +422,11 @@ as appropriate.
}
}
-
-
+
+
-void TextWeaver::source_code_piece(heterogeneous_tree *tree, tree_node *ap,
+void TextWeaver::source_code_piece(heterogeneous_tree *tree, tree_node *ap,
text_stream *matter, text_stream *colouring, int from, int to) {
if (to > from) {
TEMPORARY_TEXT(m);
diff --git a/docs/inweb/5-wt.html b/docs/inweb/5-wt.html
index e0293e8..f34674d 100644
--- a/docs/inweb/5-wt.html
+++ b/docs/inweb/5-wt.html
@@ -632,7 +632,7 @@ information.
return Trees::new_node(tree, weave_code_line_node_type, STORE_POINTER_weave_code_line_node(C));
}
-tree_node *WeaveTree::function_usage(heterogeneous_tree *tree,
+tree_node *WeaveTree::function_usage(heterogeneous_tree *tree,
text_stream *url, language_function *fn) {
weave_function_usage_node *C = CREATE(weave_function_usage_node);
C->url = Str::duplicate(url);
@@ -640,7 +640,7 @@ information.
return Trees::new_node(tree, weave_function_usage_node_type, STORE_POINTER_weave_function_usage_node(C));
}
-tree_node *WeaveTree::commentary(heterogeneous_tree *tree, text_stream *text, int in_code) {
+tree_node *WeaveTree::commentary(heterogeneous_tree *tree, text_stream *text, int in_code) {
weave_commentary_node *C = CREATE(weave_commentary_node);
C->text = Str::duplicate(text);
C->in_code = in_code;
@@ -685,7 +685,7 @@ been syntax-coloured.
-tree_node *WeaveTree::source_code(heterogeneous_tree *tree, +tree_node *WeaveTree::source_code(heterogeneous_tree *tree, text_stream *matter, text_stream *colouring) { if (Str::len(colouring) != Str::len(matter)) internal_error("bad source segment"); for (int i=0; i<Str::len(colouring); i++) @@ -696,7 +696,7 @@ been syntax-coloured. return Trees::new_node(tree, weave_source_code_node_type, STORE_POINTER_weave_source_code_node(C)); } -tree_node *WeaveTree::url(heterogeneous_tree *tree, text_stream *url, +tree_node *WeaveTree::url(heterogeneous_tree *tree, text_stream *url, text_stream *content, int external) { weave_url_node *C = CREATE(weave_url_node); C->url = Str::duplicate(url); @@ -722,7 +722,7 @@ definition has just occurred.-tree_node *WeaveTree::function_defn(heterogeneous_tree *tree, language_function *fn) { +tree_node *WeaveTree::function_defn(heterogeneous_tree *tree, language_function *fn) { weave_function_defn_node *C = CREATE(weave_function_defn_node); C->fn = fn; return Trees::new_node(tree, weave_function_defn_node_type, STORE_POINTER_weave_function_defn_node(C)); @@ -766,7 +766,7 @@ indentation but not weave any bracketed marker. return Trees::new_node(tree, weave_grammar_index_node_type, STORE_POINTER_weave_grammar_index_node(C)); } -tree_node *WeaveTree::inline(heterogeneous_tree *tree) { +tree_node *WeaveTree::inline(heterogeneous_tree *tree) { weave_inline_node *C = CREATE(weave_inline_node); return Trees::new_node(tree, weave_inline_node_type, STORE_POINTER_weave_inline_node(C)); } diff --git a/docs/inweb/6-cln.html b/docs/inweb/6-cln.html index a674c31..e5bf42f 100644 --- a/docs/inweb/6-cln.html +++ b/docs/inweb/6-cln.html @@ -296,7 +296,7 @@ first we find.-colony_member *Colonies::find(text_stream *T) { +colony_member *Colonies::find(text_stream *T) { colony *C; LOOP_OVER(C, colony) { colony_member *CM; @@ -315,7 +315,7 @@ the data we already have; but if not, we read it in.-module *Colonies::as_module(colony_member *CM, source_line *L, web_md *Wm) { +module *Colonies::as_module(colony_member *CM, source_line *L, web_md *Wm) { if (CM->loaded == NULL) Perhaps the web being woven8.1; if (CM->loaded == NULL) Perhaps a module imported by the web being woven8.2; if (CM->loaded == NULL) Perhaps a module not yet seen8.3; @@ -412,30 +412,33 @@ is where the reference is made from.-int Colonies::resolve_reference_in_weave(text_stream *url, text_stream *title, - filename *for_HTML_file, text_stream *text, web_md *Wm, source_line *L) { +int Colonies::resolve_reference_in_weave(text_stream *url, text_stream *title, + filename *for_HTML_file, text_stream *text, web_md *Wm, source_line *L, int *ext) { int r = 0; + if (ext) *ext = FALSE; match_results mr = Regexp::create_mr(); if (Regexp::match(&mr, text, L"(%c+?) -> (%c+)")) { r = Colonies::resolve_reference_in_weave_inner(url, NULL, - for_HTML_file, mr.exp[1], Wm, L); + for_HTML_file, mr.exp[1], Wm, L, ext); WRITE_TO(title, "%S", mr.exp[0]); } else { r = Colonies::resolve_reference_in_weave_inner(url, title, - for_HTML_file, text, Wm, L); + for_HTML_file, text, Wm, L, ext); } Regexp::dispose_of(&mr); return r; } + int Colonies::resolve_reference_in_weave_inner(text_stream *url, text_stream *title, - filename *for_HTML_file, text_stream *text, web_md *Wm, source_line *L) { + filename *for_HTML_file, text_stream *text, web_md *Wm, source_line *L, int *ext) { module *from_M = (Wm)?(Wm->as_module):NULL; module *search_M = from_M; colony_member *search_CM = NULL; int external = FALSE; - Is it the name of a member of our colony?10.1; - If it contains a colon, does this indicate a section in a colony member?10.2; + Is it an explicit URL?10.1; + Is it the name of a member of our colony?10.2; + If it contains a colon, does this indicate a section in a colony member?10.3; module *found_M = NULL; section_md *found_Sm = NULL; @@ -444,8 +447,8 @@ is where the reference is made from. title, search_M, text, FALSE); if (N == 0) { if ((L) && (external == FALSE)) { - Is it the name of a function in the current web?10.3; - Is it the name of a type in the current web?10.4; + Is it the name of a function in the current web?10.4; + Is it the name of a type in the current web?10.5; } TEMPORARY_TEXT(err); WRITE_TO(err, "Can't find the cross-reference '%S'", text); @@ -458,12 +461,27 @@ is where the reference is made from. title, search_M, text, TRUE); return FALSE; } else { - It refers unambiguously to a single section10.5; + It refers unambiguously to a single section10.6; return TRUE; } }-§10.1. Is it the name of a member of our colony?10.1 = +
§10.1. Is it an explicit URL?10.1 = +
+ ++ match_results mr = Regexp::create_mr(); + if (Regexp::match(&mr, text, L"https*://%c*")) { + WRITE_TO(url, "%S", text); + WRITE_TO(title, "%S", text); + Regexp::dispose_of(&mr); + if (ext) *ext = TRUE; + return TRUE; + } + Regexp::dispose_of(&mr); ++
§10.2. Is it the name of a member of our colony?10.2 =
@@ -473,11 +491,11 @@ is where the reference is made from. section_md *found_Sm = FIRST_IN_LINKED_LIST(section_md, found_M->sections_md); int bare_module_name = TRUE; WRITE_TO(title, "%S", search_CM->name); - It refers unambiguously to a single section10.5; + It refers unambiguously to a single section10.6; }
§10.2. If it contains a colon, does this indicate a section in a colony member?10.2 = +
§10.3. If it contains a colon, does this indicate a section in a colony member?10.3 =
@@ -496,7 +514,7 @@ is where the reference is made from. Regexp::dispose_of(&mr);
§10.3. Is it the name of a function in the current web?10.3 = +
§10.4. Is it the name of a function in the current web?10.4 =
@@ -511,7 +529,7 @@ is where the reference is made from.
}
§10.4. Is it the name of a type in the current web?10.4 = +
§10.5. Is it the name of a type in the current web?10.5 =
@@ -526,17 +544,17 @@ is where the reference is made from.
}
§10.5. It refers unambiguously to a single section10.5 = +
§10.6. It refers unambiguously to a single section10.6 =
if (found_M == NULL) internal_error("could not locate M"); - if (search_CM) The section is a known colony member10.5.1 - else The section is not in a known colony member10.5.2; + if (search_CM) The section is a known colony member10.6.1 + else The section is not in a known colony member10.6.2; return TRUE;- -
§10.5.1. The section is a known colony member10.5.1 = +
+§10.6.1. The section is a known colony member10.6.1 =
@@ -548,13 +566,13 @@ is where the reference is made from. if (bare_module_name == FALSE) WRITE_TO(title, " (in %S)", search_CM->name);-
§10.5.2. In the absence of a colony file, Inweb can really only guess, and the +
§10.6.2. In the absence of a colony file, Inweb can really only guess, and the guess it makes is that modules of the current web will be woven alongside the main one, and suffixed by -module.
-The section is not in a known colony member10.5.2 = +
The section is not in a known colony member10.6.2 =
@@ -567,7 +585,7 @@ the main one, and suffixed by WRITE_TO(title, " (in %S)", found_M->module_name);
}
-
@@ -583,7 +601,7 @@ the main one, and suffixed by void Colonies::reference_URL(OUTPUT_STREAM, text_stream *link_text, filename *F) {
TEMPORARY_TEXT(title);
TEMPORARY_TEXT(url);
- if (Colonies::resolve_reference_in_weave(url, title, F, link_text, NULL, NULL))
+ if (Colonies::resolve_reference_in_weave(url, title, F, link_text, NULL, NULL, NULL))
WRITE("%S", url);
else
PRINT("Warning: unable to resolve reference '%S' in navigation\n", link_text);
@@ -591,7 +609,7 @@ the main one, and suffixed by DISCARD_TEXT(url);
}
-void Colonies::section_URL(OUTPUT_STREAM, section_md *Sm) {
+void Colonies::section_URL(OUTPUT_STREAM, section_md *Sm) {
if (Sm == NULL) internal_error("unwoven section");
LOOP_THROUGH_TEXT(pos, Sm->sect_range)
if ((Str::get(pos) == '/') || (Str::get(pos) == ' '))
@@ -601,7 +619,7 @@ the main one, and suffixed by WRITE(".html");
}
-void Colonies::paragraph_URL(OUTPUT_STREAM, paragraph *P, filename *from) {
+void Colonies::paragraph_URL(OUTPUT_STREAM, paragraph *P, filename *from) {
if (from == NULL) internal_error("no from file");
if (P == NULL) internal_error("no para");
section *to_S = P->under_section;
diff --git a/docs/inweb/M-htwaw.html b/docs/inweb/M-htwaw.html
index 9c5dd06..33462dc 100644
--- a/docs/inweb/M-htwaw.html
+++ b/docs/inweb/M-htwaw.html
@@ -62,7 +62,7 @@ MathJax = {
How to mark up code for literate programming.
-- §1. The title of a section
- §2. Paragraphing
- §6. Conditional compilation
- §7. Commentary
- §12. Code samples and other extraneous matter
- §13. Links
- §14. Cross-references
- §18. Figures
- §19. Carousels
- §20. Video and audio
- §21. Embedded video and audio
- §23. Mathematics notation
- §24. Footnotes
+- §1. The title of a section
- §2. Paragraphing
- §6. Conditional compilation
- §7. Commentary
- §12. Code samples and other extraneous matter
- §13. Links
- §14. Cross-references
- §19. Figures
- §20. Carousels
- §21. Video and audio
- §22. Embedded video and audio
- §24. Mathematics notation
- §25. Footnotes
§1. The title of a section. 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
@@ -516,13 +516,15 @@ make them into links. For example:
- For further reading, see: https://en.wikipedia.org/wiki/How_to_Avoid_Huge_Ships
+ For further reading, see: https://en.wikipedia.org/wiki/How_to_Avoid_Huge_Ships.
-For further reading, see: https://en.wikipedia.org/wiki/How_to_Avoid_Huge_Ships
+
For further reading, see: https://en.wikipedia.org/wiki/How_to_Avoid_Huge_Ships.
-Note that URLs are considered to continue to the next white space, so don't
-end them with full stops or commas.
+
Note that URLs are considered to continue to the next white space, except
+that any final full stops, question or exclamation marks, commas, brackets,
+semicolons, or colons are disregarded. (This is why the above sentence ended
+with a full stop and yet the full stop wasn't part of the reference URL.)
URLs will also be recognised in any text extract marked as hyperlinked.
@@ -530,15 +532,15 @@ For example,
- Compare: https://en.wikipedia.org/wiki/Crocheting_Adventures_with_Hyperbolic_Planes
+ Compare: https://en.wikipedia.org/wiki/Crocheting_Adventures_with_Hyperbolic_Planes!
produces:
- Compare: https://en.wikipedia.org/wiki/Crocheting_Adventures_with_Hyperbolic_Planes
+ Compare: https://en.wikipedia.org/wiki/Crocheting_Adventures_with_Hyperbolic_Planes!
-§14. Cross-references. These are like links, but internal. These are normally written within //
+
§14. Cross-references. These are like links, but are internal. These are normally written within //
signs and are only available in the commentary of a web. They allow us to
place cross-references like so:
@@ -576,6 +578,14 @@ This is simple: for example,
produces: "First the program has to configure itself, then..."; the text "the program has to configure itself" links to Configuration. +This is especially useful if the destination is given as an explicit URL, which +is also allowed: +
+ +
+ See //this biographical note -> http://mathshistory.st-andrews.ac.uk/Biographies/Gauss.html//.
+
+
§16. It's also possible to reference function names and type names, provided that @@ -611,7 +621,11 @@ See Making Weaves into Websites.
See the Manual for more on this.-
This notation may be inconvenient if you need // for something else, but it +
§18. Cross-references must begin after white space, or a punctuation mark (other +than a colon), and must end to be followed by more white space or another +punctuation mark (this time allowing a colon). In practice, that reduces +the risk of misunderstanding a // occurring in the commentary for some +other reason. All the same, you might want a different notation, so this can be configured in the Contents page of a web, say like so:
@@ -624,7 +638,7 @@ can be configured in the Contents page of a web, say like so:Cross-References Notation: Off-
§18. Figures. Images to be included in weaves of a web are called "Figures", as they +
§19. Figures. Images to be included in weaves of a web are called "Figures", as they would be in a printed book. These images should ideally be in PNG, JPG or PDF format and placed in a subdirectory of the web called Figures: for instance, the weaver would seek Fig_2_3.pdf at pathname Figures/Fig_2_3.pdf. @@ -657,7 +671,7 @@ correspond. If you really want to monkey with the aspect ratio,
= (figure Whatever.jpg at 20 by 100)
-§19. Carousels. A carousel is a slide-show of (usually but not always) figures; there's a +
§20. Carousels. A carousel is a slide-show of (usually but not always) figures; there's a set of slides with captions, only one of which is visible at a time.
@@ -770,7 +784,7 @@ it can also be above = (figure furtive.jpg) = (carousel end) -§20. Video and audio. To include audio samples, place them as MP3 files in the subdirectory Audio +
§21. Video and audio. To include audio samples, place them as MP3 files in the subdirectory Audio of the web. For example, in the present web,
@@ -796,7 +810,7 @@ Your browser does not support the audio element. takes up space, so for economy's sake a demonstration is omitted from this manual. -§21. Embedded video and audio. One way to get around such space limitations is to embed players for video or +
§22. Embedded video and audio. One way to get around such space limitations is to embed players for video or audio hosted on some external service. For example:
@@ -839,7 +853,7 @@ this case was https://youtu.b-
§22. Adding width and height is straightforward; by default the dimensions are +
§23. Adding width and height is straightforward; by default the dimensions are 720 by 405.
@@ -851,7 +865,7 @@ this case was https://youtu.b arguably music has width and not height, but SoundCloud thinks otherwise). -§23. Mathematics notation. Literate programming is a good technique to justify code which hangs on +
§24. Mathematics notation. Literate programming is a good technique to justify code which hangs on unobvious pieces of mathematics or computer science, and which must therefore be explained carefully. Formulae or equations are a real convenience for that.
@@ -890,7 +904,7 @@ changed. The defaults are: treat it as any other text would be treated. -§24. Footnotes. Not everyone likes footnotes,1 but sometimes they're a tidy way to make +
§25. Footnotes. Not everyone likes footnotes,1 but sometimes they're a tidy way to make references.2
@@ -899,7 +913,7 @@ University Press, 1999). ↩2 For example, to cite Donald Knuth, "Evaluation of Porter's constant", Computers & Mathematics with Applications, 2, 137-39 (1976). ↩
§25. The content of that sentence was typed as follows: +
§26. The content of that sentence was typed as follows: