Re: [fossil-users] milestone: libfossil CGI demo

2014-02-17 Thread Stephan Beal
On Sun, Feb 16, 2014 at 4:38 PM, Stephan Beal sgb...@googlemail.com wrote:

 Here's a more interesting example:


Even more so, a (very!) simple manifest browser:

http://fossil.wanderinghorse.net/repos/libfossil/cgidemo/index.cgi/manifest?version=trunkbaseline=1
http://libfossil.local/th1ish.cgi/manifest?version=1

With a bit of JS we could do some interesting things with that. The source
code for that page:

http://fossil.wanderinghorse.net/repos/libfossil/cgidemo/index.cgi/manifest?showSrc=1

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] milestone: libfossil CGI demo

2014-02-17 Thread Stephan Beal
On Mon, Feb 17, 2014 at 11:10 PM, Stephan Beal sgb...@googlemail.comwrote:

 http://libfossil.local/th1ish.cgi/manifest?version=1


That obviously should have been:

http://fossil.wanderinghorse.net/repos/libfossil/cgidemo/index.cgi/manifest?version=1

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] milestone: libfossil CGI demo

2014-02-16 Thread Stephan Beal
On Sat, Feb 15, 2014 at 11:17 PM, Stephan Beal sgb...@googlemail.comwrote:

 The majority of the implementation is demonstrated in this script:


 http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/finfo?name=th1ish/cgi-init.th1ish


Here's a more interesting example:

http://fossil.wanderinghorse.net/repos/libfossil/cgidemo/index.cgi/timeline?limit=101

which is implemented by this small script:

http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/finfo?name=th1ish/pages/timeline.th1ish

Happy Fossiling!

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] milestone: libfossil CGI demo

2014-02-16 Thread Jonathan Otsuka
Is there an interface yet to the wiki? I have been wanting to change/add a few 
things. 

I want to add a full text search for wiki bodies.

I guess I could look into adding that into normal fossil. 

Jonathan Otsuka

 On Feb 16, 2014, at 9:38 AM, Stephan Beal sgb...@googlemail.com wrote:
 
 On Sat, Feb 15, 2014 at 11:17 PM, Stephan Beal sgb...@googlemail.com wrote:
 The majority of the implementation is demonstrated in this script:
 
 http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/finfo?name=th1ish/cgi-init.th1ish
 
 Here's a more interesting example:
 
 http://fossil.wanderinghorse.net/repos/libfossil/cgidemo/index.cgi/timeline?limit=101
 
 which is implemented by this small script:
 
 http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/finfo?name=th1ish/pages/timeline.th1ish
 
 Happy Fossiling!
 
 -- 
 - stephan beal
 http://wanderinghorse.net/home/stephan/
 http://gplus.to/sgbeal
 Freedom is sloppy. But since tyranny's the only guaranteed byproduct of 
 those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
 ___
 fossil-users mailing list
 fossil-users@lists.fossil-scm.org
 http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] milestone: libfossil CGI demo

2014-02-16 Thread Stephan Beal
On Sun, Feb 16, 2014 at 8:34 PM, Jonathan Otsuka djg...@gmail.com wrote:

 Is there an interface yet to the wiki? I have been wanting to change/add a
 few things.


There's a library interface for loading/storing wiki content:

http://fossil.wanderinghorse.net/repos/libfossil/doxygen/fossil-content_8h.html#a47f91b6c7f68877b578a4cb20ed07fbd

but not yet a script-side interface. libfossil also does not do fossil's
wiki parsing - that will eventually be ported into a higher-level layer.

I want to add a full text search for wiki bodies.


The API gives you enough tools to fetch the contents of each version for
your indexing purposes. i don't see an API for fetching historic versions
of a page, but recently wrote an SQL query to fetch that history[1], so
that feature's just a matter of time.

I guess I could look into adding that into normal fossil.


Doing a real-time search across all versions would (IMO) not be feasible,
in terms of performance. Fetching historical versions of content is
extremely memory hungry - it can easily cost a total of 100MB in
de/re-allocations to fully resolve a small file's contents through the
generations (peak memory is normally much lower). However, collecting and
indexing the (immutable) data is not generically a problem. Indexing the
wiki pages when they're saved would also be a good idea, and libfossil
provides a callback hook which clients can use to be notified of artifacts
being saved (which includes wiki pages). That could also be used to take it
to the next logical step and index file content when it arrives.

[1] =
http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/finfo?name=sql/q-wiki-lineage.sql


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] milestone: libfossil CGI demo

2014-02-15 Thread Stephan Beal
Hi, all!

This is a tiny step, but an important one: using libfossil to serve data
over CGI (not that libfossil knows anything at all about CGI):

http://fossil.wanderinghorse.net/repos/libfossil/cgidemo/index.cgi

it's not much, but the contents of the JSON data show us some info pulled
from a fossil repo. Perhaps the most interesting part is that the CGI app
is entirely written in a scripting language, not C: that CGI script runs a
script interpreter which knows small bit about how to use Fossil, and the
script dispatches to a function based on the path of the page, e.g.:

http://libfossil.local/th1ish.cgi/foo/bar/baz (note the different
Content-Type)
or:
http://fossil.wanderinghorse.net/repos/libfossil/cgidemo/index.cgi/snap
or:
http://fossil.wanderinghorse.net/repos/libfossil/cgidemo/index.cgi/cookie
or:
http://fossil.wanderinghorse.net/repos/libfossil/cgidemo/index.cgi/noSuchPage

It's in its infancy stages, but the proof of concept is now there.

The majority of the implementation is demonstrated in this script:

http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/finfo?name=th1ish/cgi-init.th1ish

Happy Fossiling!

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users