Logicalc can be used with virtually any HTML web page. Just follow the steps below. The examples here illustrate how the Constraints documentation page is implemented.
(1) Load Logicalc code in the head. To do this, place the following lines in the head of the web page.
(2) Place an "id" attribute and an "arity" attribute on every table that you want Logicalc to manage. The tables should be left empty as show here. See below for an example.
(3) Supply any initial data for managed tables. This is done by writing information into a "div" with id "repository" and with data written in standard mathematical notation. For example, we would specify three rows for the p table as shown below. (When the page is loaded, this data will automatically be formatted into the tables declared as shown above.) This div may be made invisible to user (and probably should be).
p(a,b) p(b,c) p(c,d) q(1,2,3) q(2,3,4)
(4) Enter any rules in a div with id "library". This may be made invisible to user (and probably should be).
(5) If you wish to allow the user to control import, export, upload, download, publish, and subscribe, add appropriate buttons to your page. Here are some examples.
Note that these do not have to be buttons. What is important is to provide the user with a way of getting the onClick methods to run.
(6) Register all tables to be managed and initialize in a script at end of page.
Note that the loading script must be in the head and the initialization script must be at the end of the document. However, the tables being managed and the repository and library divs can appear anywhere; and they can be made visible or invisible (using the "display:none" style directive).