Documented colonies
This commit is contained in:
parent
ae9df5f137
commit
2187d66060
16 changed files with 167 additions and 131 deletions
|
@ -96,7 +96,6 @@ inweb_instructions Configuration::read(int argc, char **argv) {
|
|||
args.tangle_setting = NULL;
|
||||
args.weave_to_setting = NULL;
|
||||
args.weave_into_setting = NULL;
|
||||
args.sequential = FALSE;
|
||||
args.makefile_setting = NULL;
|
||||
args.gitignore_setting = NULL;
|
||||
args.advance_setting = NULL;
|
||||
|
@ -146,7 +145,6 @@ provides automatically.
|
|||
@e WEAVE_CLSW
|
||||
@e WEAVE_INTO_CLSW
|
||||
@e WEAVE_TO_CLSW
|
||||
@e SEQUENTIAL_CLSW
|
||||
@e OPEN_CLSW
|
||||
@e WEAVE_AS_CLSW
|
||||
@e WEAVE_TAG_CLSW
|
||||
|
@ -225,8 +223,6 @@ provides automatically.
|
|||
L"weave, but into directory X");
|
||||
CommandLine::declare_switch(WEAVE_TO_CLSW, L"weave-to", 2,
|
||||
L"weave, but to filename X (for single files only)");
|
||||
CommandLine::declare_boolean_switch(SEQUENTIAL_CLSW, L"sequential", 1,
|
||||
L"name woven leaves with sequential numbering", FALSE);
|
||||
CommandLine::declare_switch(OPEN_CLSW, L"open", 1,
|
||||
L"weave then open woven file");
|
||||
CommandLine::declare_switch(WEAVE_AS_CLSW, L"weave-as", 2,
|
||||
|
@ -328,8 +324,6 @@ void Configuration::switch(int id, int val, text_stream *arg, void *state) {
|
|||
case WEAVE_TO_CLSW:
|
||||
args->weave_to_setting = Filenames::from_text(arg);
|
||||
Configuration::set_fundamental_mode(args, WEAVE_MODE); break;
|
||||
case SEQUENTIAL_CLSW:
|
||||
args->sequential = val; break;
|
||||
case OPEN_CLSW:
|
||||
args->open_pdf_switch = TRUE;
|
||||
Configuration::set_fundamental_mode(args, WEAVE_MODE); break;
|
||||
|
|
|
@ -95,7 +95,7 @@ void Main::follow_instructions(inweb_instructions *ins) {
|
|||
TRUE);
|
||||
W->redirect_weaves_to = ins->weave_into_setting;
|
||||
Reader::read_web(W, ins->verbose_switch);
|
||||
Parser::parse_web(W, ins->inweb_mode, ins->sequential);
|
||||
Parser::parse_web(W, ins->inweb_mode);
|
||||
}
|
||||
if (no_inweb_errors == 0) {
|
||||
if (ins->inweb_mode == TRANSLATE_MODE) @<Translate a makefile@>
|
||||
|
|
|
@ -14,7 +14,7 @@ function definitions are recognised in C programs.) There is no requirement
|
|||
for it to do anything.
|
||||
|
||||
=
|
||||
void Parser::parse_web(web *W, int inweb_mode, int sequential) {
|
||||
void Parser::parse_web(web *W, int inweb_mode) {
|
||||
chapter *C;
|
||||
section *S;
|
||||
LOOP_OVER_LINKED_LIST(C, chapter, W->chapters)
|
||||
|
|
|
@ -117,25 +117,21 @@ int Colonies::resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
module *found_M = Colonies::as_module(search_CM, L, Wm);
|
||||
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);
|
||||
@<Resolved@>;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (Regexp::match(&mr, text, L"(%c*?): (%c*)")) {
|
||||
search_M = NULL;
|
||||
external = TRUE;
|
||||
if (search_M == NULL) {
|
||||
search_CM = Colonies::member(mr.exp[0]);
|
||||
if (search_CM) search_M = Colonies::as_module(search_CM, L, Wm);
|
||||
}
|
||||
if (search_M == NULL) {
|
||||
TEMPORARY_TEXT(err);
|
||||
WRITE_TO(err, "unrecognised web/module '%S' - use -colony?", mr.exp[0]);
|
||||
Main::error_in_web(err, L);
|
||||
Regexp::dispose_of(&mr);
|
||||
return FALSE;
|
||||
}
|
||||
if (search_CM) {
|
||||
module *found_M = Colonies::as_module(search_CM, L, Wm);
|
||||
if (found_M) {
|
||||
search_M = found_M;
|
||||
text = Str::duplicate(mr.exp[1]);
|
||||
external = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
Regexp::dispose_of(&mr);
|
||||
|
||||
|
@ -209,11 +205,8 @@ int Colonies::resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
}
|
||||
if (found == FALSE) internal_error("no relation made");
|
||||
if (Str::len(url) > 0) WRITE_TO(url, "/");
|
||||
if (bare_module_name)
|
||||
WRITE_TO(url, "index.html");
|
||||
else if (found_Sm)
|
||||
HTMLFormat::section_URL(url, wv, found_Sm);
|
||||
WRITE_TO(title, "%S", search_CM->name);
|
||||
if (bare_module_name) WRITE_TO(url, "index.html");
|
||||
else if (found_Sm) HTMLFormat::section_URL(url, wv, found_Sm);
|
||||
if (bare_module_name == FALSE)
|
||||
WRITE_TO(title, " (in %S)", search_CM->name);
|
||||
} else {
|
||||
|
|
5
Figures/colony.txt
Normal file
5
Figures/colony.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
web: "inweb" at "inweb" in "inweb/docs/inweb"
|
||||
module: "foundation" at "inweb/foundation-module" in "inweb/docs/foundation-module"
|
||||
web: "foundation-test" at "inweb/foundation-test" in "inweb/docs/foundation-test"
|
||||
web: "goldbach" at "inweb/Examples/goldbach" in "inweb/docs/goldbach"
|
||||
web: "twinprimes" at "inweb/Examples/twinprimes.inweb" in "inweb/docs/twinprimes"
|
|
@ -43,7 +43,6 @@ for weaving a web:
|
|||
-colony X use the file X as a list of webs in this colony
|
||||
-navigation X use the file X as a column of navigation links
|
||||
-open weave then open woven file
|
||||
-sequential name woven leaves with sequential numbering (default is -no-sequential)
|
||||
-weave weave the web into human-readable form
|
||||
-weave-as X set weave pattern to X (default is 'HTML')
|
||||
-weave-docs weave the web for use at GitHub Pages
|
||||
|
|
|
@ -438,6 +438,35 @@ It's also possible to disable cross-referencing entirely with:
|
|||
Cross-References Notation: Off
|
||||
=
|
||||
|
||||
@h Colonies.
|
||||
A collection of webs gathered in one place is, for want of a better word,
|
||||
called a "colony". (Some social species of spiders form colonies, and share
|
||||
webs which are collectively woven.)
|
||||
|
||||
Running Inweb with |-colony F| tells it that the file |F| lists the webs and
|
||||
modules making up the current colony. This affects only weaving, and allows
|
||||
cross-referencing across webs which do not share any actual code. For
|
||||
example, here is the current version of the colony file for the Inweb
|
||||
repository:
|
||||
= (text from Figures/colony.txt)
|
||||
As this demonstrates, either webs, or modules, or both, can be included.
|
||||
Each one gives (a) a short name, (b) a location relative to the current
|
||||
working directory, and (c) a similar location for its woven collection of
|
||||
files.
|
||||
|
||||
The practical effect of this is that a cross-reference like this can work,
|
||||
even from one web to another: see //goldbach: The Sieve of Eratosthenes//.
|
||||
That last sentence was typed as:
|
||||
= (text as Inweb)
|
||||
The practical effect of this is that a cross-reference like this can work,
|
||||
even from one web to another: see //goldbach: The Sieve of Eratosthenes//.
|
||||
=
|
||||
|
||||
Cross-references to other webs or modules in the same colony can be to chapters
|
||||
or sections, or simply to the entire web in question -- see //goldbach// --
|
||||
but not to functions or types in those webs: that would require Inweb to read
|
||||
every web in the colony into memory, which would slow it down too much.
|
||||
|
||||
@h 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
|
||||
|
|
116
Tangled/inweb.c
116
Tangled/inweb.c
|
@ -784,17 +784,16 @@ void __stdcall LeaveCriticalSection(struct Win32_Critical_Section* cs);
|
|||
#define WEAVE_CLSW 23
|
||||
#define WEAVE_INTO_CLSW 24
|
||||
#define WEAVE_TO_CLSW 25
|
||||
#define SEQUENTIAL_CLSW 26
|
||||
#define OPEN_CLSW 27
|
||||
#define WEAVE_AS_CLSW 28
|
||||
#define WEAVE_TAG_CLSW 29
|
||||
#define WEAVE_DOCS_CLSW 30
|
||||
#define BREADCRUMB_CLSW 31
|
||||
#define NAVIGATION_CLSW 32
|
||||
#define COLONY_CLSW 33
|
||||
#define OPEN_CLSW 26
|
||||
#define WEAVE_AS_CLSW 27
|
||||
#define WEAVE_TAG_CLSW 28
|
||||
#define WEAVE_DOCS_CLSW 29
|
||||
#define BREADCRUMB_CLSW 30
|
||||
#define NAVIGATION_CLSW 31
|
||||
#define COLONY_CLSW 32
|
||||
#define TANGLING_CLSG 5
|
||||
#define TANGLE_CLSW 34
|
||||
#define TANGLE_TO_CLSW 35
|
||||
#define TANGLE_CLSW 33
|
||||
#define TANGLE_TO_CLSW 34
|
||||
#define LOOP_WITHIN_TANGLE(C, S, T)\
|
||||
LOOP_OVER_LINKED_LIST(C, chapter, W->chapters)\
|
||||
LOOP_OVER_LINKED_LIST(S, section, C->sections)\
|
||||
|
@ -974,7 +973,7 @@ void __stdcall LeaveCriticalSection(struct Win32_Critical_Section* cs);
|
|||
#define HTML_IN_P 1 /* write position in HTML file is currently outside p */
|
||||
#define HTML_IN_PRE 2 /* write position in HTML file is currently outside pre */
|
||||
#define HTML_IN_LI 3 /* write position in HTML file is currently outside li */
|
||||
#define NO_DEFINED_CLSW_VALUES 36
|
||||
#define NO_DEFINED_CLSW_VALUES 35
|
||||
#define NO_DEFINED_DA_VALUES 4
|
||||
#define NO_DEFINED_MT_VALUES 66
|
||||
#define NO_DEFINED_MREASON_VALUES 5
|
||||
|
@ -3098,15 +3097,15 @@ void Main__follow_instructions(inweb_instructions *ins) ;
|
|||
void Main__error_in_web(text_stream *message, source_line *sl) ;
|
||||
#line 64 "inweb/Chapter 1/Configuration.w"
|
||||
inweb_instructions Configuration__read(int argc, char **argv) ;
|
||||
#line 260 "inweb/Chapter 1/Configuration.w"
|
||||
#line 256 "inweb/Chapter 1/Configuration.w"
|
||||
void Configuration__switch(int id, int val, text_stream *arg, void *state) ;
|
||||
#line 364 "inweb/Chapter 1/Configuration.w"
|
||||
#line 358 "inweb/Chapter 1/Configuration.w"
|
||||
breadcrumb_request * Configuration__breadcrumb(text_stream *arg) ;
|
||||
#line 384 "inweb/Chapter 1/Configuration.w"
|
||||
#line 378 "inweb/Chapter 1/Configuration.w"
|
||||
void Configuration__bareword(int id, text_stream *opt, void *state) ;
|
||||
#line 399 "inweb/Chapter 1/Configuration.w"
|
||||
#line 393 "inweb/Chapter 1/Configuration.w"
|
||||
void Configuration__set_range(inweb_instructions *args, text_stream *opt) ;
|
||||
#line 431 "inweb/Chapter 1/Configuration.w"
|
||||
#line 425 "inweb/Chapter 1/Configuration.w"
|
||||
void Configuration__set_fundamental_mode(inweb_instructions *args, int new_material) ;
|
||||
#line 38 "inweb/Chapter 1/Patterns.w"
|
||||
weave_pattern * Patterns__find(web *W, text_stream *name) ;
|
||||
|
@ -3157,7 +3156,7 @@ source_line * Lines__new_source_line_in(text_stream *line, text_file_position *t
|
|||
#line 113 "inweb/Chapter 2/Line Categories.w"
|
||||
char * Lines__category_name(int cat) ;
|
||||
#line 17 "inweb/Chapter 2/The Parser.w"
|
||||
void Parser__parse_web(web *W, int inweb_mode, int sequential) ;
|
||||
void Parser__parse_web(web *W, int inweb_mode) ;
|
||||
#line 721 "inweb/Chapter 2/The Parser.w"
|
||||
text_stream * Parser__extract_purpose(text_stream *prologue, source_line *XL, section *S, source_line **adjust) ;
|
||||
#line 742 "inweb/Chapter 2/The Parser.w"
|
||||
|
@ -13696,7 +13695,7 @@ void Main__follow_instructions(inweb_instructions *ins) {
|
|||
TRUE);
|
||||
W->redirect_weaves_to = ins->weave_into_setting;
|
||||
Reader__read_web(W, ins->verbose_switch);
|
||||
Parser__parse_web(W, ins->inweb_mode, ins->sequential);
|
||||
Parser__parse_web(W, ins->inweb_mode);
|
||||
}
|
||||
if (no_inweb_errors == 0) {
|
||||
if (ins->inweb_mode == TRANSLATE_MODE)
|
||||
|
@ -13940,7 +13939,6 @@ inweb_instructions Configuration__read(int argc, char **argv) {
|
|||
args.tangle_setting = NULL;
|
||||
args.weave_to_setting = NULL;
|
||||
args.weave_into_setting = NULL;
|
||||
args.sequential = FALSE;
|
||||
args.makefile_setting = NULL;
|
||||
args.gitignore_setting = NULL;
|
||||
args.advance_setting = NULL;
|
||||
|
@ -13962,7 +13960,7 @@ inweb_instructions Configuration__read(int argc, char **argv) {
|
|||
;
|
||||
|
||||
{
|
||||
#line 164 "inweb/Chapter 1/Configuration.w"
|
||||
#line 162 "inweb/Chapter 1/Configuration.w"
|
||||
CommandLine__declare_heading(L"inweb: a tool for literate programming\n\n"
|
||||
L"Usage: inweb WEB OPTIONS RANGE\n\n"
|
||||
L"WEB must be a directory holding a literate program (a 'web')\n\n"
|
||||
|
@ -14027,8 +14025,6 @@ inweb_instructions Configuration__read(int argc, char **argv) {
|
|||
L"weave, but into directory X");
|
||||
CommandLine__declare_switch(WEAVE_TO_CLSW, L"weave-to", 2,
|
||||
L"weave, but to filename X (for single files only)");
|
||||
CommandLine__declare_boolean_switch(SEQUENTIAL_CLSW, L"sequential", 1,
|
||||
L"name woven leaves with sequential numbering", FALSE);
|
||||
CommandLine__declare_switch(OPEN_CLSW, L"open", 1,
|
||||
L"weave then open woven file");
|
||||
CommandLine__declare_switch(WEAVE_AS_CLSW, L"weave-as", 2,
|
||||
|
@ -14072,25 +14068,25 @@ inweb_instructions Configuration__read(int argc, char **argv) {
|
|||
return args;
|
||||
}
|
||||
|
||||
#line 122 "inweb/Chapter 1/Configuration.w"
|
||||
#line 121 "inweb/Chapter 1/Configuration.w"
|
||||
|
||||
#line 124 "inweb/Chapter 1/Configuration.w"
|
||||
#line 123 "inweb/Chapter 1/Configuration.w"
|
||||
|
||||
#line 130 "inweb/Chapter 1/Configuration.w"
|
||||
#line 129 "inweb/Chapter 1/Configuration.w"
|
||||
|
||||
#line 132 "inweb/Chapter 1/Configuration.w"
|
||||
#line 131 "inweb/Chapter 1/Configuration.w"
|
||||
|
||||
#line 143 "inweb/Chapter 1/Configuration.w"
|
||||
#line 142 "inweb/Chapter 1/Configuration.w"
|
||||
|
||||
#line 145 "inweb/Chapter 1/Configuration.w"
|
||||
#line 144 "inweb/Chapter 1/Configuration.w"
|
||||
|
||||
#line 155 "inweb/Chapter 1/Configuration.w"
|
||||
|
||||
#line 157 "inweb/Chapter 1/Configuration.w"
|
||||
|
||||
#line 159 "inweb/Chapter 1/Configuration.w"
|
||||
#line 160 "inweb/Chapter 1/Configuration.w"
|
||||
|
||||
#line 162 "inweb/Chapter 1/Configuration.w"
|
||||
|
||||
#line 260 "inweb/Chapter 1/Configuration.w"
|
||||
#line 256 "inweb/Chapter 1/Configuration.w"
|
||||
void Configuration__switch(int id, int val, text_stream *arg, void *state) {
|
||||
inweb_instructions *args = (inweb_instructions *) state;
|
||||
switch (id) {
|
||||
|
@ -14162,8 +14158,6 @@ void Configuration__switch(int id, int val, text_stream *arg, void *state) {
|
|||
case WEAVE_TO_CLSW:
|
||||
args->weave_to_setting = Filenames__from_text(arg);
|
||||
Configuration__set_fundamental_mode(args, WEAVE_MODE); break;
|
||||
case SEQUENTIAL_CLSW:
|
||||
args->sequential = val; break;
|
||||
case OPEN_CLSW:
|
||||
args->open_pdf_switch = TRUE;
|
||||
Configuration__set_fundamental_mode(args, WEAVE_MODE); break;
|
||||
|
@ -14210,7 +14204,7 @@ breadcrumb_request *Configuration__breadcrumb(text_stream *arg) {
|
|||
return BR;
|
||||
}
|
||||
|
||||
#line 384 "inweb/Chapter 1/Configuration.w"
|
||||
#line 378 "inweb/Chapter 1/Configuration.w"
|
||||
void Configuration__bareword(int id, text_stream *opt, void *state) {
|
||||
inweb_instructions *args = (inweb_instructions *) state;
|
||||
if ((args->chosen_web == NULL) && (args->chosen_file == NULL)) {
|
||||
|
@ -14221,7 +14215,7 @@ void Configuration__bareword(int id, text_stream *opt, void *state) {
|
|||
} else Configuration__set_range(args, opt);
|
||||
}
|
||||
|
||||
#line 399 "inweb/Chapter 1/Configuration.w"
|
||||
#line 393 "inweb/Chapter 1/Configuration.w"
|
||||
void Configuration__set_range(inweb_instructions *args, text_stream *opt) {
|
||||
match_results mr = Regexp__create_mr();
|
||||
if (Str__eq_wide_string(opt, L"index")) {
|
||||
|
@ -14251,7 +14245,7 @@ void Configuration__set_range(inweb_instructions *args, text_stream *opt) {
|
|||
Regexp__dispose_of(&mr);
|
||||
}
|
||||
|
||||
#line 431 "inweb/Chapter 1/Configuration.w"
|
||||
#line 425 "inweb/Chapter 1/Configuration.w"
|
||||
void Configuration__set_fundamental_mode(inweb_instructions *args, int new_material) {
|
||||
if ((args->inweb_mode != NO_MODE) && (args->inweb_mode != new_material))
|
||||
Errors__fatal("can only do one at a time - weaving, tangling or analysing");
|
||||
|
@ -14907,7 +14901,7 @@ char *Lines__category_name(int cat) {
|
|||
#line 155 "inweb/Chapter 2/Line Categories.w"
|
||||
|
||||
#line 17 "inweb/Chapter 2/The Parser.w"
|
||||
void Parser__parse_web(web *W, int inweb_mode, int sequential) {
|
||||
void Parser__parse_web(web *W, int inweb_mode) {
|
||||
chapter *C;
|
||||
section *S;
|
||||
LOOP_OVER_LINKED_LIST(C, chapter, W->chapters)
|
||||
|
@ -25341,9 +25335,10 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
module *found_M = Colonies__as_module(search_CM, L, Wm);
|
||||
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);
|
||||
|
||||
{
|
||||
#line 185 "inweb/Chapter 6/Colonies.w"
|
||||
#line 181 "inweb/Chapter 6/Colonies.w"
|
||||
if (found_M == NULL) internal_error("could not locate M");
|
||||
if (search_CM) {
|
||||
pathname *from = Filenames__get_path_to(wv->weave_to);
|
||||
|
@ -25371,11 +25366,8 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
}
|
||||
if (found == FALSE) internal_error("no relation made");
|
||||
if (Str__len(url) > 0) WRITE_TO(url, "/");
|
||||
if (bare_module_name)
|
||||
WRITE_TO(url, "index.html");
|
||||
else if (found_Sm)
|
||||
HTMLFormat__section_URL(url, wv, found_Sm);
|
||||
WRITE_TO(title, "%S", search_CM->name);
|
||||
if (bare_module_name) WRITE_TO(url, "index.html");
|
||||
else if (found_Sm) HTMLFormat__section_URL(url, wv, found_Sm);
|
||||
if (bare_module_name == FALSE)
|
||||
WRITE_TO(title, " (in %S)", search_CM->name);
|
||||
} else {
|
||||
|
@ -25390,26 +25382,21 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
return TRUE;
|
||||
|
||||
}
|
||||
#line 120 "inweb/Chapter 6/Colonies.w"
|
||||
#line 121 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (Regexp__match(&mr, text, L"(%c*?): (%c*)")) {
|
||||
search_M = NULL;
|
||||
external = TRUE;
|
||||
if (search_M == NULL) {
|
||||
search_CM = Colonies__member(mr.exp[0]);
|
||||
if (search_CM) search_M = Colonies__as_module(search_CM, L, Wm);
|
||||
}
|
||||
if (search_M == NULL) {
|
||||
TEMPORARY_TEXT(err);
|
||||
WRITE_TO(err, "unrecognised web/module '%S' - use -colony?", mr.exp[0]);
|
||||
Main__error_in_web(err, L);
|
||||
Regexp__dispose_of(&mr);
|
||||
return FALSE;
|
||||
}
|
||||
if (search_CM) {
|
||||
module *found_M = Colonies__as_module(search_CM, L, Wm);
|
||||
if (found_M) {
|
||||
search_M = found_M;
|
||||
text = Str__duplicate(mr.exp[1]);
|
||||
external = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
Regexp__dispose_of(&mr);
|
||||
|
||||
|
@ -25423,7 +25410,7 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
if (N == 0) {
|
||||
if ((L) && (external == FALSE))
|
||||
{
|
||||
#line 165 "inweb/Chapter 6/Colonies.w"
|
||||
#line 161 "inweb/Chapter 6/Colonies.w"
|
||||
language_function *fn;
|
||||
LOOP_OVER(fn, language_function) {
|
||||
if (Str__eq_insensitive(fn->function_name, text)) {
|
||||
|
@ -25444,7 +25431,7 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
}
|
||||
|
||||
}
|
||||
#line 150 "inweb/Chapter 6/Colonies.w"
|
||||
#line 146 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
Main__error_in_web(TL_IS_534, L);
|
||||
return FALSE;
|
||||
|
@ -25456,7 +25443,7 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
} else {
|
||||
|
||||
{
|
||||
#line 185 "inweb/Chapter 6/Colonies.w"
|
||||
#line 181 "inweb/Chapter 6/Colonies.w"
|
||||
if (found_M == NULL) internal_error("could not locate M");
|
||||
if (search_CM) {
|
||||
pathname *from = Filenames__get_path_to(wv->weave_to);
|
||||
|
@ -25484,11 +25471,8 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
}
|
||||
if (found == FALSE) internal_error("no relation made");
|
||||
if (Str__len(url) > 0) WRITE_TO(url, "/");
|
||||
if (bare_module_name)
|
||||
WRITE_TO(url, "index.html");
|
||||
else if (found_Sm)
|
||||
HTMLFormat__section_URL(url, wv, found_Sm);
|
||||
WRITE_TO(title, "%S", search_CM->name);
|
||||
if (bare_module_name) WRITE_TO(url, "index.html");
|
||||
else if (found_Sm) HTMLFormat__section_URL(url, wv, found_Sm);
|
||||
if (bare_module_name == FALSE)
|
||||
WRITE_TO(title, " (in %S)", search_CM->name);
|
||||
} else {
|
||||
|
@ -25503,7 +25487,7 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
return TRUE;
|
||||
|
||||
}
|
||||
#line 159 "inweb/Chapter 6/Colonies.w"
|
||||
#line 155 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -142,7 +142,6 @@ then declare them.
|
|||
<span class="identifier">args</span><span class="plain">.</span><span class="element">tangle_setting</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="identifier">args</span><span class="plain">.</span><span class="element">weave_to_setting</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="identifier">args</span><span class="plain">.</span><span class="element">weave_into_setting</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="identifier">args</span><span class="plain">.</span><span class="element">sequential</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
|
||||
<span class="identifier">args</span><span class="plain">.</span><span class="element">makefile_setting</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="identifier">args</span><span class="plain">.</span><span class="element">gitignore_setting</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="identifier">args</span><span class="plain">.</span><span class="element">advance_setting</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
|
@ -194,7 +193,6 @@ provides automatically.
|
|||
<span class="definitionkeyword">enum</span> <span class="constant">WEAVE_CLSW</span>
|
||||
<span class="definitionkeyword">enum</span> <span class="constant">WEAVE_INTO_CLSW</span>
|
||||
<span class="definitionkeyword">enum</span> <span class="constant">WEAVE_TO_CLSW</span>
|
||||
<span class="definitionkeyword">enum</span> <span class="constant">SEQUENTIAL_CLSW</span>
|
||||
<span class="definitionkeyword">enum</span> <span class="constant">OPEN_CLSW</span>
|
||||
<span class="definitionkeyword">enum</span> <span class="constant">WEAVE_AS_CLSW</span>
|
||||
<span class="definitionkeyword">enum</span> <span class="constant">WEAVE_TAG_CLSW</span>
|
||||
|
@ -276,8 +274,6 @@ provides automatically.
|
|||
<span class="identifier">L</span><span class="string">"weave, but into directory X"</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="3-cla.html#SP5">CommandLine::declare_switch</a></span><span class="plain">(</span><span class="constant">WEAVE_TO_CLSW</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"weave-to"</span><span class="plain">, </span><span class="constant">2</span><span class="plain">,</span>
|
||||
<span class="identifier">L</span><span class="string">"weave, but to filename X (for single files only)"</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="3-cla.html#SP6">CommandLine::declare_boolean_switch</a></span><span class="plain">(</span><span class="constant">SEQUENTIAL_CLSW</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"sequential"</span><span class="plain">, </span><span class="constant">1</span><span class="plain">,</span>
|
||||
<span class="identifier">L</span><span class="string">"name woven leaves with sequential numbering"</span><span class="plain">, </span><span class="constant">FALSE</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="3-cla.html#SP5">CommandLine::declare_switch</a></span><span class="plain">(</span><span class="constant">OPEN_CLSW</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"open"</span><span class="plain">, </span><span class="constant">1</span><span class="plain">,</span>
|
||||
<span class="identifier">L</span><span class="string">"weave then open woven file"</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="3-cla.html#SP5">CommandLine::declare_switch</a></span><span class="plain">(</span><span class="constant">WEAVE_AS_CLSW</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"weave-as"</span><span class="plain">, </span><span class="constant">2</span><span class="plain">,</span>
|
||||
|
@ -385,8 +381,6 @@ provides automatically.
|
|||
<span class="reserved">case</span><span class="plain"> </span><span class="identifier">WEAVE_TO_CLSW:</span>
|
||||
<span class="identifier">args</span><span class="plain">-></span><span class="element">weave_to_setting</span><span class="plain"> = </span><span class="functiontext"><a href="3-fln.html#SP3">Filenames::from_text</a></span><span class="plain">(</span><span class="identifier">arg</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="#SP6">Configuration::set_fundamental_mode</a></span><span class="plain">(</span><span class="identifier">args</span><span class="plain">, </span><span class="constant">WEAVE_MODE</span><span class="plain">); </span><span class="reserved">break</span><span class="plain">;</span>
|
||||
<span class="reserved">case</span><span class="plain"> </span><span class="identifier">SEQUENTIAL_CLSW:</span>
|
||||
<span class="identifier">args</span><span class="plain">-></span><span class="element">sequential</span><span class="plain"> = </span><span class="identifier">val</span><span class="plain">; </span><span class="reserved">break</span><span class="plain">;</span>
|
||||
<span class="reserved">case</span><span class="plain"> </span><span class="identifier">OPEN_CLSW:</span>
|
||||
<span class="identifier">args</span><span class="plain">-></span><span class="element">open_pdf_switch</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
|
||||
<span class="functiontext"><a href="#SP6">Configuration::set_fundamental_mode</a></span><span class="plain">(</span><span class="identifier">args</span><span class="plain">, </span><span class="constant">WEAVE_MODE</span><span class="plain">); </span><span class="reserved">break</span><span class="plain">;</span>
|
||||
|
|
|
@ -172,7 +172,7 @@ program: some input, some thinking, a choice of three forms of output.
|
|||
<span class="constant">TRUE</span><span class="plain">);</span>
|
||||
<span class="identifier">W</span><span class="plain">-></span><span class="element">redirect_weaves_to</span><span class="plain"> = </span><span class="identifier">ins</span><span class="plain">-></span><span class="element">weave_into_setting</span><span class="plain">;</span>
|
||||
<span class="functiontext"><a href="2-tr.html#SP5">Reader::read_web</a></span><span class="plain">(</span><span class="identifier">W</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-></span><span class="element">verbose_switch</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="2-tp.html#SP1">Parser::parse_web</a></span><span class="plain">(</span><span class="identifier">W</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-></span><span class="element">inweb_mode</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-></span><span class="element">sequential</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="2-tp.html#SP1">Parser::parse_web</a></span><span class="plain">(</span><span class="identifier">W</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-></span><span class="element">inweb_mode</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">no_inweb_errors</span><span class="plain"> == </span><span class="constant">0</span><span class="plain">) {</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-></span><span class="element">inweb_mode</span><span class="plain"> == </span><span class="constant">TRANSLATE_MODE</span><span class="plain">) </span><<span class="cwebmacro">Translate a makefile</span> <span class="cwebmacronumber">7.1</span>>
|
||||
|
|
|
@ -46,7 +46,7 @@ for it to do anything.
|
|||
</p>
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Parser::parse_web<button class="popup" onclick="togglePopup('usagePopup32')">...<span class="popuptext" id="usagePopup32">Usage of <b>Parser::parse_web</b>:<br>Program Control - <a href="1-pc.html#SP7">§7</a></span></button></span><span class="plain">(</span><span class="reserved">web</span><span class="plain"> *</span><span class="identifier">W</span><span class="plain">, </span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">inweb_mode</span><span class="plain">, </span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">sequential</span><span class="plain">) {</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Parser::parse_web<button class="popup" onclick="togglePopup('usagePopup32')">...<span class="popuptext" id="usagePopup32">Usage of <b>Parser::parse_web</b>:<br>Program Control - <a href="1-pc.html#SP7">§7</a></span></button></span><span class="plain">(</span><span class="reserved">web</span><span class="plain"> *</span><span class="identifier">W</span><span class="plain">, </span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">inweb_mode</span><span class="plain">) {</span>
|
||||
<span class="reserved">chapter</span><span class="plain"> *</span><span class="identifier">C</span><span class="plain">;</span>
|
||||
<span class="reserved">section</span><span class="plain"> *</span><span class="identifier">S</span><span class="plain">;</span>
|
||||
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">C</span><span class="plain">, </span><span class="reserved">chapter</span><span class="plain">, </span><span class="identifier">W</span><span class="plain">-></span><span class="element">chapters</span><span class="plain">)</span>
|
||||
|
|
|
@ -170,25 +170,21 @@ link to, and what the full text of the link might be.
|
|||
<span class="reserved">module</span><span class="plain"> *</span><span class="identifier">found_M</span><span class="plain"> = </span><span class="functiontext"><a href="#SP4">Colonies::as_module</a></span><span class="plain">(</span><span class="identifier">search_CM</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">, </span><span class="identifier">Wm</span><span class="plain">);</span>
|
||||
<span class="reserved">section_md</span><span class="plain"> *</span><span class="identifier">found_Sm</span><span class="plain"> = </span><span class="identifier">FIRST_IN_LINKED_LIST</span><span class="plain">(</span><span class="reserved">section_md</span><span class="plain">, </span><span class="identifier">found_M</span><span class="plain">-></span><span class="element">sections_md</span><span class="plain">);</span>
|
||||
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">bare_module_name</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">, </span><span class="string">"%S"</span><span class="plain">, </span><span class="identifier">search_CM</span><span class="plain">-></span><span class="identifier">name</span><span class="plain">);</span>
|
||||
<<span class="cwebmacro">Resolved</span> <span class="cwebmacronumber">5.2</span>><span class="plain">;</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="constant">TRUE</span><span class="plain">;</span>
|
||||
<span class="plain">}</span>
|
||||
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">text</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"(%c*?): (%c*)"</span><span class="plain">)) {</span>
|
||||
<span class="identifier">search_M</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="identifier">external</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">search_M</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) {</span>
|
||||
<span class="identifier">search_CM</span><span class="plain"> = </span><span class="functiontext"><a href="#SP3">Colonies::member</a></span><span class="plain">(</span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0]);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">search_CM</span><span class="plain">) </span><span class="identifier">search_M</span><span class="plain"> = </span><span class="functiontext"><a href="#SP4">Colonies::as_module</a></span><span class="plain">(</span><span class="identifier">search_CM</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">, </span><span class="identifier">Wm</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">search_M</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) {</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">err</span><span class="plain">);</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">err</span><span class="plain">, </span><span class="string">"unrecognised web/module '%S' - use -colony?"</span><span class="plain">, </span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0]);</span>
|
||||
<span class="functiontext"><a href="1-pc.html#SP8">Main::error_in_web</a></span><span class="plain">(</span><span class="identifier">err</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="4-pm.html#SP9">Regexp::dispose_of</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">);</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="constant">FALSE</span><span class="plain">;</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">search_CM</span><span class="plain">) {</span>
|
||||
<span class="reserved">module</span><span class="plain"> *</span><span class="identifier">found_M</span><span class="plain"> = </span><span class="functiontext"><a href="#SP4">Colonies::as_module</a></span><span class="plain">(</span><span class="identifier">search_CM</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">, </span><span class="identifier">Wm</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">found_M</span><span class="plain">) {</span>
|
||||
<span class="identifier">search_M</span><span class="plain"> = </span><span class="identifier">found_M</span><span class="plain">;</span>
|
||||
<span class="identifier">text</span><span class="plain"> = </span><span class="functiontext"><a href="4-sm.html#SP3">Str::duplicate</a></span><span class="plain">(</span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[1]);</span>
|
||||
<span class="identifier">external</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="functiontext"><a href="4-pm.html#SP9">Regexp::dispose_of</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">);</span>
|
||||
|
||||
|
@ -280,11 +276,8 @@ link to, and what the full text of the link might be.
|
|||
<span class="plain">}</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">found</span><span class="plain"> == </span><span class="constant">FALSE</span><span class="plain">) </span><span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"no relation made"</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-sm.html#SP8">Str::len</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">) > </span><span class="constant">0</span><span class="plain">) </span><span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="string">"/"</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">bare_module_name</span><span class="plain">)</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="string">"index.html"</span><span class="plain">);</span>
|
||||
<span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="identifier">found_Sm</span><span class="plain">)</span>
|
||||
<span class="functiontext"><a href="5-hf.html#SP29">HTMLFormat::section_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">found_Sm</span><span class="plain">);</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">, </span><span class="string">"%S"</span><span class="plain">, </span><span class="identifier">search_CM</span><span class="plain">-></span><span class="identifier">name</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">bare_module_name</span><span class="plain">) </span><span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="string">"index.html"</span><span class="plain">);</span>
|
||||
<span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="identifier">found_Sm</span><span class="plain">) </span><span class="functiontext"><a href="5-hf.html#SP29">HTMLFormat::section_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">found_Sm</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">bare_module_name</span><span class="plain"> == </span><span class="constant">FALSE</span><span class="plain">)</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">, </span><span class="string">" (in %S)"</span><span class="plain">, </span><span class="identifier">search_CM</span><span class="plain">-></span><span class="element">name</span><span class="plain">);</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<!--Weave of 'How to Write a Web' generated by 7-->
|
||||
<ul class="crumbs"><li><a href="../webs.html">Home</a></li><li><a href="index.html">inweb</a></li><li><a href="index.html#M">Manual</a></li><li><b>How to Write a Web</b></li></ul><p class="purpose">How to mark up code for literate programming.</p>
|
||||
|
||||
<ul class="toc"><li><a href="#SP1">§1. The title of a section</a></li><li><a href="#SP2">§2. Paragraphing</a></li><li><a href="#SP6">§6. Conditional compilation</a></li><li><a href="#SP7">§7. Commentary</a></li><li><a href="#SP12">§12. Code samples and other extraneous matter</a></li><li><a href="#SP13">§13. Links</a></li><li><a href="#SP14">§14. Cross-references</a></li><li><a href="#SP16">§16. Figures</a></li><li><a href="#SP17">§17. Embedded video</a></li><li><a href="#SP20">§20. Mathematics notation</a></li><li><a href="#SP21">§21. Footnotes</a></li></ul><hr class="tocbar">
|
||||
<ul class="toc"><li><a href="#SP1">§1. The title of a section</a></li><li><a href="#SP2">§2. Paragraphing</a></li><li><a href="#SP6">§6. Conditional compilation</a></li><li><a href="#SP7">§7. Commentary</a></li><li><a href="#SP12">§12. Code samples and other extraneous matter</a></li><li><a href="#SP13">§13. Links</a></li><li><a href="#SP14">§14. Cross-references</a></li><li><a href="#SP16">§16. Colonies</a></li><li><a href="#SP17">§17. Figures</a></li><li><a href="#SP18">§18. Embedded video</a></li><li><a href="#SP21">§21. Mathematics notation</a></li><li><a href="#SP22">§22. Footnotes</a></li></ul><hr class="tocbar">
|
||||
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. The title of a section. </b>In any section file, there will be a few lines at the top which occur before
|
||||
the first paragraph of code begins. (The first paragraph begins on the first
|
||||
|
@ -576,7 +576,7 @@ place cross-references like so:
|
|||
|
||||
<p class="inwebparagraph">To see how cross-references are implemented, see <a href="5-fm.html" class="internal">Format Methods</a>,
|
||||
or more generally the whole of <a href="5-fm.html" class="internal">Chapter 5: Formats</a>; to decipher the text,
|
||||
Inweb uses code from <a href="../foundation-module/index.html" class="internal">foundation</a> at <a href="../foundation-module/8-wm.html" class="internal">Web Modulesfoundation (in foundation)</a>.
|
||||
Inweb uses code from <a href="../foundation-module/index.html" class="internal">foundation</a> at <a href="../foundation-module/8-wm.html" class="internal">Web Modules (in foundation)</a>.
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph">What happened in that last sentence is that Inweb noticed the following:
|
||||
|
@ -643,7 +643,51 @@ can be configured in the Contents page of a web, say like so:
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP16"></a><b>§16. Figures. </b>Images to be included in weaves of a web are called "Figures", as they
|
||||
<p class="inwebparagraph"><a id="SP16"></a><b>§16. Colonies. </b>A collection of webs gathered in one place is, for want of a better word,
|
||||
called a "colony". (Some social species of spiders form colonies, and share
|
||||
webs which are collectively woven.)
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph">Running Inweb with <code class="display"><span class="extract">-colony F</span></code> tells it that the file <code class="display"><span class="extract">F</span></code> lists the webs and
|
||||
modules making up the current colony. This affects only weaving, and allows
|
||||
cross-referencing across webs which do not share any actual code. For
|
||||
example, here is the current version of the colony file for the Inweb
|
||||
repository:
|
||||
</p>
|
||||
|
||||
<pre class="display">
|
||||
<span class="plain">web: "inweb" at "inweb" in "inweb/docs/inweb"</span>
|
||||
<span class="plain">module: "foundation" at "inweb/foundation-module" in "inweb/docs/foundation-module"</span>
|
||||
<span class="plain">web: "foundation-test" at "inweb/foundation-test" in "inweb/docs/foundation-test"</span>
|
||||
<span class="plain">web: "goldbach" at "inweb/Examples/goldbach" in "inweb/docs/goldbach"</span>
|
||||
<span class="plain">web: "twinprimes" at "inweb/Examples/twinprimes.inweb" in "inweb/docs/twinprimes"</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph">As this demonstrates, either webs, or modules, or both, can be included.
|
||||
Each one gives (a) a short name, (b) a location relative to the current
|
||||
working directory, and (c) a similar location for its woven collection of
|
||||
files.
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph">The practical effect of this is that a cross-reference like this can work,
|
||||
even from one web to another: see <a href="../goldbach/S-tsoe.html" class="internal">The Sieve of Eratosthenes (in goldbach)</a>.
|
||||
That last sentence was typed as:
|
||||
</p>
|
||||
|
||||
<pre class="display">
|
||||
<span class="plain">The practical effect of this is that a cross-reference like this can work,</span>
|
||||
<span class="plain">even from one web to another: see //goldbach: The Sieve of Eratosthenes//.</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="inwebparagraph">Cross-references to other webs or modules in the same colony can be to chapters
|
||||
or sections, or simply to the entire web in question — see <a href="../goldbach/index.html" class="internal">goldbach</a> —
|
||||
but not to functions or types in those webs: that would require Inweb to read
|
||||
every web in the colony into memory, which would slow it down too much.
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP17"></a><b>§17. Figures. </b>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 <code class="display"><span class="extract">Figures</span></code>: for instance,
|
||||
the weaver would seek <code class="display"><span class="extract">Fig_2_3.pdf</span></code> at pathname <code class="display"><span class="extract">Figures/Fig_2_3.pdf</span></code>.
|
||||
|
@ -674,7 +718,7 @@ to be exactly that given: it is scaled accordingly. (They can't both be
|
|||
constrained, so you can't change the aspect ratio.)
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP17"></a><b>§17. Embedded video. </b>This makes sense only for some HTML-like weave formats, but we can also
|
||||
<p class="inwebparagraph"><a id="SP18"></a><b>§18. Embedded video. </b>This makes sense only for some HTML-like weave formats, but we can also
|
||||
cause videos to be embedded:
|
||||
</p>
|
||||
|
||||
|
@ -717,7 +761,7 @@ this case was <code class="display"><span class="extract">https://youtu.be/GR3aI
|
|||
|
||||
<center><iframe width="100%" height="405" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/42803139&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
|
||||
</center>
|
||||
<p class="inwebparagraph"><a id="SP18"></a><b>§18. </b>Adding width and height is straightforward; by default the dimensions are
|
||||
<p class="inwebparagraph"><a id="SP19"></a><b>§19. </b>Adding width and height is straightforward; by default the dimensions are
|
||||
720 by 405.
|
||||
</p>
|
||||
|
||||
|
@ -730,7 +774,7 @@ this case was <code class="display"><span class="extract">https://youtu.be/GR3aI
|
|||
arguably music has width and not height, but SoundCloud thinks otherwise).
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP19"></a><b>§19. </b>It's easy to add services. These are all handled by using prototype code
|
||||
<p class="inwebparagraph"><a id="SP20"></a><b>§20. </b>It's easy to add services. These are all handled by using prototype code
|
||||
for a suitable HTML <code class="display"><span class="extract"><iframe></span></code>, and those prototypes are stored in the
|
||||
<code class="display"><span class="extract">Embedding</span></code> subdirectory of the Inweb installation. But you can use your
|
||||
own prototypes instead, by creating an <code class="display"><span class="extract">Embedding</span></code> subdirectory of your own
|
||||
|
@ -738,7 +782,7 @@ web; this overrides the ones built in. If your service is, say, <code class="dis
|
|||
then the file would be <code class="display"><span class="extract">W/Embedding/WebTubeo.html</span></code>.
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP20"></a><b>§20. Mathematics notation. </b>Literate programming is a good technique to justify code which hangs on
|
||||
<p class="inwebparagraph"><a id="SP21"></a><b>§21. Mathematics notation. </b>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.
|
||||
</p>
|
||||
|
@ -797,7 +841,7 @@ deactivated entirely by writing the following in the Contents section of a web:
|
|||
<p class="inwebparagraph">(This is always <code class="display"><span class="extract">On</span></code>, the default, or <code class="display"><span class="extract">Off</span></code>.)
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP21"></a><b>§21. Footnotes. </b>Not everyone likes footnotes,<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> but sometimes they're a tidy way to make
|
||||
<p class="inwebparagraph"><a id="SP22"></a><b>§22. Footnotes. </b>Not everyone likes footnotes,<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> but sometimes they're a tidy way to make
|
||||
references.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>
|
||||
</p>
|
||||
|
||||
|
@ -807,7 +851,7 @@ University Press, 1999).
|
|||
Computers & Mathematics with Applications, 2, 137-39 (1976).
|
||||
<a href="#fnref:2" title="return to text"> ↩</a></p></li></p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP22"></a><b>§22. </b>The content of that sentence was typed as follows:
|
||||
<p class="inwebparagraph"><a id="SP23"></a><b>§23. </b>The content of that sentence was typed as follows:
|
||||
</p>
|
||||
|
||||
<pre class="display">
|
||||
|
@ -840,7 +884,7 @@ right now it's not possible to have mathematics in a footnote when <code class="
|
|||
is in use.
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP23"></a><b>§23. </b>Once again, notation may be an issue, and so it's controllable. By default,
|
||||
<p class="inwebparagraph"><a id="SP24"></a><b>§24. </b>Once again, notation may be an issue, and so it's controllable. By default,
|
||||
we have:
|
||||
</p>
|
||||
|
||||
|
|
|
@ -81,7 +81,6 @@
|
|||
<span class="plain"> -colony X use the file X as a list of webs in this colony</span>
|
||||
<span class="plain"> -navigation X use the file X as a column of navigation links</span>
|
||||
<span class="plain"> -open weave then open woven file</span>
|
||||
<span class="plain"> -sequential name woven leaves with sequential numbering (default is -no-sequential)</span>
|
||||
<span class="plain"> -weave weave the web into human-readable form</span>
|
||||
<span class="plain"> -weave-as X set weave pattern to X (default is 'HTML')</span>
|
||||
<span class="plain"> -weave-docs weave the web for use at GitHub Pages</span>
|
||||
|
|
1
inweb.mk
1
inweb.mk
|
@ -84,6 +84,7 @@ commit:
|
|||
pages:
|
||||
$(INWEB) -help > $(ME)/Figures/help.txt
|
||||
$(INWEB) -show-languages > $(ME)/Figures/languages.txt
|
||||
cp -f $(ME)/docs/docs-src/colony.txt $(ME)/Figures/colony.txt
|
||||
$(INWEB) -advance-build-file $(ME)/build.txt
|
||||
mkdir -p $(ME)/docs
|
||||
rm -f $(ME)/docs/*.html
|
||||
|
|
|
@ -110,6 +110,7 @@ commit:
|
|||
pages:
|
||||
$(INWEB) -help > $(ME)/Figures/help.txt
|
||||
$(INWEB) -show-languages > $(ME)/Figures/languages.txt
|
||||
cp -f $(ME)/docs/docs-src/colony.txt $(ME)/Figures/colony.txt
|
||||
$(INWEB) -advance-build-file $(ME)/build.txt
|
||||
mkdir -p $(ME)/docs
|
||||
rm -f $(ME)/docs/*.html
|
||||
|
|
Loading…
Reference in a new issue