PublicShow sourcedoc_http.pl -- Documentation server

The module library(pldoc/http) provides an embedded HTTP documentation server that allows for browsing the documentation of all files loaded after library(pldoc) has been loaded.

Sourcedoc_server(?Port) is det
Sourcedoc_server(?Port, +Options) is det
Start a documentation server in the current Prolog process. The server is started in a seperate thread. Options are handed to http_server/2. In addition, the following options are recognised:
allow(HostOrIP)
Allow connections from HostOrIP. If HostOrIP is an atom it is matched to the hostname. It if starts with a ., suffix match is done, matching the domain. Finally it can be a term ip(A,B,C,D). See tcp_host_to_address/2 for details.
deny(HostOrIP)
See allow(HostOrIP).
edit(Bool)
Allow editing from localhost connections? Default: true.

The predicate doc_server/1 is defined as below, which provides a good default for development.

doc_server(Port) :-
        doc_server(Port,
                   [ workers(1),
                     allow(localhost)
                   ]).
See also
- doc_browser/1
Sourcedoc_browser is det
Sourcedoc_browser(+What) is semidet
Open user's default browser on the documentation server.
Sourcedoc_server(?Port) is det
Sourcedoc_server(?Port, +Options) is det
Start a documentation server in the current Prolog process. The server is started in a seperate thread. Options are handed to http_server/2. In addition, the following options are recognised:
allow(HostOrIP)
Allow connections from HostOrIP. If HostOrIP is an atom it is matched to the hostname. It if starts with a ., suffix match is done, matching the domain. Finally it can be a term ip(A,B,C,D). See tcp_host_to_address/2 for details.
deny(HostOrIP)
See allow(HostOrIP).
edit(Bool)
Allow editing from localhost connections? Default: true.

The predicate doc_server/1 is defined as below, which provides a good default for development.

doc_server(Port) :-
        doc_server(Port,
                   [ workers(1),
                     allow(localhost)
                   ]).
See also
- doc_browser/1
Sourcedoc_browser is det
Sourcedoc_browser(+What) is semidet
Open user's default browser on the documentation server.