User Tools

Site Tools


docs:plwiki1ex

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

docs:plwiki1ex [2017/09/19 14:31]
docs:plwiki1ex [2022/03/23 16:59] (current)
Line 1: Line 1:
 +~~NOCACHE~~
 +====== PlWiki 1.0 - Plugin API examples ======
 +
 +===== Simple use case =====
 +
 +<pl cache="false" goal="woman(X),write(X),nl,fail">
 +woman(kate).
 +man(john).
 +</pl>
 +
 +IMPORTANT: This knowledge is not saved in cache !!
 +
 +===== Adding knowledge to the page =====
 +
 +<pl cache="true">
 +man(jack).
 +man(jim).
 +</pl>
 +
 +
 +IMPORTANT: cache="true" so knowledge will be saved.
 +
 +
 +===== Goal and scope ====
 +
 +<pl goal="man(X),write(X),nl,fail" scope="docs:plwiki1ex">
 +
 +</pl>
 +
 +===== Prolog interface =====
 +
 +  * list all predicates in selected scope:
 +
 +<pl goal="consult('lib/plugins/loki/loki.pl'),wikiconsult('docs/plwiki1ex'),list.">
 +%
 +</pl>
 +
 +  * list info about selected predicate:
 +<pl goal="consult('lib/plugins/loki/loki.pl'),wikiconsult('docs/plwiki1ex'),list(man).">
 +%
 +</pl>
 +
 +====== Additional functionality ======
 +
 +
 +Plugin automatically saves information about page structure. In each scope several predicates are available:
 +  * header(Name, Level).
 +  * internallink(Scope, Url).
 +  * externallink(Name, Url).
 +
  
docs/plwiki1ex.txt ยท Last modified: 2022/03/23 16:59 (external edit)