2021-06-06 14:01:16 +03:00
|
|
|
[ValuesElement::] Values Element.
|
|
|
|
|
|
|
|
To write the Values element (Vl) in the index.
|
|
|
|
|
2021-07-26 01:56:17 +03:00
|
|
|
@ Variables and equations both appear here, though really they're conceptually
|
|
|
|
quite different.
|
2021-06-06 14:01:16 +03:00
|
|
|
|
|
|
|
=
|
2021-07-26 15:48:49 +03:00
|
|
|
void ValuesElement::render(OUTPUT_STREAM, index_session *session) {
|
|
|
|
localisation_dictionary *LD = Indexing::get_localisation(session);
|
|
|
|
tree_inventory *inv = Indexing::get_inventory(session);
|
2022-02-03 01:35:38 +02:00
|
|
|
InterNodeList::array_sort(inv->variable_nodes, MakeSynopticModuleStage::module_order);
|
2021-06-06 14:01:16 +03:00
|
|
|
@<Index the variables@>;
|
2022-02-03 01:35:38 +02:00
|
|
|
InterNodeList::array_sort(inv->equation_nodes, MakeSynopticModuleStage::module_order);
|
2021-06-06 14:01:16 +03:00
|
|
|
@<Index the equations@>;
|
|
|
|
}
|
|
|
|
|
|
|
|
@<Index the variables@> =
|
2021-06-07 00:18:08 +03:00
|
|
|
inter_symbol *definition_area = NULL, *current_area = NULL;
|
2021-06-06 14:01:16 +03:00
|
|
|
HTML_OPEN("p");
|
2021-07-09 00:56:01 +03:00
|
|
|
IndexUtilities::anchor(OUT, I"NAMES");
|
2021-06-06 14:01:16 +03:00
|
|
|
int understood_note_given = FALSE;
|
2021-07-25 00:04:35 +03:00
|
|
|
inter_package *pack;
|
|
|
|
LOOP_OVER_INVENTORY_PACKAGES(pack, i, inv->variable_nodes)
|
2021-06-06 14:01:16 +03:00
|
|
|
if (Metadata::read_optional_numeric(pack, I"^indexable")) {
|
|
|
|
if (Metadata::read_optional_numeric(pack, I"^understood"))
|
|
|
|
@<Index a K understood variable@>
|
|
|
|
else
|
|
|
|
@<Index a regular variable@>;
|
|
|
|
}
|
|
|
|
HTML_CLOSE("p");
|
|
|
|
|
|
|
|
@<Index a K understood variable@> =
|
|
|
|
if (understood_note_given == FALSE) {
|
|
|
|
understood_note_given = TRUE;
|
2021-07-26 02:34:51 +03:00
|
|
|
Localisation::roman(OUT, LD, I"Index.Elements.Vl.UnderstoodVariables");
|
2021-06-06 14:01:16 +03:00
|
|
|
HTML_TAG("br");
|
|
|
|
}
|
|
|
|
|
|
|
|
@<Index a regular variable@> =
|
2022-03-01 00:24:58 +02:00
|
|
|
definition_area = Metadata::optional_symbol(pack, I"^heading");
|
2021-06-07 00:18:08 +03:00
|
|
|
if (definition_area == NULL) continue;
|
2021-06-06 14:01:16 +03:00
|
|
|
if (definition_area != current_area) {
|
2021-07-25 00:04:35 +03:00
|
|
|
inter_package *heading_pack =
|
2022-01-31 01:49:12 +02:00
|
|
|
InterPackage::container(definition_area->definition);
|
2021-06-06 14:01:16 +03:00
|
|
|
HTML_CLOSE("p");
|
|
|
|
HTML_OPEN("p");
|
2021-07-09 00:56:01 +03:00
|
|
|
IndexUtilities::show_definition_area(OUT, heading_pack, FALSE);
|
2021-06-06 14:01:16 +03:00
|
|
|
}
|
|
|
|
current_area = definition_area;
|
2021-06-07 00:18:08 +03:00
|
|
|
|
2022-03-01 00:24:58 +02:00
|
|
|
text_stream *name = Metadata::optional_textual(pack, I"^name");
|
2021-06-06 14:01:16 +03:00
|
|
|
WRITE("%S", name);
|
2021-07-24 20:16:56 +03:00
|
|
|
IndexUtilities::link_package(OUT, pack);
|
|
|
|
IndexUtilities::link_to_documentation(OUT, pack);
|
2022-03-01 00:24:58 +02:00
|
|
|
text_stream *contents = Metadata::optional_textual(pack, I"^contents");
|
2021-06-06 14:01:16 +03:00
|
|
|
WRITE(" - <i>%S</i>", contents);
|
|
|
|
HTML_TAG("br");
|
|
|
|
|
|
|
|
@<Index the equations@> =
|
2021-07-26 01:56:17 +03:00
|
|
|
HTML_OPEN("p");
|
2021-07-26 02:34:51 +03:00
|
|
|
Localisation::bold(OUT, LD, I"Index.Elements.Vl.EquationsHeading");
|
2021-07-26 01:56:17 +03:00
|
|
|
WRITE(" (");
|
2021-07-26 02:34:51 +03:00
|
|
|
Localisation::italic(OUT, LD, I"Index.Elements.Vl.AboutEquations");
|
2021-07-26 01:56:17 +03:00
|
|
|
WRITE(")");
|
|
|
|
HTML_CLOSE("p");
|
|
|
|
HTML_OPEN("p");
|
|
|
|
int N = 0;
|
|
|
|
inter_package *pack;
|
|
|
|
LOOP_OVER_INVENTORY_PACKAGES(pack, i, inv->equation_nodes) {
|
|
|
|
int at = (int) Metadata::read_optional_numeric(pack, I"^at");
|
|
|
|
if (at > 0) {
|
2022-03-01 00:24:58 +02:00
|
|
|
WRITE("%S", Metadata::optional_textual(pack, I"^name"));
|
2021-07-26 01:56:17 +03:00
|
|
|
IndexUtilities::link(OUT, at);
|
2022-03-01 00:24:58 +02:00
|
|
|
WRITE(" (%S)", Metadata::optional_textual(pack, I"^text"));
|
2021-07-26 01:56:17 +03:00
|
|
|
HTML_TAG("br");
|
|
|
|
N++;
|
2021-06-06 14:01:16 +03:00
|
|
|
}
|
|
|
|
}
|
2021-07-26 02:34:51 +03:00
|
|
|
if (N == 0) Localisation::italic(OUT, LD, I"Index.Elements.Vl.NoEquations");
|
2021-07-26 01:56:17 +03:00
|
|
|
HTML_CLOSE("p");
|