Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "weblog"

Title:weblog
Rating:Not rated. Create the first rating!
Latest version:0.0.5
SHA1 sum:cc541108b8cbcda99b5bfdd9cc89f30c8895f201
Author:Anne Ogborn <anniepoo@yahoo.com>
Packager:Wouter Beek <me@wouterbeek.com>
Home page:https://github.com/Anniepoo/weblog
Download URL:https://github.com/Anniepoo/weblog.git

Reviews

Write a review or add a rating.

Weblog's the bestest thing in the whole world!

author
- Norbon Weenblat
See also
- http://www.swi-prolog.org/pack/list?p=evil
Thursday 11 July 2013, Anne Ogborn

Details by download location

VersionSHA1#DownloadsURL
0.0.157ccadf457725f01108fd232ad9c121e2f0f080b1https://github.com/Anniepoo/weblog.git
e4466459524e40d8e9d28abeb40fd1f59cc15f8c1https://github.com/Anniepoo/weblog.git
0.0.2416a8bdcb256f9eb65d7296d7213c9ac79607a4d1https://github.com/Anniepoo/weblog.git
0.0.34934d39dea48fe5efc5587bb1cc71222781356bf3https://github.com/Anniepoo/weblog.git
0.0.56376e7af562e34450c8346876c79dfbe1a24a55b6https://github.com/Anniepoo/weblog.git
64ffb23a8b1af14a1115b03bea25c733d4fffcdc11https://github.com/Anniepoo/weblog.git
cc541108b8cbcda99b5bfdd9cc89f30c8895f20112https://github.com/Anniepoo/weblog.git

weblog

Web Library for SWI-Prolog Rev 0.1.0

Licensed under the Lesser General Public License Vers. 3, June 2007

https://www.gnu.org/copyleft/lesser.html

A copy of which should accompany this library

SWI-Prolog ships with an excellent web framework. This library builds on that work and is not a 'web framework'. It is, instead, a library of predicates that ease doing common web tasks.

Some of the code is simply snippets that are extracted from SWI-Prolog related stuff, or other sources, but I've tried to extract everything to the point that it's a reasonable library.

Currently, users should expect that almost anything can change.

Install

Other than having a normal SWI-Prolog install, the only install step is to clone from github or install from the pack, and set keys for the various functionality

Setting keys: For the demo, at the moment, this is the two map providers, google and cloudmade.

copy weblog/keys/cloudmadekey.pl.example to weblog/keys/cloudmadekey.pl and modify cloudmadekey.pl with your key

repeat for google

Starting

The demo may be started by consulting debug.pl in the demo and querying weblogdemo:weblog_demo.

Libraries

Every subdirectory has a README.md that explains the contents of that directory

demo Every major module (ideally) has a demo page. Examining the demo code is often an excellent way to learn to use a feature.

docs Documentation for weblog.

under /prolog

debug_page Loading these modules causes your server to serve a couple pages with useful debug info

formatting tools for assisting with tables, boxes, and other page layout

html_form validated html forms.

info subdirectories contain tools for displaying various sorts of information. This includes tools for displaying specific types of info, handling feeds (geohashing data, geocoding), and often a combination of those (e.g. twitter buttons).
keys Some third party providers (feeds) require a user key be provided. This directory holds the keys
login_prototype Tools to make logging in easier. We recognize this is a big project, so for the moment it's a prototype (thanks Thanos!). We'll make a user directory that handles login, registration, security roles, and profiles some day.

nav Navigation widgets - menus, links, etc. etc.

resources resource definitions for other modules, definitions of commonly used javascript libs

static static files needed by other parts of weblog

support We're trying really hard to have as small a required footprint as possible. These are a few utility bits that have generally been useful (eg html comments handling).

Manifesto

The library should remain bits and pieces you can use as you like, with little cost of inheriting weblog. If all you want is the accordion widget you shouldn't have to change your whole way of coding to get it.

The only real 'common' pieces are */resources*, which defines the resource inclusion names, and */static* which holds the various bits of javascript needed by the various widgets. For the moment a truly lean install of weblog might require a bit of picking through those.

A Common Pattern

Web widgets often need a lot of rather trivial parameters and for which there are often good defaults.

A very common pattern for our widgets is to provide a closure which is called with a partially instantiated extra argument. The closure instantiates some variables to return info to the widget. This pattern gives the user flexibility. Simple uses can just use facts as the closure. More complex uses can be described with rules, in 'family tree' style code.

Contributing

We emphatically welcome contributions. Because this is more a 'toolbox' library than a unified framework, it's particularly easy to contribute. Weblog is an ambitious project, far beyond what one person can do. It's definitely intended to be a kitchen sink project. It's Genesis was collecting existing code written for various projects.

Code should generally follow the style conventions of

http://www.ai.uga.edu/mc/plcoding.pdf

with the 'comma spacing by use' convention.

Comments should generate reasonable pldoc. For a tutorial on pldoc use, see

http://www.pathwayslms.com/swipltuts/pldoc/

Contributions should include a demo page.

So far I've done a laughably bad job of following this myself.

Contributors

We'd like to thank the following folks:

  • Anne Ogborn - tables, forms, accordion, maps
  • Thanos Tintinidis - login and forms
  • Jan Wielemaker - original google maps code, and of course SWI-Prolog!
  • University of Houston - contributed the original library
  • Wouter Beek - converted to pack

Contents of pack "weblog"

Pack contains 111 files holding a total of 2.8M bytes.