mirror of
https://github.com/ganelson/inform.git
synced 2024-06-29 05:24:57 +03:00
Tidied up settings and navigation designs in Indoc
This commit is contained in:
parent
6b2cee70ad
commit
0e06463b2f
|
@ -1 +1 @@
|
|||
BUILDCODE = 6Q18
|
||||
BUILDCODE = 6Q19
|
||||
|
|
|
@ -6,8 +6,8 @@ Declare Section Usage: Off
|
|||
Licence: This is a free, open-source program published under the Artistic License 2.0.
|
||||
Version Number: 4
|
||||
Version Name: Duralumin
|
||||
Build Number: 6Q17
|
||||
Build Date: 12 February 2019
|
||||
Build Number: 6Q18
|
||||
Build Date: 15 February 2019
|
||||
Web Syntax Version: 2
|
||||
|
||||
Import: foundation
|
||||
|
@ -39,3 +39,4 @@ Chapter 3: Other Material
|
|||
Base64
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,4 +2,4 @@ Sync to inform7
|
|||
Amalgam 1 3K27 April 2006 Public launch
|
||||
Brass 2 5Z71 April 2009 Faster and tidied up (renamed "cBlorb")
|
||||
Chromoly 3 6E36 April 2010 Extended to release interpreters
|
||||
Duralumin 4 *6Q17 12 February 2019 Unicode support (renamed "inblorb")
|
||||
Duralumin 4 *6Q18 15 February 2019 Unicode support (renamed "inblorb")
|
||||
|
|
|
@ -44,6 +44,7 @@ We need to itemise the structures we'll want to allocate:
|
|||
@e CSS_tweak_data_MT
|
||||
@e span_notation_MT
|
||||
@e dc_metadatum_MT
|
||||
@e navigation_design_MT
|
||||
|
||||
@ And then expand:
|
||||
|
||||
|
@ -62,6 +63,7 @@ ALLOCATE_INDIVIDUALLY(example)
|
|||
ALLOCATE_INDIVIDUALLY(CSS_tweak_data)
|
||||
ALLOCATE_INDIVIDUALLY(span_notation)
|
||||
ALLOCATE_INDIVIDUALLY(dc_metadatum)
|
||||
ALLOCATE_INDIVIDUALLY(navigation_design)
|
||||
|
||||
@h The Unicode for section.
|
||||
Since this doesn't lie in the ASCII character range, I'll refer to it by
|
||||
|
|
|
@ -17,6 +17,17 @@ Instructions of indoc to different output types.
|
|||
@d SECTION_GRANULARITY 3
|
||||
@d SAME_AS_MAIN_GRANULARITY -1
|
||||
|
||||
@d HTML_FORMAT 1
|
||||
@d PLAIN_FORMAT 2
|
||||
|
||||
@d PASTEMODE_none 1
|
||||
@d PASTEMODE_Andrew 2
|
||||
@d PASTEMODE_David 3
|
||||
|
||||
@d WRAPPER_none 1
|
||||
@d WRAPPER_epub 2
|
||||
@d WRAPPER_zip 3
|
||||
|
||||
=
|
||||
typedef struct indoc_instructions {
|
||||
int verbose_mode;
|
||||
|
@ -45,6 +56,34 @@ typedef struct indoc_instructions {
|
|||
struct pathname *examples_directory;
|
||||
int examples_granularity; /* one of the |*_GRANULARITY| values above */
|
||||
|
||||
struct pathname *change_logs_folder;
|
||||
struct filename *css_source_file;
|
||||
struct filename *definitions_filename;
|
||||
struct text_stream *definitions_index_leafname;
|
||||
|
||||
int format; /* one of the |*_FORMAT| values above */
|
||||
int XHTML; /* a flag: relevant only if |HTML_FORMAT| is chosen */
|
||||
int javascript; /* a flag */
|
||||
int javascript_paste_method; /* one of the |PASTEMDDE_*| values above */
|
||||
|
||||
int html_for_Inform_application;
|
||||
int images_copy;
|
||||
struct pathname *images_path;
|
||||
int inform_definitions_mode;
|
||||
int suppress_fonts;
|
||||
int assume_Public_Library;
|
||||
|
||||
int retina_images;
|
||||
int support_creation;
|
||||
|
||||
struct text_stream *link_to_extensions_index;
|
||||
struct filename *top_and_tail;
|
||||
struct filename *top_and_tail_sections;
|
||||
int treat_code_as_verbatim;
|
||||
int wrapper; /* one of the |WRAPPER_*| values above */
|
||||
struct ebook *ebook;
|
||||
struct navigation_design *navigation;
|
||||
|
||||
MEMORY_MANAGEMENT
|
||||
} indoc_instructions;
|
||||
|
||||
|
@ -79,82 +118,38 @@ indoc_instructions *Instructions::clean_slate(void) {
|
|||
settings->examples_directory = NULL;
|
||||
settings->examples_granularity = SAME_AS_MAIN_GRANULARITY;
|
||||
|
||||
settings->change_logs_folder = NULL; /* default not set here, as it depends on book folder */
|
||||
settings->css_source_file = NULL;
|
||||
settings->definitions_filename = NULL;
|
||||
settings->definitions_index_leafname = NULL;
|
||||
|
||||
settings->format = HTML_FORMAT;
|
||||
settings->XHTML = FALSE;
|
||||
settings->javascript = FALSE;
|
||||
settings->javascript_paste_method = PASTEMODE_none;
|
||||
|
||||
settings->html_for_Inform_application = FALSE;
|
||||
settings->images_copy = FALSE;
|
||||
settings->images_path = NULL;
|
||||
settings->inform_definitions_mode = FALSE;
|
||||
settings->suppress_fonts = FALSE;
|
||||
settings->assume_Public_Library = FALSE;
|
||||
|
||||
settings->retina_images = FALSE;
|
||||
settings->support_creation = FALSE;
|
||||
|
||||
settings->link_to_extensions_index = NULL;
|
||||
settings->top_and_tail = NULL;
|
||||
settings->top_and_tail_sections = NULL;
|
||||
settings->treat_code_as_verbatim = FALSE;
|
||||
settings->wrapper = WRAPPER_none;
|
||||
settings->ebook = NULL;
|
||||
|
||||
settings->navigation = Gadgets::default();
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
@ Otherwise, following settings are made by the instructions; these are their
|
||||
default values, which ensure that |indoc| will at least run safely, but in
|
||||
practice several of these are in any case set by the basic instructions file.
|
||||
See the manual for their meanings.
|
||||
|
||||
=
|
||||
pathname *SET_change_logs_directory = NULL; /* default set below, as it depends on book folder */
|
||||
filename *SET_css_source_file = NULL;
|
||||
filename *SET_definitions_filename = NULL;
|
||||
text_stream *SET_definitions_index_leafname = NULL;
|
||||
|
||||
@
|
||||
|
||||
@d HTML_FORMAT 1
|
||||
@d PLAIN_FORMAT 2
|
||||
|
||||
=
|
||||
int SET_format = HTML_FORMAT; /* must be one of those */
|
||||
|
||||
@ =
|
||||
int SET_html_for_Inform_application = FALSE;
|
||||
int SET_images_copy = FALSE;
|
||||
pathname *SET_images_path = NULL;
|
||||
int SET_inform_definitions_mode = FALSE;
|
||||
int SET_javascript = FALSE;
|
||||
int SET_suppress_fonts = FALSE;
|
||||
int SET_assume_Public_Library = FALSE;
|
||||
|
||||
int SET_retina_images = FALSE;
|
||||
int SET_support_creation = FALSE;
|
||||
|
||||
@
|
||||
|
||||
@d PASTEMODE_none 1
|
||||
@d PASTEMODE_Andrew 2
|
||||
@d PASTEMODE_David 3
|
||||
|
||||
=
|
||||
int SET_javascript_paste_method = PASTEMODE_none; /* must be one of those */
|
||||
|
||||
@ =
|
||||
text_stream *SET_link_to_extensions_index = NULL;
|
||||
|
||||
@
|
||||
|
||||
@d NAVMODE_twilight 1
|
||||
@d NAVMODE_midnight 2
|
||||
@d NAVMODE_architect 3
|
||||
@d NAVMODE_roadsign 4
|
||||
@d NAVMODE_lacuna 5
|
||||
@d NAVMODE_unsigned 6
|
||||
|
||||
=
|
||||
int SET_navigation = NAVMODE_midnight; /* must be one of the above */
|
||||
|
||||
@ =
|
||||
filename *SET_top_and_tail = NULL;
|
||||
filename *SET_top_and_tail_sections = NULL;
|
||||
int SET_treat_code_as_verbatim = FALSE;
|
||||
|
||||
@
|
||||
|
||||
@d WRAPPER_none 1
|
||||
@d WRAPPER_epub 2
|
||||
@d WRAPPER_zip 3
|
||||
|
||||
=
|
||||
int SET_wrapper = WRAPPER_none; /* must be one of the above */
|
||||
ebook *SET_ebook = NULL;
|
||||
|
||||
@ =
|
||||
int SET_XHTML = FALSE;
|
||||
|
||||
@ =
|
||||
typedef struct dc_metadatum {
|
||||
struct text_stream *dc_key;
|
||||
|
@ -172,11 +167,11 @@ void Instructions::read_instructions(text_stream *target_sought, linked_list *L,
|
|||
indoc_instructions *settings) {
|
||||
int found_flag = FALSE; /* was a target of this name actually found? */
|
||||
|
||||
SET_change_logs_directory = Pathnames::subfolder(settings->book_folder, I"Change Logs");
|
||||
settings->change_logs_folder = Pathnames::subfolder(settings->book_folder, I"Change Logs");
|
||||
settings->examples_directory = Pathnames::subfolder(settings->book_folder, I"Examples");
|
||||
pathname *Materials = Pathnames::subfolder(Pathnames::from_text(I"indoc"), I"Materials");
|
||||
SET_css_source_file = Filenames::in_folder(Materials, I"base.css");
|
||||
SET_definitions_index_leafname = Str::duplicate(I"general_index.html");
|
||||
settings->css_source_file = Filenames::in_folder(Materials, I"base.css");
|
||||
settings->definitions_index_leafname = Str::duplicate(I"general_index.html");
|
||||
|
||||
filename *F;
|
||||
LOOP_OVER_LINKED_LIST(F, filename, L)
|
||||
|
@ -227,6 +222,7 @@ int Instructions::read_instructions_from(filename *F, text_stream *desired,
|
|||
void Instructions::read_instructions_helper(text_stream *cl, text_file_position *tfp,
|
||||
void *v_ihs) {
|
||||
ins_helper_state *ihs = (ins_helper_state *) v_ihs;
|
||||
indoc_instructions *settings = ihs->settings;
|
||||
match_results mr = Regexp::create_mr();
|
||||
|
||||
if (Regexp::match(&mr, cl, L" *#%c*")) { Regexp::dispose_of(&mr); return; }
|
||||
|
@ -244,12 +240,12 @@ void Instructions::read_instructions_helper(text_stream *cl, text_file_position
|
|||
} else {
|
||||
if ((Str::len(ihs->scanning_target) == 0) ||
|
||||
(Str::eq(ihs->scanning_target, ihs->desired_target))) {
|
||||
if (ihs->settings->verbose_mode)
|
||||
if (settings->verbose_mode)
|
||||
PRINT("%f, line %d: %S\n", tfp->text_file_filename, tfp->line_count, cl);
|
||||
if (Regexp::match(&mr, cl, L" *follow: *(%c*?) *")) {
|
||||
if (Instructions::read_instructions_from(
|
||||
Filenames::in_folder(ihs->settings->book_folder, mr.exp[0]),
|
||||
ihs->desired_target, ihs->settings))
|
||||
Filenames::in_folder(settings->book_folder, mr.exp[0]),
|
||||
ihs->desired_target, settings))
|
||||
ihs->found_aim = TRUE;
|
||||
} else if (Regexp::match(&mr, cl, L" *declare: *(%c*?) *")) {
|
||||
Symbols::declare_symbol(mr.exp[0]);
|
||||
|
@ -267,10 +263,10 @@ void Instructions::read_instructions_helper(text_stream *cl, text_file_position
|
|||
@<Act on a volume creation@>
|
||||
} else if (Regexp::match(&mr, cl, L" *cover: *(%c*?) *")) {
|
||||
@<Disallow this in a specific target@>;
|
||||
ihs->settings->book_cover_image = Instructions::set_file(mr.exp[0], ihs->settings);
|
||||
settings->book_cover_image = Instructions::set_file(mr.exp[0], settings);
|
||||
} else if (Regexp::match(&mr, cl, L" *examples *")) {
|
||||
@<Disallow this in a specific target@>;
|
||||
ihs->settings->book_contains_examples = TRUE;
|
||||
settings->book_contains_examples = TRUE;
|
||||
} else if (Regexp::match(&mr, cl, L" *dc:(%C+): *(%c*?) *")) {
|
||||
@<Disallow this in a specific target@>;
|
||||
dc_metadatum *dcm = CREATE(dc_metadatum);
|
||||
|
@ -281,7 +277,7 @@ void Instructions::read_instructions_helper(text_stream *cl, text_file_position
|
|||
} else if (Regexp::match(&mr, cl, L" *index: *(%c*?) *")) {
|
||||
@<Act on an indexing notation@>;
|
||||
} else if (Regexp::match(&mr, cl, L" *images: *(%c*?) *")) {
|
||||
HTMLUtilities::add_image_source(Instructions::set_path(mr.exp[0], ihs->settings));
|
||||
HTMLUtilities::add_image_source(Instructions::set_path(mr.exp[0], settings));
|
||||
} else if (Regexp::match(&mr, cl, L" *(%C+) *= *(%c*?) *")) {
|
||||
@<Act on an instructions setting@>;
|
||||
} else {
|
||||
|
@ -315,7 +311,7 @@ which reads:
|
|||
if (Regexp::match(&mr2, title, L"(%c*?) *%((%c*?)%)")) { /* the optional abbreviation syntax */
|
||||
Str::copy(title, mr2.exp[0]); Str::copy(abbrev, mr2.exp[1]);
|
||||
}
|
||||
Scanner::create_volume(ihs->settings->book_folder, file, title, abbrev);
|
||||
Scanner::create_volume(settings->book_folder, file, title, abbrev);
|
||||
DISCARD_TEXT(file);
|
||||
DISCARD_TEXT(abbrev);
|
||||
Regexp::dispose_of(&mr2);
|
||||
|
@ -360,7 +356,7 @@ which reads:
|
|||
@<Act on an indexing notation@> =
|
||||
text_stream *tweak = mr.exp[0];
|
||||
match_results mr2 = Regexp::create_mr();
|
||||
if (ihs->settings->test_index_mode) PRINT("Read in: %S\n", tweak);
|
||||
if (settings->test_index_mode) PRINT("Read in: %S\n", tweak);
|
||||
if (Regexp::match(&mr2, tweak, L"^{(%C*)headword(%C*)} = (%C+) *(%c*)")) {
|
||||
Indexes::add_indexing_notation(mr2.exp[0], mr2.exp[1], mr2.exp[2], mr2.exp[3]);
|
||||
} else if (Regexp::match(&mr2, tweak, L"{(%C+?)} = (%C+) *(%c*)")) {
|
||||
|
@ -401,111 +397,104 @@ taste). In a multiple-line value, each line is terminated with a newline.
|
|||
|
||||
@<Set an instructions option@> =
|
||||
if (Str::eq_wide_string(key, L"alphabetization")) {
|
||||
if (Str::eq_wide_string(val, L"word-by-word")) { ihs->settings->index_alphabetisation_algorithm = WORD_ALPHABETIZATION; }
|
||||
else if (Str::eq_wide_string(val, L"letter-by-letter")) { ihs->settings->index_alphabetisation_algorithm = LETTER_ALPHABETIZATION; }
|
||||
if (Str::eq_wide_string(val, L"word-by-word")) { settings->index_alphabetisation_algorithm = WORD_ALPHABETIZATION; }
|
||||
else if (Str::eq_wide_string(val, L"letter-by-letter")) { settings->index_alphabetisation_algorithm = LETTER_ALPHABETIZATION; }
|
||||
else Errors::in_text_file("no such alphabetization", tfp);
|
||||
}
|
||||
else if (Str::eq_wide_string(key, L"assume_Public_Library")) {
|
||||
SET_assume_Public_Library = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"change_logs_directory")) { SET_change_logs_directory = Instructions::set_path(val, ihs->settings); }
|
||||
else if (Str::eq_wide_string(key, L"contents_leafname")) { ihs->settings->contents_leafname = Str::duplicate(val); }
|
||||
else if (Str::eq_wide_string(key, L"contents_expandable")) { ihs->settings->contents_expandable = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"css_source_file")) { SET_css_source_file = Instructions::set_file(val, ihs->settings); }
|
||||
else if (Str::eq_wide_string(key, L"definitions_filename")) { SET_definitions_filename = Instructions::set_file(val, ihs->settings); }
|
||||
settings->assume_Public_Library = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"change_logs_directory")) { settings->change_logs_folder = Instructions::set_path(val, settings); }
|
||||
else if (Str::eq_wide_string(key, L"contents_leafname")) { settings->contents_leafname = Str::duplicate(val); }
|
||||
else if (Str::eq_wide_string(key, L"contents_expandable")) { settings->contents_expandable = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"css_source_file")) { settings->css_source_file = Instructions::set_file(val, settings); }
|
||||
else if (Str::eq_wide_string(key, L"definitions_filename")) { settings->definitions_filename = Instructions::set_file(val, settings); }
|
||||
else if (Str::eq_wide_string(key, L"definitions_index_filename")) {
|
||||
SET_definitions_index_leafname = Str::duplicate(val); }
|
||||
settings->definitions_index_leafname = Str::duplicate(val); }
|
||||
else if (Str::eq_wide_string(key, L"destination")) {
|
||||
if (ihs->settings->destination_modifiable)
|
||||
ihs->settings->destination = Instructions::set_path(val, ihs->settings);
|
||||
if (settings->destination_modifiable)
|
||||
settings->destination = Instructions::set_path(val, settings);
|
||||
}
|
||||
else if (Str::eq_wide_string(key, L"examples_directory")) {
|
||||
ihs->settings->examples_directory = Instructions::set_path(val, ihs->settings); }
|
||||
settings->examples_directory = Instructions::set_path(val, settings); }
|
||||
else if (Str::eq_wide_string(key, L"examples_alphabetical_leafname")) {
|
||||
ihs->settings->examples_alphabetical_leafname = Str::duplicate(val); }
|
||||
settings->examples_alphabetical_leafname = Str::duplicate(val); }
|
||||
else if (Str::eq_wide_string(key, L"examples_granularity")) {
|
||||
ihs->settings->examples_granularity = Instructions::set_range(key, val, 1, 3, tfp); }
|
||||
settings->examples_granularity = Instructions::set_range(key, val, 1, 3, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"examples_mode")) {
|
||||
if (Str::eq_wide_string(val, L"open")) { ihs->settings->examples_mode = EXMODE_open_internal; }
|
||||
else if (Str::eq_wide_string(val, L"openable")) { ihs->settings->examples_mode = EXMODE_openable_internal; }
|
||||
if (Str::eq_wide_string(val, L"open")) { settings->examples_mode = EXMODE_open_internal; }
|
||||
else if (Str::eq_wide_string(val, L"openable")) { settings->examples_mode = EXMODE_openable_internal; }
|
||||
else Errors::in_text_file("no such examples mode", tfp);
|
||||
}
|
||||
else if (Str::eq_wide_string(key, L"examples_numerical_leafname")) {
|
||||
ihs->settings->examples_numerical_leafname = Str::duplicate(val); }
|
||||
settings->examples_numerical_leafname = Str::duplicate(val); }
|
||||
else if (Str::eq_wide_string(key, L"examples_thematic_leafname")) {
|
||||
ihs->settings->examples_thematic_leafname = Str::duplicate(val); }
|
||||
settings->examples_thematic_leafname = Str::duplicate(val); }
|
||||
else if (Str::eq_wide_string(key, L"format")) {
|
||||
if (Str::eq_wide_string(val, L"HTML")) { SET_format = HTML_FORMAT; }
|
||||
else if (Str::eq_wide_string(val, L"text")) { SET_format = PLAIN_FORMAT; }
|
||||
if (Str::eq_wide_string(val, L"HTML")) { settings->format = HTML_FORMAT; }
|
||||
else if (Str::eq_wide_string(val, L"text")) { settings->format = PLAIN_FORMAT; }
|
||||
else Errors::in_text_file("no such format", tfp);
|
||||
}
|
||||
else if (Str::eq_wide_string(key, L"granularity")) { ihs->settings->granularity = Instructions::set_range(key, val, 1, 3, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"granularity")) { settings->granularity = Instructions::set_range(key, val, 1, 3, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"html_for_Inform_application")) {
|
||||
SET_html_for_Inform_application = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"images_path")) { SET_images_path = Instructions::set_path(val, ihs->settings); }
|
||||
else if (Str::eq_wide_string(key, L"images_copy")) { SET_images_copy = Instructions::set_yn(key, val, tfp); }
|
||||
settings->html_for_Inform_application = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"images_path")) { settings->images_path = Instructions::set_path(val, settings); }
|
||||
else if (Str::eq_wide_string(key, L"images_copy")) { settings->images_copy = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"inform_definitions_mode")) {
|
||||
SET_inform_definitions_mode = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"javascript")) { SET_javascript = Instructions::set_yn(key, val, tfp); }
|
||||
settings->inform_definitions_mode = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"javascript")) { settings->javascript = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"javascript_paste_method")) {
|
||||
if (Str::eq_wide_string(val, L"none")) { SET_javascript_paste_method = PASTEMODE_none; }
|
||||
else if (Str::eq_wide_string(val, L"Andrew")) { SET_javascript_paste_method = PASTEMODE_Andrew; }
|
||||
else if (Str::eq_wide_string(val, L"David")) { SET_javascript_paste_method = PASTEMODE_David; }
|
||||
if (Str::eq_wide_string(val, L"none")) { settings->javascript_paste_method = PASTEMODE_none; }
|
||||
else if (Str::eq_wide_string(val, L"Andrew")) { settings->javascript_paste_method = PASTEMODE_Andrew; }
|
||||
else if (Str::eq_wide_string(val, L"David")) { settings->javascript_paste_method = PASTEMODE_David; }
|
||||
else Errors::in_text_file("no such Javascript paste mode", tfp);
|
||||
}
|
||||
else if (Str::eq_wide_string(key, L"link_to_extensions_index")) {
|
||||
SET_link_to_extensions_index = Str::duplicate(val); }
|
||||
else if (Str::eq_wide_string(key, L"manifest_leafname")) { ihs->settings->manifest_leafname = Str::duplicate(val); }
|
||||
settings->link_to_extensions_index = Str::duplicate(val); }
|
||||
else if (Str::eq_wide_string(key, L"manifest_leafname")) { settings->manifest_leafname = Str::duplicate(val); }
|
||||
else if (Str::eq_wide_string(key, L"navigation")) {
|
||||
if (Str::eq_wide_string(val, L"twilight")) { SET_navigation = NAVMODE_twilight; }
|
||||
else if (Str::eq_wide_string(val, L"midnight")) { SET_navigation = NAVMODE_midnight; }
|
||||
else if (Str::eq_wide_string(val, L"architect")) { SET_navigation = NAVMODE_architect; }
|
||||
else if (Str::eq_wide_string(val, L"roadsign")) { SET_navigation = NAVMODE_roadsign; }
|
||||
else if (Str::eq_wide_string(val, L"unsigned")) { SET_navigation = NAVMODE_unsigned; }
|
||||
else if (Str::eq_wide_string(val, L"lacuna")) { SET_navigation = NAVMODE_lacuna; }
|
||||
else Errors::in_text_file("no such navigation mode", tfp);
|
||||
settings->navigation = Gadgets::parse(val);
|
||||
if (settings->navigation == NULL) Errors::in_text_file("no such navigation mode", tfp);
|
||||
}
|
||||
else if (Str::eq_wide_string(key, L"retina_images")) {
|
||||
SET_retina_images = Instructions::set_yn(key, val, tfp); }
|
||||
settings->retina_images = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"support_creation")) {
|
||||
SET_support_creation = Instructions::set_yn(key, val, tfp); }
|
||||
settings->support_creation = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"suppress_fonts")) {
|
||||
SET_suppress_fonts = Instructions::set_yn(key, val, tfp); }
|
||||
settings->suppress_fonts = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"toc_granularity")) {
|
||||
ihs->settings->toc_granularity = Instructions::set_range(key, val, 1, 3, tfp); }
|
||||
settings->toc_granularity = Instructions::set_range(key, val, 1, 3, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"top_and_tail_sections")) {
|
||||
SET_top_and_tail_sections = Instructions::set_file(val, ihs->settings); }
|
||||
else if (Str::eq_wide_string(key, L"top_and_tail")) { SET_top_and_tail = Instructions::set_file(val, ihs->settings); }
|
||||
settings->top_and_tail_sections = Instructions::set_file(val, settings); }
|
||||
else if (Str::eq_wide_string(key, L"top_and_tail")) { settings->top_and_tail = Instructions::set_file(val, settings); }
|
||||
else if (Str::eq_wide_string(key, L"treat_code_as_verbatim")) {
|
||||
SET_treat_code_as_verbatim = Instructions::set_yn(key, val, tfp); }
|
||||
settings->treat_code_as_verbatim = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"wrapper")) {
|
||||
if (Str::eq_wide_string(val, L"EPUB")) { SET_wrapper = WRAPPER_epub; }
|
||||
else if (Str::eq_wide_string(val, L"zip")) { SET_wrapper = WRAPPER_zip; }
|
||||
else if (Str::eq_wide_string(val, L"none")) { SET_wrapper = WRAPPER_none; }
|
||||
if (Str::eq_wide_string(val, L"EPUB")) { settings->wrapper = WRAPPER_epub; }
|
||||
else if (Str::eq_wide_string(val, L"zip")) { settings->wrapper = WRAPPER_zip; }
|
||||
else if (Str::eq_wide_string(val, L"none")) { settings->wrapper = WRAPPER_none; }
|
||||
else Errors::in_text_file("no such wrapper", tfp);
|
||||
}
|
||||
else if (Str::eq_wide_string(key, L"XHTML")) { SET_XHTML = Instructions::set_yn(key, val, tfp); }
|
||||
else if (Str::eq_wide_string(key, L"XHTML")) { settings->XHTML = Instructions::set_yn(key, val, tfp); }
|
||||
|
||||
else Errors::in_text_file("no such setting", tfp);
|
||||
|
||||
@<Reconcile any conflicting instructions@> =
|
||||
if (SET_wrapper == WRAPPER_epub) {
|
||||
SET_javascript = 0;
|
||||
SET_javascript_paste_method = PASTEMODE_none;
|
||||
if (settings->wrapper == WRAPPER_epub) {
|
||||
settings->javascript = FALSE;
|
||||
settings->javascript_paste_method = PASTEMODE_none;
|
||||
if (settings->examples_mode == EXMODE_openable_internal) {
|
||||
settings->examples_mode = EXMODE_open_internal;
|
||||
}
|
||||
settings->contents_expandable = FALSE;
|
||||
SET_images_copy = 1;
|
||||
if ((SET_navigation != NAVMODE_roadsign) &&
|
||||
(SET_navigation != NAVMODE_unsigned)) {
|
||||
SET_navigation = NAVMODE_roadsign;
|
||||
}
|
||||
SET_format = HTML_FORMAT;
|
||||
SET_XHTML = TRUE;
|
||||
SET_ebook = Epub::new(I"untitled ebook", "");
|
||||
settings->images_copy = 1;
|
||||
settings->navigation = Gadgets::for_ebook(settings->navigation);
|
||||
settings->format = HTML_FORMAT;
|
||||
settings->XHTML = TRUE;
|
||||
settings->ebook = Epub::new(I"untitled ebook", "");
|
||||
}
|
||||
|
||||
if (SET_javascript_paste_method != PASTEMODE_none) { SET_javascript = 1; }
|
||||
if (settings->javascript_paste_method != PASTEMODE_none)
|
||||
settings->javascript = TRUE;
|
||||
|
||||
if (settings->examples_granularity == SAME_AS_MAIN_GRANULARITY)
|
||||
settings->examples_granularity = settings->granularity;
|
||||
|
@ -521,15 +510,16 @@ taste). In a multiple-line value, each line is terminated with a newline.
|
|||
Errors::nowhere("TOC granularity can't be less than granularity");
|
||||
}
|
||||
|
||||
if (SET_format == PLAIN_FORMAT) SET_navigation = NAVMODE_lacuna;
|
||||
if (settings->format == PLAIN_FORMAT)
|
||||
settings->navigation = Gadgets::for_plain_text(settings->navigation);
|
||||
|
||||
@<Declare the format and wrapper as symbols@> =
|
||||
if (SET_wrapper == WRAPPER_epub) Symbols::declare_symbol(I"EPUB");
|
||||
else if (SET_wrapper == WRAPPER_zip) Symbols::declare_symbol(I"zip");
|
||||
if (settings->wrapper == WRAPPER_epub) Symbols::declare_symbol(I"EPUB");
|
||||
else if (settings->wrapper == WRAPPER_zip) Symbols::declare_symbol(I"zip");
|
||||
else Symbols::declare_symbol(I"unwrapped");
|
||||
|
||||
if (SET_format == HTML_FORMAT) Symbols::declare_symbol(I"HTML");
|
||||
if (SET_format == PLAIN_FORMAT) Symbols::declare_symbol(I"text");
|
||||
if (settings->format == HTML_FORMAT) Symbols::declare_symbol(I"HTML");
|
||||
if (settings->format == PLAIN_FORMAT) Symbols::declare_symbol(I"text");
|
||||
|
||||
@h Parsing values.
|
||||
Note the Unix-style conveniences for pathnames: an initial |~| means the
|
||||
|
@ -615,11 +605,11 @@ int Instructions::set_yn(text_stream *key, text_stream *val, text_file_position
|
|||
@ For ebooks only.
|
||||
|
||||
=
|
||||
void Instructions::apply_ebook_metadata(void) {
|
||||
void Instructions::apply_ebook_metadata(ebook *E) {
|
||||
dc_metadatum *dcm;
|
||||
LOOP_OVER(dcm, dc_metadatum) {
|
||||
wchar_t K[1024];
|
||||
Str::copy_to_wide_string(K, dcm->dc_key, 1024);
|
||||
Epub::attach_metadata(SET_ebook, K, dcm->dc_val);
|
||||
Epub::attach_metadata(E, K, dcm->dc_val);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,14 +43,14 @@ int main(int argc, char **argv) {
|
|||
@<Start up indoc@>;
|
||||
@<Make a first-pass scan of the rawtext@>;
|
||||
@<Render the rawtext as documentation@>;
|
||||
if (SET_html_for_Inform_application == 1)
|
||||
if (indoc_settings->html_for_Inform_application)
|
||||
@<Work out cross-references for the in-application documentation only@>;
|
||||
@<Produce the indexes@>;
|
||||
HTMLUtilities::copy_images();
|
||||
if (SET_wrapper == WRAPPER_epub) {
|
||||
if (indoc_settings->wrapper == WRAPPER_epub) {
|
||||
HTMLUtilities::note_images();
|
||||
Scanner::mark_up_ebook();
|
||||
Epub::end_construction(SET_ebook);
|
||||
Epub::end_construction(indoc_settings->ebook);
|
||||
}
|
||||
@<Shut down indoc@>;
|
||||
Basics::end();
|
||||
|
@ -61,17 +61,18 @@ int main(int argc, char **argv) {
|
|||
|
||||
@<Start up indoc@> =
|
||||
PRINT("indoc [[Version Number]] (Inform Tools Suite)\n");
|
||||
indoc_settings = Instructions::clean_slate();
|
||||
Gadgets::start();
|
||||
Symbols::start_up_symbols();
|
||||
indoc_settings = Instructions::clean_slate();
|
||||
Configuration::read_command_line(argc, argv, indoc_settings);
|
||||
if (SET_wrapper == WRAPPER_epub) {
|
||||
if (indoc_settings->wrapper == WRAPPER_epub) {
|
||||
HTMLUtilities::image_URL(NULL,
|
||||
Filenames::get_leafname(indoc_settings->book_cover_image));
|
||||
Instructions::apply_ebook_metadata();
|
||||
Instructions::apply_ebook_metadata(indoc_settings->ebook);
|
||||
pathname *I = Pathnames::from_text(I"images");
|
||||
filename *cover_in_situ = Filenames::in_folder(I,
|
||||
Filenames::get_leafname(indoc_settings->book_cover_image));
|
||||
indoc_settings->destination = Epub::begin_construction(SET_ebook,
|
||||
indoc_settings->destination = Epub::begin_construction(indoc_settings->ebook,
|
||||
indoc_settings->destination, cover_in_situ);
|
||||
}
|
||||
|
||||
|
@ -92,7 +93,7 @@ point, nothing is being output.
|
|||
section by section.
|
||||
|
||||
@<Render the rawtext as documentation@> =
|
||||
if (SET_format == HTML_FORMAT) CSS::write_CSS_files(SET_css_source_file);
|
||||
if (indoc_settings->format == HTML_FORMAT) CSS::write_CSS_files(indoc_settings->css_source_file);
|
||||
volume *V;
|
||||
text_stream *TO = NULL;
|
||||
LOOP_OVER(V, volume) TO = Rawtext::process_large_rawtext_file(TO, V);
|
||||
|
@ -103,14 +104,14 @@ to go inside the Inform user interface application.
|
|||
|
||||
@<Work out cross-references for the in-application documentation only@> =
|
||||
Scanner::write_manifest_file(FIRST_OBJECT(volume));
|
||||
if (SET_definitions_filename) Updater::write_definitions_file();
|
||||
if (indoc_settings->definitions_filename) Updater::write_definitions_file();
|
||||
if (indoc_settings->standard_rules_filename)
|
||||
Updater::rewrite_standard_rules_file(indoc_settings->standard_rules_filename);
|
||||
|
||||
@ These are automatically generated.
|
||||
|
||||
@<Produce the indexes@> =
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
if (no_examples > 0) {
|
||||
ExamplesIndex::write_alphabetical_examples_index();
|
||||
ExamplesIndex::write_numerical_examples_index();
|
||||
|
|
|
@ -213,7 +213,7 @@ all CSS files, but here we know that |base.css| is tidily written.
|
|||
@ =
|
||||
void CSS::expand_IMAGES(text_stream *text) {
|
||||
match_results mr = Regexp::create_mr();
|
||||
if (SET_suppress_fonts == 1) {
|
||||
if (indoc_settings->suppress_fonts == 1) {
|
||||
while (Regexp::match(&mr, text, L"(%c*?)font-family:(%c*?);(%c*)")) {
|
||||
text_stream *L = mr.exp[0], *M = NULL, *R = mr.exp[2];
|
||||
if (Regexp::match(NULL, mr.exp[1], L"%c*monospace%c*")) M = I"___MONOSPACE___";
|
||||
|
|
|
@ -330,8 +330,8 @@ that is, separate file.
|
|||
|
||||
=
|
||||
void Examples::render_example_cue(OUTPUT_STREAM, example *E, volume *V, int writing_index) {
|
||||
if (SET_format == PLAIN_FORMAT) @<Render example cue in plain text@>
|
||||
else if (SET_format == HTML_FORMAT) @<Render example cue in HTML@>;
|
||||
if (indoc_settings->format == PLAIN_FORMAT) @<Render example cue in plain text@>
|
||||
else if (indoc_settings->format == HTML_FORMAT) @<Render example cue in HTML@>;
|
||||
}
|
||||
|
||||
@<Render example cue in plain text@> =
|
||||
|
@ -346,7 +346,7 @@ void Examples::render_example_cue(OUTPUT_STREAM, example *E, volume *V, int writ
|
|||
DISCARD_TEXT(anchor);
|
||||
}
|
||||
|
||||
if (SET_navigation != NAVMODE_twilight) @<Render the example cue left surround@>;
|
||||
if (indoc_settings->navigation->simplified_examples == FALSE) @<Render the example cue left surround@>;
|
||||
|
||||
TEMPORARY_TEXT(url);
|
||||
TEMPORARY_TEXT(onclick);
|
||||
|
@ -363,7 +363,7 @@ void Examples::render_example_cue(OUTPUT_STREAM, example *E, volume *V, int writ
|
|||
HTML_TAG("br");
|
||||
WRITE("%S", E->ex_outline);
|
||||
|
||||
if (SET_navigation != NAVMODE_twilight) @<Render the example cue right surround@>;
|
||||
if (indoc_settings->navigation->simplified_examples == FALSE) @<Render the example cue right surround@>;
|
||||
WRITE("\n");
|
||||
|
||||
@ The "surround" is an table-implemented area which contains the descriptive
|
||||
|
@ -398,7 +398,7 @@ other book.
|
|||
|
||||
@<Render the example difficulty asterisks@> =
|
||||
for (int starcc=0; starcc < E->ex_star_count; starcc++) {
|
||||
if (SET_navigation == NAVMODE_twilight) WRITE("*");
|
||||
if (indoc_settings->navigation->simplified_examples) WRITE("*");
|
||||
else HTMLUtilities::asterisk_image(OUT, I"asterisk.png");
|
||||
}
|
||||
|
||||
|
@ -414,7 +414,7 @@ other book.
|
|||
}
|
||||
Str::trim_white_space(text_of_name);
|
||||
Rawtext::escape_HTML_characters_in(text_of_name);
|
||||
if (SET_navigation != NAVMODE_twilight) {
|
||||
if (indoc_settings->navigation->simplified_examples == FALSE) {
|
||||
HTML_OPEN_WITH("span", "class=\"egbanner\"");
|
||||
WRITE("Example");
|
||||
HTML_CLOSE("span");
|
||||
|
|
|
@ -61,10 +61,10 @@ void HTMLUtilities::image_URL(OUTPUT_STREAM, text_stream *leafname) {
|
|||
Dictionaries::write_value(image_usages, leafname, iu);
|
||||
}
|
||||
iu->usage_count++;
|
||||
filename *F = Filenames::in_folder(SET_images_path, leafname);
|
||||
if (SET_html_for_Inform_application == 1) WRITE("inform:/%/f", F);
|
||||
filename *F = Filenames::in_folder(indoc_settings->images_path, leafname);
|
||||
if (indoc_settings->html_for_Inform_application == 1) WRITE("inform:/%/f", F);
|
||||
else {
|
||||
if (SET_images_copy == 1)
|
||||
if (indoc_settings->images_copy)
|
||||
F = Filenames::in_folder(Pathnames::from_text(I"images"), leafname);
|
||||
WRITE("%/f", F);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ void HTMLUtilities::image_URL(OUTPUT_STREAM, text_stream *leafname) {
|
|||
void HTMLUtilities::note_images(void) {
|
||||
image_usage *iu;
|
||||
LOOP_OVER(iu, image_usage)
|
||||
Epub::note_image(SET_ebook, iu->resolved_to);
|
||||
Epub::note_image(indoc_settings->ebook, iu->resolved_to);
|
||||
}
|
||||
|
||||
@ Suppose we are indeed copying images into place: we have to get them from
|
||||
|
@ -96,7 +96,7 @@ working backwards. As soon as we find a file of that name, we copy it over.
|
|||
|
||||
=
|
||||
void HTMLUtilities::copy_images(void) {
|
||||
if (SET_images_copy == 1) {
|
||||
if (indoc_settings->images_copy) {
|
||||
pathname *I = Pathnames::subfolder(indoc_settings->destination, I"images");
|
||||
Pathnames::create_in_file_system(I);
|
||||
image_usage *iu;
|
||||
|
@ -120,7 +120,7 @@ void HTMLUtilities::copy_images(void) {
|
|||
|
||||
=
|
||||
void HTMLUtilities::begin_file(OUTPUT_STREAM, volume *V) {
|
||||
HTML::declare_as_HTML(OUT, SET_XHTML);
|
||||
HTML::declare_as_HTML(OUT, indoc_settings->XHTML);
|
||||
filename *CSS = NULL;
|
||||
if ((V) && (Str::len(V->vol_CSS_leafname) > 0))
|
||||
CSS = Filenames::from_text(V->vol_CSS_leafname);
|
||||
|
@ -169,7 +169,7 @@ Horizontal ruled lines.
|
|||
|
||||
=
|
||||
void HTMLUtilities::ruled_line(OUTPUT_STREAM) {
|
||||
if (SET_format == HTML_FORMAT) HTML_TAG("hr")
|
||||
if (indoc_settings->format == HTML_FORMAT) HTML_TAG("hr")
|
||||
else WRITE("----------------------------------------------------------------------\n");
|
||||
}
|
||||
|
||||
|
@ -355,9 +355,9 @@ void HTMLUtilities::paste_script(OUTPUT_STREAM, text_stream *content, int code_n
|
|||
else WRITE("%d(code", code_num);
|
||||
WRITE(") {\n");
|
||||
|
||||
if (SET_javascript_paste_method == PASTEMODE_Andrew)
|
||||
if (indoc_settings->javascript_paste_method == PASTEMODE_Andrew)
|
||||
WRITE(" var myProject = window.Project;\n");
|
||||
if (SET_javascript_paste_method == PASTEMODE_David)
|
||||
if (indoc_settings->javascript_paste_method == PASTEMODE_David)
|
||||
WRITE(" var myProject = external.Project;\n");
|
||||
WRITE("\n");
|
||||
WRITE(" myProject.selectView('source');\n");
|
||||
|
@ -375,9 +375,9 @@ void HTMLUtilities::create_script(OUTPUT_STREAM, text_stream *content, int code_
|
|||
else WRITE("%d(code", code_num);
|
||||
WRITE(", title) {\n");
|
||||
|
||||
if (SET_javascript_paste_method == PASTEMODE_Andrew)
|
||||
if (indoc_settings->javascript_paste_method == PASTEMODE_Andrew)
|
||||
WRITE(" var myProject = window.Project;\n");
|
||||
if (SET_javascript_paste_method == PASTEMODE_David)
|
||||
if (indoc_settings->javascript_paste_method == PASTEMODE_David)
|
||||
WRITE(" var myProject = external.Project;\n");
|
||||
|
||||
WRITE("\n");
|
||||
|
@ -398,7 +398,7 @@ Some nice little boxes for syntax definitions in computery manuals:
|
|||
int no_definition_anchors = 0;
|
||||
|
||||
void HTMLUtilities::definition_box(OUTPUT_STREAM, text_stream *defn, text_stream *sigil, volume *V, section *S) {
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
TEMPORARY_TEXT(anchor);
|
||||
WRITE_TO(anchor, "defn%d", no_definition_anchors++);
|
||||
|
||||
|
@ -425,7 +425,7 @@ void HTMLUtilities::definition_box(OUTPUT_STREAM, text_stream *defn, text_stream
|
|||
}
|
||||
|
||||
void HTMLUtilities::end_definition_box(OUTPUT_STREAM) {
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
WRITE("\n");
|
||||
HTML::comment(OUT, I"end definition");
|
||||
HTML_CLOSE("div");
|
||||
|
@ -445,7 +445,7 @@ void HTMLUtilities::defn_unpack(OUTPUT_STREAM, text_stream *given_defn, volume *
|
|||
TEMPORARY_TEXT(index_as);
|
||||
@<Work out an index mark for this definition@>;
|
||||
|
||||
if (SET_inform_definitions_mode) {
|
||||
if (indoc_settings->inform_definitions_mode) {
|
||||
@<Rewrite definition as an HTML paragraph of class defnprototype@>;
|
||||
@<Set the kind of the result of the phrase in italic, not bold@>;
|
||||
@<Specially set and specially index a phrase to decide a condition@>;
|
||||
|
@ -472,7 +472,7 @@ void HTMLUtilities::defn_unpack(OUTPUT_STREAM, text_stream *given_defn, volume *
|
|||
|
||||
@<Work out an index mark for this definition@> =
|
||||
Str::copy(index_as, given_defn);
|
||||
if (SET_inform_definitions_mode) Regexp::replace(index_as, L" ...%c*", NULL, 0);
|
||||
if (indoc_settings->inform_definitions_mode) Regexp::replace(index_as, L" ...%c*", NULL, 0);
|
||||
Regexp::replace(index_as, L": *", NULL, 0);
|
||||
WRITE_TO(index_as, "=___=!definition");
|
||||
Indexes::mark_index_term(index_as, V, S, anchor, NULL, NULL, NULL);
|
||||
|
@ -590,10 +590,10 @@ void HTMLUtilities::tt_helper(text_stream *line, text_file_position *tfp, void *
|
|||
=
|
||||
void HTMLUtilities::get_tt_matter(OUTPUT_STREAM, int top, int main) {
|
||||
if (first_request_for_tt) {
|
||||
if (SET_top_and_tail_sections)
|
||||
HTMLUtilities::read_top_and_tail_matter(SET_top_and_tail_sections, FALSE);
|
||||
if (SET_top_and_tail)
|
||||
HTMLUtilities::read_top_and_tail_matter(SET_top_and_tail, TRUE);
|
||||
if (indoc_settings->top_and_tail_sections)
|
||||
HTMLUtilities::read_top_and_tail_matter(indoc_settings->top_and_tail_sections, FALSE);
|
||||
if (indoc_settings->top_and_tail)
|
||||
HTMLUtilities::read_top_and_tail_matter(indoc_settings->top_and_tail, TRUE);
|
||||
}
|
||||
first_request_for_tt = FALSE;
|
||||
if ((top == 1) && (main == 1)) WRITE("%S", DSET_main_top_matter);
|
||||
|
|
|
@ -135,7 +135,7 @@ void Rawtext::process_large_helper(text_stream *rawl, text_file_position *tfp,
|
|||
TEMPORARY_TEXT(css_style);
|
||||
match_results mr2 = Regexp::create_mr();
|
||||
@<Deal with any permitted markup@>;
|
||||
if ((SET_treat_code_as_verbatim == 0) || (Str::get_first_char(rawl) != '\t')) {
|
||||
if ((indoc_settings->treat_code_as_verbatim == FALSE) || (Str::get_first_char(rawl) != '\t')) {
|
||||
@<Deal with an insert-change-log notation@>;
|
||||
@<Deal with an insert-image notation@>;
|
||||
}
|
||||
|
@ -214,16 +214,16 @@ smoke-test indexing mode applies direct markup to make its smoky black
|
|||
rectangles.)
|
||||
|
||||
@<Deal with any permitted markup@> =
|
||||
if ((SET_treat_code_as_verbatim == FALSE) || (Str::get_first_char(rawl) != '\t')) {
|
||||
if ((indoc_settings->treat_code_as_verbatim == FALSE) || (Str::get_first_char(rawl) != '\t')) {
|
||||
Indexes::scan_indexingnotations(rawl, rhs->V,
|
||||
(rhs->V)?(rhs->V->sections[rhs->no_blocks_written]):NULL, rhs->E);
|
||||
CSS::expand_spannotations(rawl, MARKUP_SPP);
|
||||
}
|
||||
|
||||
if (SET_format == HTML_FORMAT) Regexp::replace(rawl, L"<(%c*?)>", L"<%0>", REP_REPEATING);
|
||||
if (indoc_settings->format == HTML_FORMAT) Regexp::replace(rawl, L"<(%c*?)>", L"<%0>", REP_REPEATING);
|
||||
|
||||
wchar_t *replacement = L"%1";
|
||||
if (SET_format == HTML_FORMAT) replacement = L"<span class=\"%0\">%1</span>";
|
||||
if (indoc_settings->format == HTML_FORMAT) replacement = L"<span class=\"%0\">%1</span>";
|
||||
Regexp::replace(rawl, L"___mu___(%c*?)___mo___(%c*?)___mc___", replacement, REP_REPEATING);
|
||||
|
||||
@ The notation |///6X12.txt///| means "insert the change log for build 6X12 here".
|
||||
|
@ -232,16 +232,16 @@ It should be the only thing on its line.
|
|||
@<Deal with an insert-change-log notation@> =
|
||||
if (Regexp::match(&mr2, rawl, L"(%c*?)///(%c*?).txt/// *")) {
|
||||
Str::copy(rawl, mr2.exp[0]);
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
Str::clear(rawl);
|
||||
HTML::hr(rawl, NULL);
|
||||
HTML::open(rawl, "pre", I"class='changelog'");
|
||||
suppress_p_tag = TRUE;
|
||||
}
|
||||
filename *cl = Filenames::in_folder(SET_change_logs_directory, mr2.exp[1]);
|
||||
filename *cl = Filenames::in_folder(indoc_settings->change_logs_folder, mr2.exp[1]);
|
||||
TextFiles::read(cl, FALSE, "can't open change log file",
|
||||
TRUE, Rawtext::process_change_log_helper, NULL, rawl);
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
WRITE_TO(rawl, "\n");
|
||||
HTML::close(rawl, "pre");
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ It should be the only thing on its line.
|
|||
void Rawtext::process_change_log_helper(text_stream *sml, text_file_position *tfp,
|
||||
void *v_rawl) {
|
||||
text_stream *rawl = (text_stream *) v_rawl;
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
Regexp::replace(sml, L"<", L"<", REP_REPEATING);
|
||||
Regexp::replace(sml, L">", L">", REP_REPEATING);
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ is used, then the image is styled as |img.classname|.
|
|||
TEMPORARY_TEXT(url);
|
||||
HTMLUtilities::image_URL(url, name);
|
||||
Str::clear(rawl);
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
WRITE_TO(rawl, "%S", left);
|
||||
TEMPORARY_TEXT(details);
|
||||
WRITE_TO(details, "alt=\"%S\" src=\"%S\"", name, url);
|
||||
|
@ -394,7 +394,7 @@ block heading, and whatever tags it once had have been removed.
|
|||
in tag elements into |"| escapes.
|
||||
|
||||
@<Treat the text as necessary@> =
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
TEMPORARY_TEXT(dequotee);
|
||||
Str::copy(dequotee, rawl);
|
||||
Str::clear(rawl);
|
||||
|
@ -411,7 +411,7 @@ in tag elements into |"| escapes.
|
|||
|
||||
@ =
|
||||
void Rawtext::escape_HTML_characters_in(text_stream *text) {
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
TEMPORARY_TEXT(modified);
|
||||
for (int i=0, L=Str::len(text); i<L; i++) {
|
||||
int c = Str::get_at(text, i);
|
||||
|
|
|
@ -136,7 +136,7 @@ section names are capitalised for this purpose.)
|
|||
WRITE_TO(index_term, "%S=___=!example", E->ex_public_name);
|
||||
Indexes::mark_index_term(index_term, V, NULL, NULL, E, NULL, NULL);
|
||||
DISCARD_TEXT(index_term);
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
TEMPORARY_TEXT(comment);
|
||||
WRITE_TO(comment, "START EXAMPLE \"%d: %S\" \"e%d\"",
|
||||
E->example_position[0], E->ex_public_name, E->allocation_id);
|
||||
|
@ -147,19 +147,19 @@ section names are capitalised for this purpose.)
|
|||
code_example = E;
|
||||
OUT = Renderer::render_example_body(OUT, E, V, TRUE);
|
||||
code_example = NULL;
|
||||
if (SET_format == HTML_FORMAT) HTML::comment(OUT, I"END EXAMPLE");
|
||||
if (indoc_settings->format == HTML_FORMAT) HTML::comment(OUT, I"END EXAMPLE");
|
||||
|
||||
@ =
|
||||
text_stream *Renderer::render_example_body(OUTPUT_STREAM, example *E, volume *V, int empty) {
|
||||
int hide = FALSE;
|
||||
if (indoc_settings->examples_mode == EXMODE_openable_internal) hide = TRUE;
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
TEMPORARY_TEXT(id);
|
||||
WRITE_TO(id, "example%d", E->allocation_id);
|
||||
HTML::begin_div_with_class_and_id_S(OUT, I"egpanel", id, hide);
|
||||
}
|
||||
OUT = Rawtext::process_example_rawtext_file(OUT, V, E);
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
HTML::end_div(OUT);
|
||||
if (empty) { HTML_OPEN("p"); HTML_CLOSE("p"); }
|
||||
}
|
||||
|
@ -171,8 +171,8 @@ The actual contents of the buffer are rendered here, then:
|
|||
|
||||
=
|
||||
text_stream *Renderer::render_text_of_block(OUTPUT_STREAM, volume *V, section *S) {
|
||||
if (SET_format == PLAIN_FORMAT) @<Render the block buffer as plain text@>
|
||||
else if (SET_format == HTML_FORMAT) @<Render the block buffer as HTML@>;
|
||||
if (indoc_settings->format == PLAIN_FORMAT) @<Render the block buffer as plain text@>
|
||||
else if (indoc_settings->format == HTML_FORMAT) @<Render the block buffer as HTML@>;
|
||||
return OUT;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ text_stream *Renderer::render_text_of_block(OUTPUT_STREAM, volume *V, section *S
|
|||
/* Remove any paste markers entirely */
|
||||
text_stream *raw = paragraphs[i].par_texts;
|
||||
match_results mr = Regexp::create_mr();
|
||||
if ((SET_treat_code_as_verbatim == 0) &&
|
||||
if ((indoc_settings->treat_code_as_verbatim == FALSE) &&
|
||||
(Regexp::match(&mr, raw, L"{%*+} *(%c*)")))
|
||||
WRITE("%S\n", mr.exp[0]);
|
||||
else
|
||||
|
@ -250,7 +250,7 @@ very much.
|
|||
TEMPORARY_TEXT(raw);
|
||||
Str::copy(raw, P->par_texts);
|
||||
|
||||
if (SET_treat_code_as_verbatim == FALSE) {
|
||||
if (indoc_settings->treat_code_as_verbatim == FALSE) {
|
||||
|
||||
Regexp::replace(raw, L"{%*%*}", NULL, REP_REPEATING); /* Remove any paste-continuation marker */
|
||||
|
||||
|
@ -408,11 +408,11 @@ see below.
|
|||
Str::copy(raw, mr.exp[0]);
|
||||
TEMPORARY_TEXT(right);
|
||||
Str::copy(right, mr.exp[1]);
|
||||
if (SET_javascript_paste_method == PASTEMODE_none) {
|
||||
if (indoc_settings->javascript_paste_method == PASTEMODE_none) {
|
||||
WRITE_TO(raw, "%S", right);
|
||||
} else {
|
||||
WRITE_TO(raw, "<a href=\"javascript:pasteCode");
|
||||
if (SET_javascript_paste_method == PASTEMODE_David) {
|
||||
if (indoc_settings->javascript_paste_method == PASTEMODE_David) {
|
||||
Javascript_paste_count++;
|
||||
WRITE_TO(raw, "%d", Javascript_paste_count);
|
||||
}
|
||||
|
@ -429,21 +429,21 @@ see below.
|
|||
}
|
||||
}
|
||||
Renderer::apply_Inform_escape_characters(titling);
|
||||
if (SET_javascript_paste_method == PASTEMODE_Andrew)
|
||||
if (indoc_settings->javascript_paste_method == PASTEMODE_Andrew)
|
||||
WRITE_TO(raw, "'%S\\n'", J_text);
|
||||
WRITE_TO(raw, ")\">");
|
||||
if (SET_retina_images == 1) HTMLUtilities::image_element_scaled(raw, I"paste@2x.png", 13, 13);
|
||||
if (indoc_settings->retina_images) HTMLUtilities::image_element_scaled(raw, I"paste@2x.png", 13, 13);
|
||||
else HTMLUtilities::image_element(raw, I"paste.png");
|
||||
WRITE_TO(raw, "</a> ");
|
||||
if ((SET_support_creation) && (Str::len(titling) > 0)) {
|
||||
if ((indoc_settings->support_creation) && (Str::len(titling) > 0)) {
|
||||
WRITE_TO(raw, "<a href=\"javascript:createNewProject");
|
||||
if (SET_javascript_paste_method == PASTEMODE_David)
|
||||
if (indoc_settings->javascript_paste_method == PASTEMODE_David)
|
||||
WRITE_TO(raw, "%d", Javascript_paste_count);
|
||||
WRITE_TO(raw, "(");
|
||||
if (SET_javascript_paste_method == PASTEMODE_Andrew)
|
||||
if (indoc_settings->javascript_paste_method == PASTEMODE_Andrew)
|
||||
WRITE_TO(raw, "'%S\\n', '%S'", J_text, titling);
|
||||
WRITE_TO(raw, ")\">");
|
||||
if (SET_retina_images == 1) {
|
||||
if (indoc_settings->retina_images) {
|
||||
HTMLUtilities::image_element_scaled(raw, I"create@2x.png", 26, 13);
|
||||
} else {
|
||||
HTMLUtilities::image_element(raw, I"create.png");
|
||||
|
@ -452,8 +452,8 @@ see below.
|
|||
WRITE_TO(raw, " ");
|
||||
}
|
||||
WRITE_TO(raw, "%S", right);
|
||||
if ((SET_javascript == 1) &&
|
||||
(SET_javascript_paste_method == PASTEMODE_David)) {
|
||||
if ((indoc_settings->javascript) &&
|
||||
(indoc_settings->javascript_paste_method == PASTEMODE_David)) {
|
||||
HTMLUtilities::paste_script(OUT, J_text, Javascript_paste_count);
|
||||
HTMLUtilities::create_script(OUT, J_text, Javascript_paste_count, titling);
|
||||
}
|
||||
|
@ -611,10 +611,10 @@ which block is meant, and encode this as a link.
|
|||
=
|
||||
void Renderer::render_cross_reference(OUTPUT_STREAM,
|
||||
text_stream *sname, text_stream *reason, volume *V, int quieter) {
|
||||
if (SET_format == PLAIN_FORMAT)
|
||||
if (indoc_settings->format == PLAIN_FORMAT)
|
||||
WRITE("(See %S for %S.)\n", sname, reason);
|
||||
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
TEMPORARY_TEXT(dest);
|
||||
WRITE_TO(dest, "index.html");
|
||||
@<Identify the reference destination and be sure it exists@>;
|
||||
|
@ -662,23 +662,23 @@ text_stream *Renderer::formatted_file_must_be(OUTPUT_STREAM, volume *V, section
|
|||
OUT = ¤t_FTD_stream;
|
||||
if (Streams::open_to_file(OUT, S->section_filename, UTF8_ENC) == FALSE)
|
||||
Errors::fatal_with_file("can't write documentation", S->section_filename);
|
||||
if (SET_wrapper == WRAPPER_epub) {
|
||||
if (indoc_settings->wrapper == WRAPPER_epub) {
|
||||
ebook_page *page =
|
||||
Epub::note_page(SET_ebook, S->section_filename, S->section_file_title, I"");
|
||||
Epub::note_page(indoc_settings->ebook, S->section_filename, S->section_file_title, I"");
|
||||
if (S == V->sections[0]) {
|
||||
ebook_volume *ev = Epub::starts_volume(SET_ebook, page, V->vol_title);
|
||||
ebook_volume *ev = Epub::starts_volume(indoc_settings->ebook, page, V->vol_title);
|
||||
filename *F = Filenames::in_folder(indoc_settings->destination, V->vol_CSS_leafname);
|
||||
Epub::use_CSS(ev, F);
|
||||
}
|
||||
if (S->begins_which_chapter)
|
||||
S->begins_which_chapter->ebook_ref =
|
||||
Epub::starts_chapter(SET_ebook, page, S->begins_which_chapter->chapter_full_title, S->begins_which_chapter->chapter_URL);
|
||||
Epub::starts_chapter(indoc_settings->ebook, page, S->begins_which_chapter->chapter_full_title, S->begins_which_chapter->chapter_URL);
|
||||
}
|
||||
|
||||
formatted_file *ftd = CREATE(formatted_file);
|
||||
ftd->name = current_FTD_filename;
|
||||
|
||||
if (SET_format == HTML_FORMAT) @<Write the HTML header for the formatted file@>;
|
||||
if (indoc_settings->format == HTML_FORMAT) @<Write the HTML header for the formatted file@>;
|
||||
}
|
||||
return OUT;
|
||||
}
|
||||
|
@ -688,7 +688,7 @@ text_stream *Renderer::formatted_file_must_be(OUTPUT_STREAM, volume *V, section
|
|||
=
|
||||
text_stream *Renderer::close_formatted_file(OUTPUT_STREAM) {
|
||||
if (current_FTD_filename) {
|
||||
if (SET_format == HTML_FORMAT) @<Write the HTML footer for the formatted file@>;
|
||||
if (indoc_settings->format == HTML_FORMAT) @<Write the HTML footer for the formatted file@>;
|
||||
Streams::close(¤t_FTD_stream);
|
||||
current_FTD_filename = NULL;
|
||||
}
|
||||
|
@ -711,16 +711,16 @@ with a |<head>| we make ourselves.
|
|||
} else {
|
||||
HTMLUtilities::begin_file(OUT, V);
|
||||
HTMLUtilities::write_title(OUT, S->section_file_title);
|
||||
if (SET_javascript == 1) {
|
||||
if (indoc_settings->javascript) {
|
||||
HTML::open_javascript(OUT, FALSE);
|
||||
HTMLUtilities::write_javascript_for_buttons(OUT);
|
||||
HTML::close_javascript(OUT);
|
||||
}
|
||||
HTML::end_head(OUT);
|
||||
HTML::begin_body(OUT, "paper papertint");
|
||||
HTML::begin_body(OUT, I"paper papertint");
|
||||
}
|
||||
if ((SET_javascript == 1) &&
|
||||
(SET_javascript_paste_method == PASTEMODE_Andrew)) {
|
||||
if ((indoc_settings->javascript) &&
|
||||
(indoc_settings->javascript_paste_method == PASTEMODE_Andrew)) {
|
||||
HTMLUtilities::paste_script(OUT, NULL, 0);
|
||||
HTMLUtilities::create_script(OUT, NULL, 0, NULL);
|
||||
}
|
||||
|
|
|
@ -259,10 +259,10 @@ anchor is blank, the filename alone is used.
|
|||
|
||||
@<Work out section URLs and anchors, depending on granularity@> =
|
||||
char *extension = "txt";
|
||||
if (SET_format == HTML_FORMAT) extension = "html";
|
||||
if (indoc_settings->format == HTML_FORMAT) extension = "html";
|
||||
TEMPORARY_TEXT(leaf);
|
||||
if (indoc_settings->granularity == SECTION_GRANULARITY) {
|
||||
if (SET_html_for_Inform_application)
|
||||
if (indoc_settings->html_for_Inform_application)
|
||||
WRITE_TO(leaf, "%Sdoc%d.%s", sr->owner->vol_prefix, sr->s, extension);
|
||||
else
|
||||
WRITE_TO(leaf, "%S_%d_%d.%s", sr->owner->vol_abbrev, sr->ch, sr->chs, extension);
|
||||
|
|
|
@ -100,8 +100,8 @@ the Inform index-generator can use:
|
|||
void Updater::write_definitions_file(void) {
|
||||
text_stream DEFNS;
|
||||
text_stream *OUT = &DEFNS;
|
||||
if (Streams::open_to_file(OUT, SET_definitions_filename, UTF8_ENC) == FALSE)
|
||||
Errors::fatal_with_file("can't write definitions file", SET_definitions_filename);
|
||||
if (Streams::open_to_file(OUT, indoc_settings->definitions_filename, UTF8_ENC) == FALSE)
|
||||
Errors::fatal_with_file("can't write definitions file", indoc_settings->definitions_filename);
|
||||
formatted_file *ftd;
|
||||
LOOP_OVER(ftd, formatted_file) {
|
||||
definitions_helper_state dhs;
|
||||
|
|
|
@ -452,7 +452,7 @@ as it will be seen by the reader.
|
|||
|
||||
=
|
||||
void Indexes::write_general_index(void) {
|
||||
text_stream *OUT = IndexUtilities::open_page(I"General Index", SET_definitions_index_leafname);
|
||||
text_stream *OUT = IndexUtilities::open_page(I"General Index", indoc_settings->definitions_index_leafname);
|
||||
index_lemma **lemma_list =
|
||||
Memory::I7_calloc(NUMBER_CREATED(index_lemma), sizeof(index_lemma *), CLS_SORTING_MREASON);
|
||||
index_lemma *il;
|
||||
|
|
|
@ -9,8 +9,8 @@ text_stream index_stream;
|
|||
|
||||
text_stream *IndexUtilities::open_page(text_stream *title, text_stream *leafname) {
|
||||
filename *F = Filenames::in_folder(indoc_settings->destination, leafname);
|
||||
if (SET_wrapper == WRAPPER_epub)
|
||||
Epub::note_page(SET_ebook, F, title, I"index");
|
||||
if (indoc_settings->wrapper == WRAPPER_epub)
|
||||
Epub::note_page(indoc_settings->ebook, F, title, I"index");
|
||||
|
||||
text_stream *OUT = &index_stream;
|
||||
if (Streams::open_to_file(OUT, F, UTF8_ENC) == FALSE)
|
||||
|
@ -31,7 +31,7 @@ text_stream *IndexUtilities::open_page(text_stream *title, text_stream *leafname
|
|||
HTMLUtilities::begin_file(OUT, volumes[0]);
|
||||
HTMLUtilities::write_title(OUT, title);
|
||||
HTML::end_head(OUT);
|
||||
HTML::begin_body(OUT, "paper papertint");
|
||||
HTML::begin_body(OUT, I"paper papertint");
|
||||
}
|
||||
DISCARD_TEXT(head);
|
||||
|
||||
|
@ -137,7 +137,7 @@ void IndexUtilities::alphabet_row(OUTPUT_STREAM, int sequence) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (SET_navigation == NAVMODE_twilight) {
|
||||
if (indoc_settings->navigation->simplified_letter_rows) {
|
||||
HTML_OPEN("p");
|
||||
} else {
|
||||
HTML_OPEN_WITH("table", "class=\"fullwidth\"");
|
||||
|
@ -170,7 +170,7 @@ void IndexUtilities::alphabet_row(OUTPUT_STREAM, int sequence) {
|
|||
HTMLUtilities::general_link(OUT, I"letterlink", I"#X", I"X"); @<Between@>;
|
||||
HTMLUtilities::general_link(OUT, I"letterlink", I"#Y", I"Y"); @<Between@>;
|
||||
HTMLUtilities::general_link(OUT, I"letterlink", I"#Z", I"Z");
|
||||
if (SET_navigation == NAVMODE_twilight) {
|
||||
if (indoc_settings->navigation->simplified_letter_rows) {
|
||||
HTML_CLOSE("p");
|
||||
} else {
|
||||
HTML_CLOSE("td");
|
||||
|
@ -180,7 +180,7 @@ void IndexUtilities::alphabet_row(OUTPUT_STREAM, int sequence) {
|
|||
}
|
||||
|
||||
@<Between@> =
|
||||
if (SET_navigation == NAVMODE_twilight) WRITE(" / ");
|
||||
if (indoc_settings->navigation->simplified_letter_rows) WRITE(" / ");
|
||||
else {
|
||||
HTML_CLOSE("td");
|
||||
HTML_OPEN_WITH("td", "class=\"letterinrow\"");
|
||||
|
@ -192,7 +192,7 @@ in width and a longer text is supplied.
|
|||
|
||||
=
|
||||
void IndexUtilities::majuscule_heading(OUTPUT_STREAM, text_stream *display_text, int single_letter) {
|
||||
if (SET_navigation == NAVMODE_twilight) {
|
||||
if (indoc_settings->navigation->simplified_letter_rows) {
|
||||
if (single_letter == 1) { HTML::begin_div_with_class_S(OUT, I"majuscule"); }
|
||||
else { HTML::begin_div_with_class_S(OUT, I"stretchymajuscule"); }
|
||||
HTML_OPEN_WITH("span", "class=\"majusculelettering\"");
|
||||
|
|
|
@ -2,21 +2,29 @@
|
|||
|
||||
The "architect" style of navigational gadgets.
|
||||
|
||||
@h Top.
|
||||
At the front end of a section, before any of its text.
|
||||
|
||||
@h Creation.
|
||||
Architect doesn't have volume or chapter titles as such, since the banner
|
||||
heading includes these anyway.
|
||||
|
||||
=
|
||||
void Architect::architect_volume_title(OUTPUT_STREAM, volume *V) {
|
||||
navigation_design *Architect::create(void) {
|
||||
navigation_design *ND = Gadgets::new(I"architect", FALSE, FALSE);
|
||||
ND->columnar = TRUE;
|
||||
ND->contents_body_class = I"paper architectpapertint";
|
||||
METHOD_ADD(ND, RENDER_SECTION_TITLE_MTID, Architect::architect_section_title);
|
||||
METHOD_ADD(ND, RENDER_INDEX_TOP_MTID, Architect::architect_navigation_index_top);
|
||||
METHOD_ADD(ND, RENDER_NAV_MIDDLE_MTID, Architect::architect_navigation_middle);
|
||||
METHOD_ADD(ND, RENDER_NAV_BOTTOM_MTID, Architect::architect_navigation_bottom);
|
||||
METHOD_ADD(ND, RENDER_CONTENTS_MTID, Architect::architect_navigation_contents_files);
|
||||
METHOD_ADD(ND, RENDER_CONTENTS_HEADING_MTID, Architect::architect_navigation_contents_heading);
|
||||
return ND;
|
||||
}
|
||||
|
||||
void Architect::architect_chapter_title(OUTPUT_STREAM, volume *V, chapter *C) {
|
||||
}
|
||||
@h Top.
|
||||
At the front end of a section, before any of its text.
|
||||
|
||||
@ =
|
||||
void Architect::architect_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
||||
=
|
||||
void Architect::architect_section_title(navigation_design *self, text_stream *OUT, volume *V, chapter *C, section *S) {
|
||||
if (S->begins_which_chapter == NULL) {
|
||||
TEMPORARY_TEXT(comment);
|
||||
WRITE_TO(comment, "START IGNORE %d", S->number_within_volume);
|
||||
|
@ -48,7 +56,7 @@ void Architect::architect_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
|||
And this is a variant for index pages, such as the index of examples.
|
||||
|
||||
=
|
||||
void Architect::architect_navigation_index_top(OUTPUT_STREAM, text_stream *filename, text_stream *title) {
|
||||
void Architect::architect_navigation_index_top(navigation_design *self, text_stream *OUT, text_stream *filename, text_stream *title) {
|
||||
Architect::architect_banner(OUT, title, 0, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
@ -56,32 +64,16 @@ void Architect::architect_navigation_index_top(OUTPUT_STREAM, text_stream *filen
|
|||
At the middle part, when the text is over, but before any example cues.
|
||||
|
||||
=
|
||||
void Architect::architect_navigation_middle(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Architect::architect_navigation_middle(navigation_design *self, text_stream *OUT, volume *V, section *S) {
|
||||
HTMLUtilities::ruled_line(OUT);
|
||||
}
|
||||
|
||||
@h Example top.
|
||||
This is reached before the first example is rendered, provided at least
|
||||
one example will be:
|
||||
|
||||
=
|
||||
void Architect::architect_navigation_example_top(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Example bottom.
|
||||
Any closing ornament at the end of examples? This is reached after the
|
||||
last example is rendered, provided at least one example has been.
|
||||
|
||||
=
|
||||
void Architect::architect_navigation_example_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Bottom.
|
||||
At the end of the section, after any example cues and perhaps also example
|
||||
bodied. (In a section with no examples, this immediately follows the middle.)
|
||||
|
||||
=
|
||||
void Architect::architect_navigation_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Architect::architect_navigation_bottom(navigation_design *self, text_stream *OUT, volume *V, section *S) {
|
||||
HTML::begin_div_with_class_S(OUT, I"bookfooter");
|
||||
HTML_OPEN_WITH("table", "class=\"fullwidth\"");
|
||||
HTML_OPEN("tr");
|
||||
|
@ -114,7 +106,7 @@ These are the black, status-line-like banners with navigation icons at the
|
|||
top of every Architect page.
|
||||
|
||||
=
|
||||
void Architect::architect_banner(OUTPUT_STREAM, text_stream *title, volume *V,
|
||||
void Architect::architect_banner(text_stream *OUT, text_stream *title, volume *V,
|
||||
text_stream *linkcentre, text_stream *linkleft, text_stream *linkright) {
|
||||
HTML_OPEN_WITH("table", "class=\"fullwidth midnightblack\"");
|
||||
HTML_OPEN("tr");
|
||||
|
@ -181,6 +173,36 @@ void Architect::architect_contents_column_banner(OUTPUT_STREAM,
|
|||
Architect provides a contents page of its very own.
|
||||
|
||||
=
|
||||
void Architect::architect_navigation_contents_files(void) {
|
||||
Midnight::write_contents_page(volumes[0]);
|
||||
void Architect::architect_navigation_contents_files(navigation_design *self) {
|
||||
Midnight::write_contents_page(self, volumes[0]);
|
||||
}
|
||||
|
||||
void Architect::architect_navigation_contents_heading(navigation_design *self, text_stream *OUT, volume *V) {
|
||||
WRITE("\n\n");
|
||||
HTML_OPEN_WITH("table", "cellspacing=\"3\" border=\"0\" width=\"100%%\"");
|
||||
HTML_OPEN("tr");
|
||||
HTML_OPEN_WITH("td", "style=\"width:80px; height:120px;\"");
|
||||
HTML_TAG_WITH("img", "src=\"inform:/doc_images/wwi_cover@2x.png\" class=\"thinbordered\" style=\"width:80px; height:120px;\"");
|
||||
HTML_CLOSE("td");
|
||||
HTML_OPEN_WITH("td", "style=\"width:80px; height:120px;\"");
|
||||
HTML_TAG_WITH("img", "src=\"inform:/doc_images/irb_cover@2x.png\" class=\"thinbordered\" style=\"width:80px; height:120px;\"");
|
||||
HTML_CLOSE("td");
|
||||
HTML_OPEN_WITH("td", "style=\"width:100%%;\"");
|
||||
HTML_OPEN_WITH("div", "class=\"headingboxhigh\"");
|
||||
HTML_OPEN_WITH("div", "class=\"headingtext\"");
|
||||
WRITE("Documentation");
|
||||
HTML_CLOSE("div");
|
||||
HTML_OPEN_WITH("div", "class=\"headingrubric\"");
|
||||
WRITE("Two complete books about Inform:");
|
||||
HTML_OPEN("br");
|
||||
WRITE("<i>Writing with Inform</i>, a comprehensive introduction");
|
||||
HTML_OPEN("br");
|
||||
WRITE("<i>The Inform Recipe Book</i>, practical solutions for authors to use");
|
||||
HTML_CLOSE("div");
|
||||
HTML_CLOSE("div");
|
||||
HTML_CLOSE("td");
|
||||
HTML_CLOSE("tr");
|
||||
HTML_CLOSE("table");
|
||||
HTML_OPEN_WITH("table", "class=\"fullwidtharch\"");
|
||||
HTML_OPEN("tr");
|
||||
}
|
||||
|
|
|
@ -3,61 +3,24 @@
|
|||
The "lacuna" style of navigational gadgets, a plain text style with
|
||||
no navigational features at all.
|
||||
|
||||
@h Creation.
|
||||
|
||||
=
|
||||
navigation_design *Lacuna::create(void) {
|
||||
navigation_design *ND = Gadgets::new(I"lacuna", FALSE, TRUE);
|
||||
METHOD_ADD(ND, RENDER_CHAPTER_TITLE_MTID, Lacuna::lacuna_chapter_title);
|
||||
METHOD_ADD(ND, RENDER_SECTION_TITLE_MTID, Lacuna::lacuna_section_title);
|
||||
return ND;
|
||||
}
|
||||
|
||||
@h Top.
|
||||
At the front end of a section, before any of its text.
|
||||
|
||||
=
|
||||
void Lacuna::lacuna_volume_title(OUTPUT_STREAM, volume *V) {
|
||||
}
|
||||
|
||||
void Lacuna::lacuna_chapter_title(OUTPUT_STREAM, volume *V, chapter *C) {
|
||||
void Lacuna::lacuna_chapter_title(navigation_design *self, text_stream *OUT, volume *V, chapter *C) {
|
||||
WRITE("%S\n\n", C->chapter_full_title);
|
||||
}
|
||||
|
||||
void Lacuna::lacuna_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Lacuna::lacuna_section_title(navigation_design *self, text_stream *OUT, volume *V, chapter *C, section *S) {
|
||||
WRITE("\n%c%S\n\n", SECTION_SYMBOL, S->title);
|
||||
}
|
||||
|
||||
@h Index top.
|
||||
And this is a variant for index pages, such as the index of examples.
|
||||
|
||||
=
|
||||
void Lacuna::lacuna_navigation_index_top(OUTPUT_STREAM, text_stream *filename, text_stream *title) {
|
||||
}
|
||||
|
||||
@h Middle.
|
||||
At the middle part, when the text is over, but before any example cues.
|
||||
|
||||
=
|
||||
void Lacuna::lacuna_navigation_middle(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Example top.
|
||||
This is reached before the first example is rendered, provided at least
|
||||
one example will be:
|
||||
|
||||
=
|
||||
void Lacuna::lacuna_navigation_example_top(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Example bottom.
|
||||
Any closing ornament at the end of examples? This is reached after the
|
||||
last example is rendered, provided at least one example has been.
|
||||
|
||||
=
|
||||
void Lacuna::lacuna_navigation_example_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Bottom.
|
||||
At the end of the section, after any example cues and perhaps also example
|
||||
bodied. (In a section with no examples, this immediately follows the middle.)
|
||||
|
||||
=
|
||||
void Lacuna::lacuna_navigation_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Contents page.
|
||||
|
||||
=
|
||||
void Lacuna::lacuna_navigation_contents_files(void) {
|
||||
}
|
||||
|
|
|
@ -2,6 +2,21 @@
|
|||
|
||||
The "midnight" style of navigational gadgets.
|
||||
|
||||
@h Creation.
|
||||
|
||||
=
|
||||
navigation_design *Midnight::create(void) {
|
||||
navigation_design *ND = Gadgets::new(I"midnight", FALSE, FALSE);
|
||||
ND->columnar = TRUE;
|
||||
METHOD_ADD(ND, RENDER_SECTION_TITLE_MTID, Midnight::midnight_section_title);
|
||||
METHOD_ADD(ND, RENDER_INDEX_TOP_MTID, Midnight::midnight_navigation_index_top);
|
||||
METHOD_ADD(ND, RENDER_NAV_MIDDLE_MTID, Midnight::midnight_navigation_middle);
|
||||
METHOD_ADD(ND, RENDER_NAV_BOTTOM_MTID, Midnight::midnight_navigation_bottom);
|
||||
METHOD_ADD(ND, RENDER_CONTENTS_MTID, Midnight::midnight_navigation_contents_files);
|
||||
METHOD_ADD(ND, RENDER_CONTENTS_HEADING_MTID, Midnight::midnight_navigation_contents_heading);
|
||||
return ND;
|
||||
}
|
||||
|
||||
@h Top.
|
||||
At the front end of a section, before any of its text.
|
||||
|
||||
|
@ -9,14 +24,7 @@ Midnight doesn't have volume or chapter titles as such, since the banner
|
|||
heading includes these anyway.
|
||||
|
||||
=
|
||||
void Midnight::midnight_volume_title(OUTPUT_STREAM, volume *V) {
|
||||
}
|
||||
|
||||
void Midnight::midnight_chapter_title(OUTPUT_STREAM, volume *V, chapter *C) {
|
||||
}
|
||||
|
||||
@ =
|
||||
void Midnight::midnight_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Midnight::midnight_section_title(navigation_design *self, text_stream *OUT, volume *V, chapter *C, section *S) {
|
||||
if (S->begins_which_chapter == NULL) {
|
||||
TEMPORARY_TEXT(comment);
|
||||
WRITE_TO(comment, "START IGNORE %d", S->number_within_volume);
|
||||
|
@ -48,7 +56,7 @@ void Midnight::midnight_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
|||
And this is a variant for index pages, such as the index of examples.
|
||||
|
||||
=
|
||||
void Midnight::midnight_navigation_index_top(OUTPUT_STREAM, text_stream *filename, text_stream *title) {
|
||||
void Midnight::midnight_navigation_index_top(navigation_design *self, text_stream *OUT, text_stream *filename, text_stream *title) {
|
||||
Midnight::midnight_banner(OUT, title, 0, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
@ -56,32 +64,16 @@ void Midnight::midnight_navigation_index_top(OUTPUT_STREAM, text_stream *filenam
|
|||
At the middle part, when the text is over, but before any example cues.
|
||||
|
||||
=
|
||||
void Midnight::midnight_navigation_middle(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Midnight::midnight_navigation_middle(navigation_design *self, text_stream *OUT, volume *V, section *S) {
|
||||
HTMLUtilities::ruled_line(OUT);
|
||||
}
|
||||
|
||||
@h Example top.
|
||||
This is reached before the first example is rendered, provided at least
|
||||
one example will be:
|
||||
|
||||
=
|
||||
void Midnight::midnight_navigation_example_top(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Example bottom.
|
||||
Any closing ornament at the end of examples? This is reached after the
|
||||
last example is rendered, provided at least one example has been.
|
||||
|
||||
=
|
||||
void Midnight::midnight_navigation_example_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Bottom.
|
||||
At the end of the section, after any example cues and perhaps also example
|
||||
bodied. (In a section with no examples, this immediately follows the middle.)
|
||||
|
||||
=
|
||||
void Midnight::midnight_navigation_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Midnight::midnight_navigation_bottom(navigation_design *self, text_stream *OUT, volume *V, section *S) {
|
||||
HTML::begin_div_with_class_S(OUT, I"bookfooter");
|
||||
HTML_OPEN_WITH("table", "class=\"fullwidth\"");
|
||||
HTML_OPEN("tr");
|
||||
|
@ -174,8 +166,14 @@ void Midnight::midnight_contents_column_banner(OUTPUT_STREAM, text_stream *title
|
|||
Midnight provides a contents page of its very own.
|
||||
|
||||
=
|
||||
void Midnight::midnight_navigation_contents_files(void) {
|
||||
Midnight::write_contents_page(volumes[0]);
|
||||
void Midnight::midnight_navigation_contents_files(navigation_design *self) {
|
||||
Midnight::write_contents_page(self, volumes[0]);
|
||||
}
|
||||
|
||||
void Midnight::midnight_navigation_contents_heading(navigation_design *self, text_stream *OUT, volume *V) {
|
||||
WRITE("\n\n");
|
||||
HTML_OPEN_WITH("table", "class=\"fullwidth\"");
|
||||
HTML_OPEN("tr");
|
||||
}
|
||||
|
||||
@ Contents pages are only produced in some styles, and they're really index
|
||||
|
@ -184,7 +182,7 @@ the current volume; in heavy mode, it's a two-column table, with the contents
|
|||
of each volume side by side.
|
||||
|
||||
=
|
||||
void Midnight::write_contents_page(volume *V) {
|
||||
void Midnight::write_contents_page(navigation_design *self, volume *V) {
|
||||
TEMPORARY_TEXT(leafname);
|
||||
WRITE_TO(leafname, "%S%S.html", V->vol_prefix, indoc_settings->contents_leafname);
|
||||
filename *F = Filenames::in_folder(indoc_settings->destination, leafname);
|
||||
|
@ -193,20 +191,17 @@ void Midnight::write_contents_page(volume *V) {
|
|||
text_stream *OUT = &C_struct;
|
||||
if (Streams::open_to_file(OUT, F, UTF8_ENC) == FALSE)
|
||||
Errors::fatal_with_file("can't write contents file", F);
|
||||
if (SET_wrapper == WRAPPER_epub)
|
||||
Epub::note_page(SET_ebook, F, I"Contents", I"toc");
|
||||
if (indoc_settings->wrapper == WRAPPER_epub)
|
||||
Epub::note_page(indoc_settings->ebook, F, I"Contents", I"toc");
|
||||
|
||||
TEMPORARY_TEXT(title);
|
||||
WRITE_TO(title, "Contents");
|
||||
@<Begin the HTML page for the contents@>;
|
||||
@<Render any heading at the top of the contents@>;
|
||||
Gadgets::navigation_contents_heading(OUT, V);
|
||||
|
||||
for (int column = 0; column < no_volumes; column++) {
|
||||
if ((column == V->allocation_id) ||
|
||||
(SET_navigation == NAVMODE_midnight) ||
|
||||
(SET_navigation == NAVMODE_architect))
|
||||
for (int column = 0; column < no_volumes; column++)
|
||||
if ((column == V->allocation_id) || (self->columnar))
|
||||
@<Render this column of the contents@>;
|
||||
}
|
||||
@<Render any tailpiece at the foot of the contents@>;
|
||||
|
||||
@<End the HTML page for the contents@>;
|
||||
|
@ -229,19 +224,14 @@ void Midnight::write_contents_page(volume *V) {
|
|||
} else {
|
||||
HTMLUtilities::begin_file(OUT, volumes[0]);
|
||||
HTMLUtilities::write_title(OUT, title);
|
||||
if (SET_javascript == 1) {
|
||||
if (indoc_settings->javascript) {
|
||||
HTML::open_javascript(OUT, FALSE);
|
||||
HTMLUtilities::write_javascript_for_buttons(OUT);
|
||||
HTMLUtilities::write_javascript_for_contents_buttons(OUT);
|
||||
HTML::close_javascript(OUT);
|
||||
}
|
||||
HTML::end_head(OUT);
|
||||
|
||||
if (SET_navigation == NAVMODE_architect) {
|
||||
HTML::begin_body(OUT, "paper architectpapertint");
|
||||
} else {
|
||||
HTML::begin_body(OUT, "paper midnightpapertint");
|
||||
}
|
||||
HTML::begin_body(OUT, self->contents_body_class);
|
||||
}
|
||||
DISCARD_TEXT(xxx);
|
||||
|
||||
|
@ -252,47 +242,8 @@ void Midnight::write_contents_page(volume *V) {
|
|||
else HTML::end_body(OUT);
|
||||
DISCARD_TEXT(tail);
|
||||
|
||||
@<Render any heading at the top of the contents@> =
|
||||
if (SET_navigation == NAVMODE_midnight) {
|
||||
WRITE("\n\n");
|
||||
HTML_OPEN_WITH("table", "class=\"fullwidth\"");
|
||||
HTML_OPEN("tr");
|
||||
} else if (SET_navigation == NAVMODE_architect) {
|
||||
WRITE("\n\n");
|
||||
HTML_OPEN_WITH("table", "cellspacing=\"3\" border=\"0\" width=\"100%%\"");
|
||||
HTML_OPEN("tr");
|
||||
HTML_OPEN_WITH("td", "style=\"width:80px; height:120px;\"");
|
||||
HTML_TAG_WITH("img", "src=\"inform:/doc_images/wwi_cover@2x.png\" class=\"thinbordered\" style=\"width:80px; height:120px;\"");
|
||||
HTML_CLOSE("td");
|
||||
HTML_OPEN_WITH("td", "style=\"width:80px; height:120px;\"");
|
||||
HTML_TAG_WITH("img", "src=\"inform:/doc_images/irb_cover@2x.png\" class=\"thinbordered\" style=\"width:80px; height:120px;\"");
|
||||
HTML_CLOSE("td");
|
||||
HTML_OPEN_WITH("td", "style=\"width:100%%;\"");
|
||||
HTML_OPEN_WITH("div", "class=\"headingboxhigh\"");
|
||||
HTML_OPEN_WITH("div", "class=\"headingtext\"");
|
||||
WRITE("Documentation");
|
||||
HTML_CLOSE("div");
|
||||
HTML_OPEN_WITH("div", "class=\"headingrubric\"");
|
||||
WRITE("Two complete books about Inform:");
|
||||
HTML_OPEN("br");
|
||||
WRITE("<i>Writing with Inform</i>, a comprehensive introduction");
|
||||
HTML_OPEN("br");
|
||||
WRITE("<i>The Inform Recipe Book</i>, practical solutions for authors to use");
|
||||
HTML_CLOSE("div");
|
||||
HTML_CLOSE("div");
|
||||
HTML_CLOSE("td");
|
||||
HTML_CLOSE("tr");
|
||||
HTML_CLOSE("table");
|
||||
HTML_OPEN_WITH("table", "class=\"fullwidtharch\"");
|
||||
HTML_OPEN("tr");
|
||||
} else {
|
||||
HTML_OPEN("h2");
|
||||
WRITE("%S", V->vol_title);
|
||||
HTML_CLOSE("h2");
|
||||
}
|
||||
|
||||
@<Render this column of the contents@> =
|
||||
if ((SET_navigation == NAVMODE_midnight) || (SET_navigation == NAVMODE_architect)) {
|
||||
if (self->columnar) {
|
||||
if (no_volumes == 1) HTML_OPEN("td")
|
||||
else if (column == 0) HTML_OPEN_WITH("td", "class=\"midnightlefthalfpage\"")
|
||||
else HTML_OPEN_WITH("td", "class=\"midnightrighthalfpage\"");
|
||||
|
@ -318,13 +269,13 @@ void Midnight::write_contents_page(volume *V) {
|
|||
HTML_TAG("br");
|
||||
}
|
||||
|
||||
if (SET_html_for_Inform_application)
|
||||
HTMLUtilities::textual_link(OUT, SET_link_to_extensions_index, I"Installed Extensions");
|
||||
if (indoc_settings->html_for_Inform_application)
|
||||
HTMLUtilities::textual_link(OUT, indoc_settings->link_to_extensions_index, I"Installed Extensions");
|
||||
HTMLUtilities::textual_link(OUT, indoc_settings->examples_alphabetical_leafname, I"Alphabetical Index of Examples");
|
||||
HTMLUtilities::textual_link(OUT, indoc_settings->examples_numerical_leafname, I"Numerical Index of Examples");
|
||||
HTMLUtilities::textual_link(OUT, indoc_settings->examples_thematic_leafname, I"Thematic Index of Examples");
|
||||
if (NUMBER_CREATED(index_lemma) > 0)
|
||||
HTMLUtilities::textual_link(OUT, SET_definitions_index_leafname, I"General Index");
|
||||
HTMLUtilities::textual_link(OUT, indoc_settings->definitions_index_leafname, I"General Index");
|
||||
|
||||
volume *OV = volumes[0];
|
||||
if (V == volumes[0]) OV = volumes[1];
|
||||
|
@ -364,14 +315,14 @@ there are in practice about 25.
|
|||
HTML::end_div(OUT);
|
||||
}
|
||||
if ((column == no_volumes - 1) &&
|
||||
(SET_html_for_Inform_application == 0) &&
|
||||
(indoc_settings->html_for_Inform_application == FALSE) &&
|
||||
(no_examples > 0)) {
|
||||
HTML_OPEN_WITH("p", "class=\"midnightcontentsA\"");
|
||||
WRITE("<i>Index</i>");
|
||||
HTML_CLOSE("p");
|
||||
@<Render links to example indexes@>;
|
||||
}
|
||||
if (SET_html_for_Inform_application == 1) {
|
||||
if (indoc_settings->html_for_Inform_application) {
|
||||
if (column == 0) {
|
||||
Midnight::mc_link_A(OUT, indoc_settings->examples_numerical_leafname, I"Numerical Index of Examples");
|
||||
} else {
|
||||
|
@ -417,14 +368,14 @@ done with a second row of the table whose first row contains the chapter
|
|||
contents cells.
|
||||
|
||||
@<Render any tailpiece at the foot of the contents@> =
|
||||
if ((SET_navigation == NAVMODE_midnight) || (SET_navigation == NAVMODE_architect)) {
|
||||
if (self->columnar) {
|
||||
HTML_CLOSE("tr");
|
||||
|
||||
if ((SET_assume_Public_Library == 0) && (SET_html_for_Inform_application == 1)) {
|
||||
if ((indoc_settings->assume_Public_Library == FALSE) && (indoc_settings->html_for_Inform_application)) {
|
||||
HTML_OPEN("tr");
|
||||
HTML_OPEN_WITH("td", "class=\"midnightlefthalfpage\"");
|
||||
Midnight::midnight_contents_column_banner(OUT, I"Extensions", volumes[0], NULL);
|
||||
Midnight::mc_link_A(OUT, SET_link_to_extensions_index, I"Installed Extensions");
|
||||
Midnight::mc_link_A(OUT, indoc_settings->link_to_extensions_index, I"Installed Extensions");
|
||||
|
||||
HTML_OPEN_WITH("p", "class=\"midnightcontentsA\"");
|
||||
WRITE("<i>for more extensions, visit:</i>");
|
||||
|
@ -441,7 +392,7 @@ contents cells.
|
|||
Midnight::midnight_contents_column_banner(OUT, NULL, volumes[1], NULL);
|
||||
}
|
||||
if (NUMBER_CREATED(index_lemma) > 0) {
|
||||
Midnight::mc_link_A(OUT, SET_definitions_index_leafname, I"General Index");
|
||||
Midnight::mc_link_A(OUT, indoc_settings->definitions_index_leafname, I"General Index");
|
||||
}
|
||||
HTML_CLOSE("td");
|
||||
HTML_CLOSE("tr");
|
||||
|
|
|
@ -2,11 +2,25 @@
|
|||
|
||||
The "roadsign" style of navigational gadgets.
|
||||
|
||||
@h Creation.
|
||||
|
||||
=
|
||||
navigation_design *Roadsign::create(void) {
|
||||
navigation_design *ND = Gadgets::new(I"roadsign", TRUE, FALSE);
|
||||
METHOD_ADD(ND, RENDER_VOLUME_TITLE_MTID, Roadsign::roadsign_volume_title);
|
||||
METHOD_ADD(ND, RENDER_CHAPTER_TITLE_MTID, Roadsign::roadsign_chapter_title);
|
||||
METHOD_ADD(ND, RENDER_SECTION_TITLE_MTID, Roadsign::roadsign_section_title);
|
||||
METHOD_ADD(ND, RENDER_INDEX_TOP_MTID, Roadsign::roadsign_navigation_index_top);
|
||||
METHOD_ADD(ND, RENDER_NAV_MIDDLE_MTID, Roadsign::roadsign_navigation_middle);
|
||||
METHOD_ADD(ND, RENDER_EXAMPLE_TOP_MTID, Roadsign::roadsign_navigation_example_top);
|
||||
return ND;
|
||||
}
|
||||
|
||||
@h Top.
|
||||
At the front end of a section, before any of its text.
|
||||
|
||||
=
|
||||
void Roadsign::roadsign_volume_title(OUTPUT_STREAM, volume *V) {
|
||||
void Roadsign::roadsign_volume_title(navigation_design *self, text_stream *OUT, volume *V) {
|
||||
@<Render a volume heading@>;
|
||||
@<Render a chapter-contents table@>;
|
||||
HTML_OPEN("p"); HTML_CLOSE("p");
|
||||
|
@ -85,12 +99,12 @@ void Roadsign::roadsign_volume_title(OUTPUT_STREAM, volume *V) {
|
|||
I"Indexes of the examples", indoc_settings->examples_alphabetical_leafname);
|
||||
} else if (NUMBER_CREATED(index_lemma) > 0) {
|
||||
Roadsign::roadsign_add_direction(OUT, I"arrow-down-right.png",
|
||||
I"Index of definitions", SET_definitions_index_leafname);
|
||||
I"Index of definitions", indoc_settings->definitions_index_leafname);
|
||||
}
|
||||
Roadsign::roadsign_end(OUT, 1);
|
||||
|
||||
@ =
|
||||
void Roadsign::roadsign_chapter_title(OUTPUT_STREAM, volume *V, chapter *C) {
|
||||
void Roadsign::roadsign_chapter_title(navigation_design *self, text_stream *OUT, volume *V, chapter *C) {
|
||||
@<Render a chapter heading@>;
|
||||
@<Render a section-contents listing@>;
|
||||
Roadsign::roadsign_chapter_jumps(OUT, V, C, 0);
|
||||
|
@ -117,7 +131,7 @@ void Roadsign::roadsign_chapter_title(OUTPUT_STREAM, volume *V, chapter *C) {
|
|||
HTML_CLOSE("p");
|
||||
|
||||
@ =
|
||||
void Roadsign::roadsign_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Roadsign::roadsign_section_title(navigation_design *self, text_stream *OUT, volume *V, chapter *C, section *S) {
|
||||
HTML_OPEN_WITH("p", "class=\"sectionheading\"");
|
||||
if (Str::len(S->section_anchor) > 0) HTML::anchor(OUT, S->section_anchor);
|
||||
WRITE("%c%S", SECTION_SYMBOL, S->title);
|
||||
|
@ -128,7 +142,7 @@ void Roadsign::roadsign_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
|||
And this is a variant for index pages, such as the index of examples.
|
||||
|
||||
=
|
||||
void Roadsign::roadsign_navigation_index_top(OUTPUT_STREAM, text_stream *filename, text_stream *title) {
|
||||
void Roadsign::roadsign_navigation_index_top(navigation_design *self, text_stream *OUT, text_stream *filename, text_stream *title) {
|
||||
HTML_OPEN_WITH("p", "class=\"chapterheading\"");
|
||||
WRITE("%S", title);
|
||||
HTML_CLOSE("p");
|
||||
|
@ -145,9 +159,9 @@ void Roadsign::roadsign_navigation_index_top(OUTPUT_STREAM, text_stream *filenam
|
|||
I"Examples in Numerical Order", indoc_settings->examples_numerical_leafname);
|
||||
}
|
||||
if (NUMBER_CREATED(index_lemma) > 0)
|
||||
if (Str::ne(filename, SET_definitions_index_leafname))
|
||||
if (Str::ne(filename, indoc_settings->definitions_index_leafname))
|
||||
Roadsign::roadsign_add_direction(OUT, I"arrow-right.png",
|
||||
I"General Index", SET_definitions_index_leafname);
|
||||
I"General Index", indoc_settings->definitions_index_leafname);
|
||||
|
||||
for (int v = 0; v < no_volumes; v++) {
|
||||
volume *V = volumes[v];
|
||||
|
@ -167,7 +181,7 @@ void Roadsign::roadsign_navigation_index_top(OUTPUT_STREAM, text_stream *filenam
|
|||
At the middle part, when the text is over, but before any example cues.
|
||||
|
||||
=
|
||||
void Roadsign::roadsign_navigation_middle(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Roadsign::roadsign_navigation_middle(navigation_design *self, text_stream *OUT, volume *V, section *S) {
|
||||
HTMLUtilities::ruled_line(OUT);
|
||||
HTML::begin_div_with_class_S(OUT, I"roadsigns");
|
||||
chapter *C = S->in_which_chapter;
|
||||
|
@ -236,34 +250,11 @@ This is reached before the first example is rendered, provided at least
|
|||
one example will be:
|
||||
|
||||
=
|
||||
void Roadsign::roadsign_navigation_example_top(OUTPUT_STREAM, volume *V, section *S) {
|
||||
if (indoc_settings->examples_granularity == 2)
|
||||
void Roadsign::roadsign_navigation_example_top(navigation_design *self, text_stream *OUT, volume *V, section *S) {
|
||||
if (indoc_settings->examples_granularity == CHAPTER_GRANULARITY)
|
||||
Roadsign::roadsign_chapter_jumps(OUT, V, S->in_which_chapter, TRUE);
|
||||
}
|
||||
|
||||
@h Example bottom.
|
||||
Any closing ornament at the end of examples? This is reached after the
|
||||
last example is rendered, provided at least one example has been.
|
||||
|
||||
=
|
||||
void Roadsign::roadsign_navigation_example_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Bottom.
|
||||
At the end of the section, after any example cues and perhaps also example
|
||||
bodied. (In a section with no examples, this immediately follows the middle.)
|
||||
|
||||
=
|
||||
void Roadsign::roadsign_navigation_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Contents page.
|
||||
Roadsign doesn't use a standalone contents page.
|
||||
|
||||
=
|
||||
void Roadsign::roadsign_navigation_contents_files(void) {
|
||||
}
|
||||
|
||||
@h Utility routines.
|
||||
|
||||
=
|
||||
|
|
|
@ -3,21 +3,35 @@
|
|||
The "twilight" style of navigational gadgets, a minimal version
|
||||
of "midnight".
|
||||
|
||||
@h Creation.
|
||||
|
||||
=
|
||||
navigation_design *Twilight::create(void) {
|
||||
navigation_design *ND = Gadgets::new(I"twilight", FALSE, FALSE);
|
||||
ND->simplified_examples = TRUE;
|
||||
ND->simplified_letter_rows = TRUE;
|
||||
METHOD_ADD(ND, RENDER_CHAPTER_TITLE_MTID, Twilight::twilight_chapter_title);
|
||||
METHOD_ADD(ND, RENDER_SECTION_TITLE_MTID, Twilight::twilight_section_title);
|
||||
METHOD_ADD(ND, RENDER_INDEX_TOP_MTID, Twilight::twilight_navigation_index_top);
|
||||
METHOD_ADD(ND, RENDER_NAV_MIDDLE_MTID, Twilight::twilight_navigation_middle);
|
||||
METHOD_ADD(ND, RENDER_NAV_BOTTOM_MTID, Twilight::twilight_navigation_bottom);
|
||||
METHOD_ADD(ND, RENDER_CONTENTS_MTID, Twilight::twilight_navigation_contents_files);
|
||||
METHOD_ADD(ND, RENDER_CONTENTS_HEADING_MTID, Twilight::twilight_navigation_contents_heading);
|
||||
return ND;
|
||||
}
|
||||
|
||||
@h Top.
|
||||
At the front end of a section, before any of its text.
|
||||
|
||||
=
|
||||
void Twilight::twilight_volume_title(OUTPUT_STREAM, volume *V) {
|
||||
}
|
||||
|
||||
void Twilight::twilight_chapter_title(OUTPUT_STREAM, volume *V, chapter *C) {
|
||||
void Twilight::twilight_chapter_title(navigation_design *self, text_stream *OUT, volume *V, chapter *C) {
|
||||
HTML_OPEN("h2");
|
||||
WRITE("%S", C->chapter_full_title);
|
||||
HTML_CLOSE("h2");
|
||||
}
|
||||
|
||||
@ =
|
||||
void Twilight::twilight_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Twilight::twilight_section_title(navigation_design *self, text_stream *OUT, volume *V, chapter *C, section *S) {
|
||||
HTML::begin_div_with_class_S(OUT, I"bookheader");
|
||||
HTML_OPEN_WITH("table", "width=\"100%%\"");
|
||||
HTML_OPEN("tr");
|
||||
|
@ -60,7 +74,7 @@ void Twilight::twilight_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
|||
And this is a variant for index pages, such as the index of examples.
|
||||
|
||||
=
|
||||
void Twilight::twilight_navigation_index_top(OUTPUT_STREAM, text_stream *filename, text_stream *title) {
|
||||
void Twilight::twilight_navigation_index_top(navigation_design *self, text_stream *OUT, text_stream *filename, text_stream *title) {
|
||||
HTML_OPEN("h2");
|
||||
WRITE("%S", title);
|
||||
HTML_CLOSE("h2");
|
||||
|
@ -70,32 +84,16 @@ void Twilight::twilight_navigation_index_top(OUTPUT_STREAM, text_stream *filenam
|
|||
At the middle part, when the text is over, but before any example cues.
|
||||
|
||||
=
|
||||
void Twilight::twilight_navigation_middle(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Twilight::twilight_navigation_middle(navigation_design *self, text_stream *OUT, volume *V, section *S) {
|
||||
HTMLUtilities::ruled_line(OUT);
|
||||
}
|
||||
|
||||
@h Example top.
|
||||
This is reached before the first example is rendered, provided at least
|
||||
one example will be:
|
||||
|
||||
=
|
||||
void Twilight::twilight_navigation_example_top(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Example bottom.
|
||||
Any closing ornament at the end of examples? This is reached after the
|
||||
last example is rendered, provided at least one example has been.
|
||||
|
||||
=
|
||||
void Twilight::twilight_navigation_example_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Bottom.
|
||||
At the end of the section, after any example cues and perhaps also example
|
||||
bodied. (In a section with no examples, this immediately follows the middle.)
|
||||
|
||||
=
|
||||
void Twilight::twilight_navigation_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Twilight::twilight_navigation_bottom(navigation_design *self, text_stream *OUT, volume *V, section *S) {
|
||||
HTML::begin_div_with_class_S(OUT, I"bookfooter");
|
||||
HTML_OPEN("p");
|
||||
if (S->previous_section) {
|
||||
|
@ -118,8 +116,14 @@ void Twilight::twilight_navigation_bottom(OUTPUT_STREAM, volume *V, section *S)
|
|||
Twilight provides a contents page of its very own: actually, several.
|
||||
|
||||
=
|
||||
void Twilight::twilight_navigation_contents_files(void) {
|
||||
void Twilight::twilight_navigation_contents_files(navigation_design *self) {
|
||||
volume *V;
|
||||
LOOP_OVER(V, volume)
|
||||
Midnight::write_contents_page(V);
|
||||
Midnight::write_contents_page(self, V);
|
||||
}
|
||||
|
||||
void Twilight::twilight_navigation_contents_heading(navigation_design *self, text_stream *OUT, volume *V) {
|
||||
HTML_OPEN("h2");
|
||||
WRITE("%S", V->vol_title);
|
||||
HTML_CLOSE("h2");
|
||||
}
|
||||
|
|
|
@ -2,11 +2,24 @@
|
|||
|
||||
The "unsigned" style of navigational gadgets.
|
||||
|
||||
@h Creation.
|
||||
|
||||
=
|
||||
navigation_design *Unsigned::create(void) {
|
||||
navigation_design *ND = Gadgets::new(I"unsigned", TRUE, FALSE);
|
||||
METHOD_ADD(ND, RENDER_VOLUME_TITLE_MTID, Unsigned::unsigned_volume_title);
|
||||
METHOD_ADD(ND, RENDER_CHAPTER_TITLE_MTID, Unsigned::unsigned_chapter_title);
|
||||
METHOD_ADD(ND, RENDER_SECTION_TITLE_MTID, Unsigned::unsigned_section_title);
|
||||
METHOD_ADD(ND, RENDER_INDEX_TOP_MTID, Unsigned::unsigned_navigation_index_top);
|
||||
METHOD_ADD(ND, RENDER_NAV_MIDDLE_MTID, Unsigned::unsigned_navigation_middle);
|
||||
return ND;
|
||||
}
|
||||
|
||||
@h Top.
|
||||
At the front end of a section, before any of its text.
|
||||
|
||||
=
|
||||
void Unsigned::unsigned_volume_title(OUTPUT_STREAM, volume *V) {
|
||||
void Unsigned::unsigned_volume_title(navigation_design *self, text_stream *OUT, volume *V) {
|
||||
@<Render a volume heading@>;
|
||||
@<Render a chapter-contents table@>;
|
||||
}
|
||||
|
@ -32,7 +45,7 @@ void Unsigned::unsigned_volume_title(OUTPUT_STREAM, volume *V) {
|
|||
}
|
||||
|
||||
@ =
|
||||
void Unsigned::unsigned_chapter_title(OUTPUT_STREAM, volume *V, chapter *C) {
|
||||
void Unsigned::unsigned_chapter_title(navigation_design *self, text_stream *OUT, volume *V, chapter *C) {
|
||||
@<Render a chapter heading@>;
|
||||
@<Render a section-contents listing@>;
|
||||
}
|
||||
|
@ -59,7 +72,7 @@ void Unsigned::unsigned_chapter_title(OUTPUT_STREAM, volume *V, chapter *C) {
|
|||
HTML_CLOSE("p");
|
||||
|
||||
@ =
|
||||
void Unsigned::unsigned_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Unsigned::unsigned_section_title(navigation_design *self, text_stream *OUT, volume *V, chapter *C, section *S) {
|
||||
HTML_OPEN_WITH("p", "class=\"sectionheading\"");
|
||||
if (Str::len(S->section_anchor) > 0) HTML::anchor(OUT, S->section_anchor);
|
||||
WRITE("%c%S", SECTION_SYMBOL, S->title);
|
||||
|
@ -70,7 +83,7 @@ void Unsigned::unsigned_section_title(OUTPUT_STREAM, volume *V, section *S) {
|
|||
And this is a variant for index pages, such as the index of examples.
|
||||
|
||||
=
|
||||
void Unsigned::unsigned_navigation_index_top(OUTPUT_STREAM, text_stream *filename, text_stream *title) {
|
||||
void Unsigned::unsigned_navigation_index_top(navigation_design *self, text_stream *OUT, text_stream *filename, text_stream *title) {
|
||||
HTMLUtilities::ruled_line(OUT);
|
||||
}
|
||||
|
||||
|
@ -78,37 +91,6 @@ void Unsigned::unsigned_navigation_index_top(OUTPUT_STREAM, text_stream *filenam
|
|||
At the middle part, when the text is over, but before any example cues.
|
||||
|
||||
=
|
||||
void Unsigned::unsigned_navigation_middle(OUTPUT_STREAM, volume *V, section *S) {
|
||||
void Unsigned::unsigned_navigation_middle(navigation_design *self, text_stream *OUT, volume *V, section *S) {
|
||||
HTMLUtilities::ruled_line(OUT);
|
||||
}
|
||||
|
||||
@h Example top.
|
||||
This is reached before the first example is rendered, provided at least
|
||||
one example will be:
|
||||
|
||||
=
|
||||
void Unsigned::unsigned_navigation_example_top(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Example bottom.
|
||||
Any closing ornament at the end of examples? This is reached after the
|
||||
last example is rendered, provided at least one example has been.
|
||||
|
||||
=
|
||||
void Unsigned::unsigned_navigation_example_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Bottom.
|
||||
At the end of the section, after any example cues and perhaps also example
|
||||
bodied. (In a section with no examples, this immediately follows the middle.)
|
||||
|
||||
=
|
||||
void Unsigned::unsigned_navigation_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
}
|
||||
|
||||
@h Contents page.
|
||||
Roadsign doesn't use a standalone contents page.
|
||||
|
||||
=
|
||||
void Unsigned::unsigned_navigation_contents_files(void) {
|
||||
}
|
||||
|
|
|
@ -3,20 +3,95 @@
|
|||
To render linking gadgets in HTML forms of documentation, so that
|
||||
the reader can navigate from section to section.
|
||||
|
||||
@h
|
||||
|
||||
=
|
||||
typedef struct navigation_design {
|
||||
struct text_stream *codename;
|
||||
int ebook_friendly;
|
||||
int plain_friendly;
|
||||
int columnar;
|
||||
int simplified_examples;
|
||||
int simplified_letter_rows;
|
||||
struct text_stream *contents_body_class;
|
||||
METHOD_CALLS
|
||||
MEMORY_MANAGEMENT
|
||||
} navigation_design;
|
||||
|
||||
navigation_design *Gadgets::new(text_stream *code, int e, int p) {
|
||||
navigation_design *ND = CREATE(navigation_design);
|
||||
ND->codename = Str::duplicate(code);
|
||||
ND->ebook_friendly = e;
|
||||
ND->plain_friendly = p;
|
||||
ND->columnar = FALSE;
|
||||
ND->simplified_examples = FALSE;
|
||||
ND->simplified_letter_rows = FALSE;
|
||||
ND->contents_body_class = I"paper midnightpapertint";
|
||||
ND->methods = Methods::new_set();
|
||||
return ND;
|
||||
}
|
||||
|
||||
void Gadgets::start(void) {
|
||||
Midnight::create(); /* needs to be created first */
|
||||
Twilight::create();
|
||||
Architect::create();
|
||||
Roadsign::create(); /* needs to be created before unsigned */
|
||||
Unsigned::create();
|
||||
Lacuna::create();
|
||||
}
|
||||
|
||||
navigation_design *Gadgets::default(void) {
|
||||
return FIRST_OBJECT(navigation_design);
|
||||
}
|
||||
|
||||
navigation_design *Gadgets::for_ebook(navigation_design *current) {
|
||||
if (current->ebook_friendly) return current;
|
||||
navigation_design *ND;
|
||||
LOOP_OVER(ND, navigation_design)
|
||||
if (ND->ebook_friendly)
|
||||
return ND;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
navigation_design *Gadgets::for_plain_text(navigation_design *current) {
|
||||
if (current->plain_friendly) return current;
|
||||
navigation_design *ND;
|
||||
LOOP_OVER(ND, navigation_design)
|
||||
if (ND->plain_friendly)
|
||||
return ND;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
navigation_design *Gadgets::parse(text_stream *val) {
|
||||
navigation_design *ND;
|
||||
LOOP_OVER(ND, navigation_design)
|
||||
if (Str::eq(val, ND->codename))
|
||||
return ND;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@h Top.
|
||||
At the front end of a section, before any of its text.
|
||||
|
||||
@e RENDER_VOLUME_TITLE_MTID
|
||||
@e RENDER_CHAPTER_TITLE_MTID
|
||||
@e RENDER_SECTION_TITLE_MTID
|
||||
|
||||
=
|
||||
VMETHOD_TYPE(RENDER_VOLUME_TITLE_MTID, navigation_design *ND, text_stream *OUT, volume *V)
|
||||
VMETHOD_TYPE(RENDER_CHAPTER_TITLE_MTID, navigation_design *ND, text_stream *OUT, volume *V, chapter *C)
|
||||
VMETHOD_TYPE(RENDER_SECTION_TITLE_MTID, navigation_design *ND, text_stream *OUT, volume *V, chapter *C, section *S)
|
||||
|
||||
void Gadgets::render_navigation_top(OUTPUT_STREAM, volume *V, section *S) {
|
||||
if (V->sections[0] == S) @<Render the volume title@>;
|
||||
if (V->sections[0] == S) VMETHOD_CALL(indoc_settings->navigation, RENDER_VOLUME_TITLE_MTID, OUT, V);
|
||||
|
||||
chapter *C = S->begins_which_chapter;
|
||||
if (C) @<Render the chapter title@>;
|
||||
if (C) VMETHOD_CALL(indoc_settings->navigation, RENDER_CHAPTER_TITLE_MTID, OUT, V, C);
|
||||
|
||||
if (SET_html_for_Inform_application)
|
||||
if (indoc_settings->html_for_Inform_application)
|
||||
@<Write HTML comments giving the Inform user interface search assistance@>;
|
||||
|
||||
@<Render the section title@>;
|
||||
VMETHOD_CALL(indoc_settings->navigation, RENDER_SECTION_TITLE_MTID, OUT, V, C, S);
|
||||
}
|
||||
|
||||
@<Write HTML comments giving the Inform user interface search assistance@> =
|
||||
|
@ -32,99 +107,42 @@ void Gadgets::render_navigation_top(OUTPUT_STREAM, volume *V, section *S) {
|
|||
HTML::comment(OUT, comment);
|
||||
DISCARD_TEXT(comment);
|
||||
|
||||
@<Render the volume title@> =
|
||||
if (SET_navigation == NAVMODE_midnight) {
|
||||
Midnight::midnight_volume_title(OUT, V);
|
||||
} else if (SET_navigation == NAVMODE_architect) {
|
||||
Architect::architect_volume_title(OUT, V);
|
||||
} else if (SET_navigation == NAVMODE_twilight) {
|
||||
Twilight::twilight_volume_title(OUT, V);
|
||||
} else if (SET_navigation == NAVMODE_roadsign) {
|
||||
Roadsign::roadsign_volume_title(OUT, V);
|
||||
} else if (SET_navigation == NAVMODE_unsigned) {
|
||||
Unsigned::unsigned_volume_title(OUT, V);
|
||||
} else if (SET_navigation == NAVMODE_lacuna) {
|
||||
Lacuna::lacuna_volume_title(OUT, V);
|
||||
}
|
||||
|
||||
@<Render the chapter title@> =
|
||||
if (SET_navigation == NAVMODE_midnight) {
|
||||
Midnight::midnight_chapter_title(OUT, V, C);
|
||||
} else if (SET_navigation == NAVMODE_architect) {
|
||||
Architect::architect_chapter_title(OUT, V, C);
|
||||
} else if (SET_navigation == NAVMODE_twilight) {
|
||||
Twilight::twilight_chapter_title(OUT, V, C);
|
||||
} else if (SET_navigation == NAVMODE_roadsign) {
|
||||
Roadsign::roadsign_chapter_title(OUT, V, C);
|
||||
} else if (SET_navigation == NAVMODE_unsigned) {
|
||||
Unsigned::unsigned_chapter_title(OUT, V, C);
|
||||
} else if (SET_navigation == NAVMODE_lacuna) {
|
||||
Lacuna::lacuna_chapter_title(OUT, V, C);
|
||||
}
|
||||
|
||||
@<Render the section title@> =
|
||||
if (SET_navigation == NAVMODE_midnight) {
|
||||
Midnight::midnight_section_title(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_architect) {
|
||||
Architect::architect_section_title(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_twilight) {
|
||||
Twilight::twilight_section_title(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_roadsign) {
|
||||
Roadsign::roadsign_section_title(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_unsigned) {
|
||||
Unsigned::unsigned_section_title(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_lacuna) {
|
||||
Lacuna::lacuna_section_title(OUT, V, S);
|
||||
}
|
||||
|
||||
@h Index top.
|
||||
And this is a variant for index pages, such as the index of examples.
|
||||
|
||||
@e RENDER_INDEX_TOP_MTID
|
||||
|
||||
=
|
||||
VMETHOD_TYPE(RENDER_INDEX_TOP_MTID, navigation_design *ND, text_stream *OUT, text_stream *filename, text_stream *title)
|
||||
|
||||
void Gadgets::render_navigation_index_top(OUTPUT_STREAM, text_stream *filename, text_stream *title) {
|
||||
if (SET_navigation == NAVMODE_midnight) {
|
||||
Midnight::midnight_navigation_index_top(OUT, filename, title);
|
||||
} else if (SET_navigation == NAVMODE_architect) {
|
||||
Architect::architect_navigation_index_top(OUT, filename, title);
|
||||
} else if (SET_navigation == NAVMODE_twilight) {
|
||||
Twilight::twilight_navigation_index_top(OUT, filename, title);
|
||||
} else if (SET_navigation == NAVMODE_roadsign) {
|
||||
Roadsign::roadsign_navigation_index_top(OUT, filename, title);
|
||||
} else if (SET_navigation == NAVMODE_unsigned) {
|
||||
Unsigned::unsigned_navigation_index_top(OUT, filename, title);
|
||||
} else if (SET_navigation == NAVMODE_lacuna) {
|
||||
Lacuna::lacuna_navigation_index_top(OUT, filename, title);
|
||||
}
|
||||
VMETHOD_CALL(indoc_settings->navigation, RENDER_INDEX_TOP_MTID, OUT, filename, title);
|
||||
}
|
||||
|
||||
@h Middle.
|
||||
At the middle part, when the text is over, but before any example cues.
|
||||
|
||||
@e RENDER_NAV_MIDDLE_MTID
|
||||
|
||||
=
|
||||
VMETHOD_TYPE(RENDER_NAV_MIDDLE_MTID, navigation_design *ND, text_stream *OUT, volume *V, section *S)
|
||||
|
||||
void Gadgets::render_navigation_middle(OUTPUT_STREAM, volume *V, section *S) {
|
||||
if (SET_navigation == NAVMODE_midnight) {
|
||||
Midnight::midnight_navigation_middle(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_architect) {
|
||||
Architect::architect_navigation_middle(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_twilight) {
|
||||
Twilight::twilight_navigation_middle(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_roadsign) {
|
||||
Roadsign::roadsign_navigation_middle(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_unsigned) {
|
||||
Unsigned::unsigned_navigation_middle(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_lacuna) {
|
||||
Lacuna::lacuna_navigation_middle(OUT, V, S);
|
||||
}
|
||||
VMETHOD_CALL(indoc_settings->navigation, RENDER_NAV_MIDDLE_MTID, OUT, V, S);
|
||||
}
|
||||
|
||||
@h Example top.
|
||||
This is reached before the first example is rendered, provided at least
|
||||
one example will be:
|
||||
|
||||
@e RENDER_EXAMPLE_TOP_MTID
|
||||
|
||||
=
|
||||
VMETHOD_TYPE(RENDER_EXAMPLE_TOP_MTID, navigation_design *ND, text_stream *OUT, volume *V, section *S)
|
||||
|
||||
void Gadgets::render_navigation_example_top(OUTPUT_STREAM, volume *V, section *S) {
|
||||
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
HTML::begin_div_with_class_S(OUT, I"bookexamples");
|
||||
HTML_OPEN_WITH("p", "class=\"chapterheading\"");
|
||||
}
|
||||
|
@ -136,80 +154,50 @@ void Gadgets::render_navigation_example_top(OUTPUT_STREAM, volume *V, section *S
|
|||
WRITE("Examples");
|
||||
}
|
||||
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
HTML_CLOSE("p");
|
||||
} else { WRITE("\n\n"); }
|
||||
|
||||
if (SET_navigation == NAVMODE_midnight) {
|
||||
Midnight::midnight_navigation_example_top(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_twilight) {
|
||||
Twilight::twilight_navigation_example_top(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_architect) {
|
||||
Architect::architect_navigation_example_top(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_roadsign) {
|
||||
Roadsign::roadsign_navigation_example_top(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_unsigned) {
|
||||
Unsigned::unsigned_navigation_example_top(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_lacuna) {
|
||||
Lacuna::lacuna_navigation_example_top(OUT, V, S);
|
||||
}
|
||||
VMETHOD_CALL(indoc_settings->navigation, RENDER_EXAMPLE_TOP_MTID, OUT, V, S);
|
||||
}
|
||||
|
||||
@h Example bottom.
|
||||
Any closing ornament at the end of examples? This is reached after the
|
||||
last example is rendered, provided at least one example has been.
|
||||
|
||||
=
|
||||
void Gadgets::render_navigation_example_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
@e RENDER_EXAMPLE_BOTTOM_MTID
|
||||
|
||||
if (SET_format == PLAIN_FORMAT) {
|
||||
=
|
||||
VMETHOD_TYPE(RENDER_EXAMPLE_BOTTOM_MTID, navigation_design *ND, text_stream *OUT, volume *V, section *S)
|
||||
|
||||
void Gadgets::render_navigation_example_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
if (indoc_settings->format == PLAIN_FORMAT) {
|
||||
WRITE("\n\n");
|
||||
}
|
||||
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
if (indoc_settings->examples_mode != EXMODE_open_internal) { HTMLUtilities::ruled_line(OUT); }
|
||||
HTML::end_div(OUT);
|
||||
}
|
||||
|
||||
if (SET_navigation == NAVMODE_midnight) {
|
||||
Midnight::midnight_navigation_example_bottom(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_architect) {
|
||||
Architect::architect_navigation_example_bottom(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_twilight) {
|
||||
Twilight::twilight_navigation_example_bottom(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_roadsign) {
|
||||
Roadsign::roadsign_navigation_example_bottom(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_unsigned) {
|
||||
Unsigned::unsigned_navigation_example_bottom(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_lacuna) {
|
||||
Lacuna::lacuna_navigation_example_bottom(OUT, V, S);
|
||||
}
|
||||
VMETHOD_CALL(indoc_settings->navigation, RENDER_EXAMPLE_BOTTOM_MTID, OUT, V, S);
|
||||
}
|
||||
|
||||
@h Bottom.
|
||||
At the end of the section, after any example cues and perhaps also example
|
||||
bodied. (In a section with no examples, this immediately follows the middle.)
|
||||
|
||||
@e RENDER_NAV_BOTTOM_MTID
|
||||
|
||||
=
|
||||
VMETHOD_TYPE(RENDER_NAV_BOTTOM_MTID, navigation_design *ND, text_stream *OUT, volume *V, section *S)
|
||||
|
||||
void Gadgets::render_navigation_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
HTML::comment(OUT, I"START IGNORE");
|
||||
}
|
||||
if (SET_navigation == NAVMODE_midnight) {
|
||||
Midnight::midnight_navigation_bottom(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_architect) {
|
||||
Architect::architect_navigation_bottom(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_twilight) {
|
||||
Twilight::twilight_navigation_bottom(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_roadsign) {
|
||||
Roadsign::roadsign_navigation_bottom(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_unsigned) {
|
||||
Unsigned::unsigned_navigation_bottom(OUT, V, S);
|
||||
} else if (SET_navigation == NAVMODE_lacuna) {
|
||||
Lacuna::lacuna_navigation_bottom(OUT, V, S);
|
||||
}
|
||||
|
||||
if (SET_format == HTML_FORMAT) {
|
||||
VMETHOD_CALL(indoc_settings->navigation, RENDER_NAV_BOTTOM_MTID, OUT, V, S);
|
||||
if (indoc_settings->format == HTML_FORMAT) {
|
||||
HTML::comment(OUT, I"END IGNORE");
|
||||
}
|
||||
}
|
||||
|
@ -217,19 +205,17 @@ void Gadgets::render_navigation_bottom(OUTPUT_STREAM, volume *V, section *S) {
|
|||
@h Contents page.
|
||||
Midnight provides a contents page of its very own.
|
||||
|
||||
@e RENDER_CONTENTS_MTID
|
||||
@e RENDER_CONTENTS_HEADING_MTID
|
||||
|
||||
=
|
||||
VMETHOD_TYPE(RENDER_CONTENTS_MTID, navigation_design *ND)
|
||||
VMETHOD_TYPE(RENDER_CONTENTS_HEADING_MTID, navigation_design *ND, text_stream *OUT, volume *V)
|
||||
|
||||
void Gadgets::render_navigation_contents_files(void) {
|
||||
if (SET_navigation == NAVMODE_midnight) {
|
||||
Midnight::midnight_navigation_contents_files();
|
||||
} else if (SET_navigation == NAVMODE_architect) {
|
||||
Architect::architect_navigation_contents_files();
|
||||
} else if (SET_navigation == NAVMODE_twilight) {
|
||||
Twilight::twilight_navigation_contents_files();
|
||||
} else if (SET_navigation == NAVMODE_roadsign) {
|
||||
Roadsign::roadsign_navigation_contents_files();
|
||||
} else if (SET_navigation == NAVMODE_unsigned) {
|
||||
Unsigned::unsigned_navigation_contents_files();
|
||||
} else if (SET_navigation == NAVMODE_lacuna) {
|
||||
Lacuna::lacuna_navigation_contents_files();
|
||||
}
|
||||
VMETHOD_CALLV(indoc_settings->navigation, RENDER_CONTENTS_MTID);
|
||||
}
|
||||
|
||||
void Gadgets::navigation_contents_heading(OUTPUT_STREAM, volume *V) {
|
||||
VMETHOD_CALL(indoc_settings->navigation, RENDER_CONTENTS_HEADING_MTID, OUT, V);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ Web Syntax Version: 2
|
|||
Licence: Artistic License 2.0
|
||||
Version Number: 4
|
||||
Version Name: Didache
|
||||
Build Number: 6Q17
|
||||
Build Date: 12 February 2019
|
||||
Build Number: 6Q19
|
||||
Build Date: 16 February 2019
|
||||
|
||||
Import: foundation
|
||||
|
||||
|
@ -162,6 +162,8 @@ Chapter 4: Navigation Styles
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,4 +2,4 @@ Sync to inform7
|
|||
Aquinas 1 3K27 April 2006 First Perl version
|
||||
Bonaventure 2 5Z71 April 2009 Tidied up somewhat
|
||||
Cranmer 3 6L02 May 2014 EPUB ebook generation support
|
||||
Didache 4 *6Q17 12 February 2019 Ported to C with Unicode support
|
||||
Didache 4 *6Q19 16 February 2019 Ported to C with Unicode support
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Title: inform7
|
||||
Author: Graham Nelson
|
||||
Build Date: 15 February 2019
|
||||
Build Number: 6Q18
|
||||
Build Date: 16 February 2019
|
||||
Build Number: 6Q19
|
||||
Version Name: Krypton
|
||||
Version Number: 7.10.1
|
||||
Purpose: The core compiler in a natural-language design system for interactive fiction.
|
||||
|
@ -293,5 +293,6 @@ followed during compilation."
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ Web Syntax Version: 2
|
|||
Licence: Artistic License 2.0
|
||||
Version Number: 1
|
||||
Version Name: Abacus
|
||||
Build Number: 6Q18
|
||||
Build Date: 15 February 2019
|
||||
Build Number: 6Q19
|
||||
Build Date: 16 February 2019
|
||||
|
||||
Import: foundation
|
||||
Import: words
|
||||
|
@ -152,5 +152,6 @@ Chapter 1: Everything
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Sync to inform7
|
||||
Abacus 1 *6Q18 15 February 2019
|
||||
Abacus 1 *6Q19 16 February 2019
|
||||
|
|
|
@ -7,8 +7,8 @@ Web Syntax Version: 2
|
|||
Licence: Artistic License 2.0
|
||||
Version Number: 1
|
||||
Version Name: Abacus
|
||||
Build Number: 6Q18
|
||||
Build Date: 15 February 2019
|
||||
Build Number: 6Q19
|
||||
Build Date: 16 February 2019
|
||||
|
||||
Import: foundation
|
||||
Import: words
|
||||
|
@ -142,5 +142,6 @@ Chapter 1: Everything
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Sync to inform7
|
||||
Abacus 1 *6Q18 15 February 2019
|
||||
Abacus 1 *6Q19 16 February 2019
|
||||
|
|
|
@ -7,8 +7,8 @@ Web Syntax Version: 2
|
|||
Licence: Artistic License 2.0
|
||||
Version Number: 1
|
||||
Version Name: Abacus
|
||||
Build Number: 6Q18
|
||||
Build Date: 15 February 2019
|
||||
Build Number: 6Q19
|
||||
Build Date: 16 February 2019
|
||||
|
||||
Import: foundation
|
||||
Import: words
|
||||
|
@ -161,5 +161,6 @@ Chapter 1: Everything
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Sync to inform7
|
||||
Abacus 1 *6Q18 15 February 2019
|
||||
Abacus 1 *6Q19 16 February 2019
|
||||
|
|
|
@ -7,8 +7,8 @@ Web Syntax Version: 2
|
|||
Licence: Artistic License 2.0
|
||||
Version Number: 1
|
||||
Version Name: Abacus
|
||||
Build Number: 6Q18
|
||||
Build Date: 15 February 2019
|
||||
Build Number: 6Q19
|
||||
Build Date: 16 February 2019
|
||||
|
||||
Import: foundation
|
||||
Import: words
|
||||
|
@ -123,5 +123,6 @@ Chapter 1: Everything
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Sync to inform7
|
||||
Abacus 1 *6Q18 15 February 2019
|
||||
Abacus 1 *6Q19 16 February 2019
|
||||
|
|
|
@ -7,8 +7,8 @@ Web Syntax Version: 2
|
|||
Licence: Artistic License 2.0
|
||||
Version Number: 1
|
||||
Version Name: Abacus
|
||||
Build Number: 6Q18
|
||||
Build Date: 15 February 2019
|
||||
Build Number: 6Q19
|
||||
Build Date: 16 February 2019
|
||||
|
||||
Import: foundation
|
||||
Import: words
|
||||
|
@ -146,5 +146,6 @@ Chapter 1: Everything
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Sync to inform7
|
||||
Abacus 1 *6Q18 15 February 2019
|
||||
Abacus 1 *6Q19 16 February 2019
|
||||
|
|
|
@ -28,4 +28,4 @@ Hydrogen 7.8.1 6E59 June 2010 Parchment support, functional programming
|
|||
Iron 7.9.1 6L02 May 2014 Language reforms, unifying text
|
||||
7.9.2 6L38 August 2014 Added Android platform
|
||||
7.9.3 6M62 December 2015 Extension projects, unifying actions
|
||||
Krypton 7.10.1 *6Q18 15 February 2019 *
|
||||
Krypton 7.10.1 *6Q19 16 February 2019 *
|
||||
|
|
|
@ -7,8 +7,8 @@ Web Syntax Version: 2
|
|||
Licence: Artistic License 2.0
|
||||
Version Number: 1
|
||||
Version Name: Abacus
|
||||
Build Number: 6Q18
|
||||
Build Date: 15 February 2019
|
||||
Build Number: 6Q19
|
||||
Build Date: 16 February 2019
|
||||
|
||||
Import: foundation
|
||||
Import: words
|
||||
|
@ -138,5 +138,6 @@ Chapter 1: Everything
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Sync to inform7
|
||||
Abacus 1 *6Q18 15 February 2019
|
||||
Abacus 1 *6Q19 16 February 2019
|
||||
|
|
|
@ -6,8 +6,8 @@ Declare Section Usage: Off
|
|||
Licence: Artistic License 2.0
|
||||
Version Number: 2
|
||||
Version Name: Benefactive
|
||||
Build Number: 6Q18
|
||||
Build Date: 15 February 2019
|
||||
Build Number: 6Q19
|
||||
Build Date: 16 February 2019
|
||||
Web Syntax Version: 2
|
||||
|
||||
Import: foundation
|
||||
|
@ -141,5 +141,6 @@ Chapter 1: The Whole Shooting Match
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Sync to inform7
|
||||
Ablative 1 3K27 April 2006 First Perl version
|
||||
Benefactive 2 *6Q18 15 February 2019 Ported to C with Unicode support
|
||||
Benefactive 2 *6Q19 16 February 2019 Ported to C with Unicode support
|
||||
|
|
|
@ -7,8 +7,8 @@ Web Syntax Version: 2
|
|||
Licence: Artistic License 2.0
|
||||
Version Number: 1
|
||||
Version Name: Axion
|
||||
Build Number: 6Q18
|
||||
Build Date: 15 February 2019
|
||||
Build Number: 6Q19
|
||||
Build Date: 16 February 2019
|
||||
|
||||
Import: foundation
|
||||
Import: inter
|
||||
|
@ -168,5 +168,6 @@ Chapter 1: Everything
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Sync to inform7
|
||||
Axion 1 *6Q18 15 February 2019
|
||||
Axion 1 *6Q19 16 February 2019
|
||||
|
|
Loading…
Reference in a new issue