Did you know ... Search Documentation:
autocomplete.pl -- SWI-Prolog website autocompletion support
PublicShow source

This module provides the handler for =/autocomplete/ac_predicate=, which implements autocompletion for the website. This handler is called from searchbox_script//1 in page.pl.

 prolog:doc_search_field(+Options) is det[private]
Emit the manual-search field. This is a hook into PlDoc to override the PlDoc search field. In theory, all searches on the website should now be using the search box as defined in page.pl. See searchbox_script//1.
Source ac_predicate(+Request)[private]
HTTP handler to reply autocompletion
Source obj_name(+Object, -Label, -Class) is det[private]
Provide the (autocomplete) label for Object and its class. The class may be used to style the hit in www/css/plweb.css.
To be done
- : There are a lot of similar things around in the code.
Source update_autocompletion_map[private]
Assert that the token map is out of data.
Source fill_token_map is det[private]
Examine the objects that are suitable for autocompletion, building:
  • name_object(Name, Object, Category)
  • Two RDF literal maps, one with the Name of the object and one with all tokens in Name.
Source keep_best_doc is det[private]
Filter the documentation objects found in name_object/3, removing `inferior' objects.
Source completion_target(+Object0, +Summary, -Object, -Name) is semidet[private]
True when we can do completion on Object based on Name.
Source sub_token(+Label, -Token) is nondet[private]