|title "Pliant pretty listing"
header "How to view a source listing"
[In order to view source listing, the right ];fixed:[browse_source];[ shall be given ]
[to the users allowed to see the source files.]
[Pretty listing concerns the files having extensions ];fixed:[.oku, .remote, .page];[ and ]
[To see the listing, you may either use the Pliant file browser and click on the file name, or ]
[directly enter the path (relative to Pliant's root) as an url, as in ]
link "http://localhost/pliant/appli/source_browser.pli" "http://localhost/pliant/appli/source_browser.pli"
[To see the source code of a ];fixed:[.page];[ file properly rendered, the source file should have been compiled first. ]
[This can be achieved by accesing the corresponding ];[.html];[ URL first. ]
[Otherwise, only a minimal rendering will be performed on the file (comments and strings coloring).]
[Remark: if the source file has been modified since its compilation, the listing rendering ]
[ will not work properly, as the rendering informations are stored during the compilation ]
[phase. For a similar reason, files compiled before the activation of the pretty listing mechanism ]
[will be rendered in a minimal way.]
header "How to increase pretty listing capabilities"
[The pretty listing tool consider two kind of objects:]
bold:[constants];[ like strings and characters.];eol
[Notice that constants considered here are those recognized as such by Pliant parser and that ]
[the ];fixed:[Type];[ type is handled in a specific way.]
bold:[active objects];[ like functions, meta, global variables, etc. ]
[The active type should have a ];fixed:[get_position];[ method returning a ]
fixed:[ListingPosition];[ object corresponding to the position to which the link created ]
[by the listing tool should point to.]
[To track some data type and/or to modifiy the color used for rendering, use the ];fixed:['pliant watch']
[ function. like in:]
['pliant watch' Str false # constant, no color defined];eol
['pliant watch' Str false := [dq]green[dq] # constant, rendered in green];eol
['pliant watch' HtmlTag true # active, no color defined];eol
['pliant watch' HtmlTag true := [dq]000080[dq] # active, rendered in dark blue];eol