nitc :: static_index
nitc :: static_index $ Deserializer
Abstract deserialization servicenitc :: static_index $ DocModel
Generate the index for then Nitdoc QuickSearch field.nitc :: static_index $ Deserializer
Abstract deserialization servicenitc :: static_index $ DocModel
Generate the index for then Nitdoc QuickSearch field.nitc :: actors_injection_phase
Injects model for the classes annotated with "is actor" sonitc :: astbuilder
Instantiation and transformation of semantic nodes in the AST of expressions and statementsnitc :: commands_ini
nitc :: i18n_phase
Basic support of internationalization through the generation of id-to-string tablesSerializable::inspect
to show more useful information
nitc :: modelbuilder
more_collections :: more_collections
Highly specific, but useful, collections-related classes.threaded
annotation
serialization :: serialization_core
Abstract services to serialize Nit objects to different formatsnitc :: serialization_model_phase
Phase generating methods (model-only) to serialize Nit objectsdeserialize_json
and JsonDeserializer
serialize_to_json
and JsonSerializer
nitc :: toolcontext
Common command-line tool infrastructure than handle options and error messagesnitc :: uml_module
Services for generation of a UML package diagram based on aModel
core :: union_find
union–find algorithm using an efficient disjoint-set data structure
# Manage indexing of Nit model for Nitdoc QuickSearch.
module static_index
import static::static_html
import json
# Generate the index for then Nitdoc QuickSearch field.
#
# Create a JSON object containing links to:
# * mpackages
# * modules
# * mclasses
# * mpropdefs
# All entities are grouped by name to make the research easier.
#
# TODO Merge with model_index
redef class DocModel
# Build the nitdoc quick search index
fun create_index_file(file: String) do
var table = new QuickSearchTable(self)
var tpl = new Template
tpl.add "var nitdocQuickSearchRawList="
tpl.add table.to_json
tpl.add ";"
tpl.write_to_file(file)
end
end
# The result map for QuickSearch.
private class QuickSearchTable
super HashMap[String, Array[QuickSearchResult]]
var doc: DocModel
init do
var model = doc.model
var filter = doc.filter
index_mentities model.collect_mpackages(filter)
index_mentities model.collect_mmodules(filter)
index_mentities model.collect_mclasses(filter)
index_mentities model.collect_mproperties(filter)
end
fun index_mentities(mentities: Collection[MEntity]) do
for mentity in mentities do index_mentity mentity
end
fun index_mentity(mentity: MEntity) do
var key = mentity.name
if not has_key(key) then
self[key] = new Array[QuickSearchResult]
end
self[key].add new QuickSearchResult(mentity.full_name, mentity.html_url)
end
end
# A QuickSearch result.
private class QuickSearchResult
serialize
# The text of the link.
var txt: String
# The destination of the link.
var url: String
end
src/doc/static/static_index.nit:15,1--82,3