36
37:- module(cp_help, []). 38:- use_module(library(doc_http)). 39:- use_module(library(pldoc/doc_index)). 40:- use_module(library(http/http_hook)). 41:- use_module(library(http/http_dispatch)). 42:- use_module(library(http/html_write)). 43:- use_module(library(http/html_head)). 44:- include(library(pldoc/hooks)).
45
46:- use_module(cliopatria(parms)). 47:- use_module(skin(cliopatria)). 48:- use_module(wiki). 49:- use_module(http_help). 50:- use_module(ac_predicate). 51:- use_module(components(menu)).
60:- if(current_predicate(doc_enable/1)). 61:- initialization
62 doc_enable(true). 63:- endif. 64
68
69http:location(pldoc, root('help/source'), [priority(10)]).
70
71:- http_handler(root(help/source), cp_help, []). 72:- http_handler(cliopatria('help/'),
73 serve_page(help), [prefix, id(wiki_help)]). 74:- http_handler(cliopatria('tutorial/'),
75 serve_page(tutorial), [prefix, id(tutorial)]).
82prolog:doc_directory(Dir) :-
83 absolute_file_name(cliopatria(.), CpDir,
84 [ file_type(directory),
85 access(read)
86 ]),
87 sub_atom(Dir, 0, _, _, CpDir).
94cp_help(Request) :-
95 http_location_by_id(pldoc_doc, Location),
96 absolute_file_name(cliopatria('RoadMap'), HelpFile,
97 [ extensions([txt]),
98 access(read)
99 ]),
100 atom_concat(Location, HelpFile, StartPage),
101 http_redirect(moved, StartPage, Request).
108:- multifile
109 cliopatria:menu_item/2. 110
111cliopatria:(100=help/wiki_help, 'Documentation').
112cliopatria:menu_item(150=help/tutorial, 'Tutorial').
113cliopatria:menu_item(200=help/cp_help, 'Roadmap').
114cliopatria:menu_item(300=help/http_help, 'HTTP Services').
121:- multifile
122 user:body//2. 123
124user:body(pldoc(wiki), Content) -->
125 { absolute_file_name(cliopatria(.), Dir,
126 [ file_type(directory),
127 access(read)
128 ])
129 },
130 html_requires(cliopatria),
131 html(body(class('yui-skin-sam cliopatria'),
132 [ div(class(menu), \cp_menu),
133 br(clear(all)),
134 div(class(content),
135 [ \doc_links(Dir, [])
136 | Content
137 ]),
138 \server_address('ClioPatria')
139 ])).
140user:body(pldoc(_), Content) -->
141 html_requires(cliopatria),
142 html(body(class('yui-skin-sam cliopatria'),
143 [ div(class(menu), \cp_menu),
144 br(clear(all)),
145 div(class(content), Content),
146 \server_address('ClioPatria')
147 ]))
ClioPatria help system
This module serves the wiki-source based help-pages from
cliopatria(web/help)
and integrates SWI-Prolog's PlDoc literate programming system to provide documentation of the source-code. */