All predicatesShow sourcehttp_help.pl -- Explore the running HTTP server

This module is part of the SWI-Prolog web-developent infrastructure. It documents the HTTP server using the reflexive capabilities of Prolog and the server infrastructure. Self-documentation is enabled by loading this module. The entry-point of this module is located at the HTTP location root(help/http), using the handler-identifier http_help.

In addition, this module provides the component page_documentation_link//1, which shows a small book linking from the displayed page to its documentation.

Source page_documentation_link(+Request)// is det
Show a link to the documentation of the current page.
Source http_help(Request)[private]
HTTP handler to explore the Prolog HTTP server
Source help_page(Options)//[private]
Emit the tree and #http-help for holding the description. We need to include the requirements for PlDoc here as the scripts are not loaded through the innerHTML method.

Options:

location(Location)
Initially open Location.
Source script(+Options)// is det[private]
Emit JavScript code that gets the help for the HTTP location associated with node and displays this information in #http-help.
Source help_on_handler(+Request)[private]
Describe the HTTP handler for the given location.
To be done
- Include the output format by scanning for one of the defined output handlers.
Source status(+How)//[private]
Emit HTTP code and comment for status.
To be done
- Use a clean interface from http_header.
Source predicate_help(+Request, +Closure)// is det[private]
Provide the help-page of the implementing predicate.
Source edit_options(+Request, -Options) is det[private]
Assume we can show and edit option if we are allowed to access the HTTP location pldoc(edit).
Source dispatch_options(+Options, +Path)// is det[private]
Describe the dispatching options
Source parameter_table(+Params)// is det[private]
Provide help on the parameters
Source param_type(+Options)// is det[private]
Emit a description of the type in HTML.
Source breaking_bar// is det[private]
Emits | followed by a zero-width white-space that allows the browser to insert a linebreak here.
Source type_term(-Term) is nondet[private]
Enumerate the option-terms that are interpreted as types.
To be done
- provide a public interface from http_parameters.pl
Source extracted_parameters(+Closure, -Declarations)[private]
Return a completely qualified list of parameters that are retrieved by calling Closure.
Source extend_closure(:In, +Extra, -Out) is det[private]
Extend a possibly qualified closure with arguments from Extra.
Source calls(:Goal, +MaxDepth, -Called) is det[private]
Called is the list of goals called by Goal obtained by unfolding the call-tree upto the given MaxDepth.
To be done
- Without MaxDepth not all programs terminate. Why?
Source bind_vars(+Key, +Pairs) is det[private]
Pairs contains the variable bindings after scanning the alternative computation paths. Key are the initial variables.
To be done
- What we should do is find all bindings for a specific variable, compute the most specific generalization of this set and unify it with the variable in Key. For now, we only try to unify all of them with the input variable. That deals correctly with the case where no path binds the variable (this is typically the case for input variables and that is our biggest concern at the moment).
Source evaluate_now(:Goal) is semidet[private]
If true, call Goal and propagate bindings that it produces instead of unfolding its call-tree. This was introduced to deal with extracted_parameters/2, which dynamically constructs option-lists for http_parameters/3.
See also
- The hook evaluate/1 extends the definition
 evaluate(:Goal) is semidet[multifile]
Multifile hook to extend the goals that are evaluated by evaluate_now/1.
Source autocomplete(+HandlerID, +Options)// is det[private]
Insert a YUI autocomplete widget that obtains its alternatives from HandlerID. The following Options are supported:
width(+Width)
Specify the width of the box. Width must satisfy the CSS length syntax.
query_delay(+Seconds)
Wait until no more keys are typed for Seconds before sending the query to the server.
Source ac_location(+Request)[private]
HTTP handler to for autocompletion on HTTP handlers.