now all editors have write permissions to all wiki
[gitology.git] / gitology-tutorial.rst
blob461ce1e8b83770b9f1178affba770c784b31b19f
1 ======================
2 Gitology Documentation
3 ======================
5 about
6 -----
8 **Gitology is a knowledge-management system**. It uses text files to store
9 data, in a special directory called a gitology repository. Gitology repository
10 itself is under a version control system. As of now only `git` is supported as
11 RCS backend.
13 features
14 --------
16 - text based
17 - blog
18 - threaded comments
19 - dependencies in one folder
20 - wiki
21 - offline-online syncronization
22 - ...
24 gitology repository
25 -------------------
27 **All knowldege base, articles, blog posts, wiki pages, albums ete; are stored
28 in a folder called gitology repository**. Gitology repository is designed to be
29 accessed manually. The structure of gitology repository is explained in
30 `gitology-repo-structure.txt`. Standard tools like `vim`, `ls`, `grep`, `find`,
31 `cat` etc can be used to work with gitology repo. Gitology also comes with a
32 set of command line scripts to help in common operations on gitology
33 repository.
35 **gitology repository lookup protocol**
37 Gitology repository can be located anywhere on the file system. Its location
38 and few other gitology related configurations are stored in a rc file. By
39 default **gitology configuration file is called** `.gitologyrc` **on unix like
40 systems and** `_gitology` **on windows**. The file is located in `$HOME`
41 directory of the user. 
43     Note: The location of configuration file can also be specified in an
44     environment variable called `GITOLOGY_CONFIG_FILE`. 
46 **creating a gitology repository**
48 New **gitology repository can be created using** `gitology-init` **command**.
49 This command comes as a part of gitology. To create gitology repository named
50 `gitology_repo`, located under `~/Documents/` folder, run the command
51 `gitology-init ~/Documents/gitology_repo`. This command will check and create a
52 gitology configuration file, `.gitology`, containing the location of newly
53 created repository.
55 **gitology repo meta files**
57 Gitology repository contains the following files:
59 editors.txt
61   This file contains the list of `openids` of users who are allowed to edit
62   documents.  Each document can contain a meta data called `editors`. This can
63   be used to specify edit permission on per document basis.  This feature is
64   used only when gitology document is being modified from web. 
66 blocked-authors.txt
68   This file contains a list of users who are not given any permissions on any
69   document in this repository. This is also used only when gitology web
70   application is being used to modify document from browser. 
72 **gitology-info**
74 *Gitology comes with a utility called `gitology-info` to find information about
75 current gitology repository**. It follows the gitology repository lookup
76 protocol to find repository location. It can tell users about the following
77 information about the gitology repository:
79 - repository location 
80 - repository size 
81 - number of documents in repository
82 - number and other information about blogs in repository
83 - information about wiki pages managed by repository
85 `gitology-info` prints a summary about repository by default. It also has a lot
86 of comman line arguments to find out specific details mentioned above and more.
87 For more details about this command run `man gitology-ingo` or `gitology-info
88 --about`.
90 **gitology repository visualization**
94     ~/Documents/gitology_repo/          <-- this is the gitology repo folder
95       |~ documents/                     <-- all documents are stored in this
96       |   |~ hello_word/                <-- document named hello_world
97       |   |   |- index.rst              <-- primary content of the document
98       |   |   |- meta.json              <-- all meta data is stored here
99       |   |   |~ replies/               <-- comments/replies stored here
100       |   |   |   |+  0/                <-- very first comment
101       |   |   |   |   |- index.rst      <-- actual comment content
102       |   |   |   |   |- meta.json      <-- meta data abt comment, auther, date
103       |   |   |   |   |+ 0/             <-- comments are nested
104       /   /   /   /   ...
105       |   |   |   |+  1/                <-- comment folder names are arbitrary,
106       |   |   |   |+  5/                    numerically ordered
107       /   /   /   ...                   <-- other replies to hello_world
108       |   |   |~ deps                   <-- dependencies are stored here
109       |   |   |   |- hello_world.gif    
110       |   |   |   |- hello_world.py
111       |   |   |   |+ somedir/           <-- dependencies can be organized
112       /   /   /   ...                   <-- other dependencies
113       /   /   ...
114       /   ...
115       |- editors.txt                    <-- openids listed here can edit stuff
116       |- blocked-users.txt              <-- blocked openids and ips
117       ...                                
119 gitology document
120 -----------------
122 **Gitology organized the knowledge in a primitive called a gitology**
123 `document`.  The document has a unique name, and is composed of content, meta
124 data, comments on the document, dependencies and versions. **Gitology**
125 `documents` **are stored in a directory called** `documents` **in gitology
126 repository**. Each document is stored as a directory named after the document's
127 name. For this reason document's name should be a valid file name. The name of
128 the document is for internal use only. Document supports meta data store which
129 can be used for storing more meaningful title of the document. 
131 The **document stores its primary content in either a text file**, an html file
132 or as a restructured text document. Other content formats would be supported in
133 future.  The format of the content is deduced from the name of the content
134 file, which is called `index`. 
136 **Meta data on document are stored in a file called** `meta.json`. Meta data is
137 stored as `key-value` pairs, and any arbitrary data can be stored as meta data.
138 Typically each document has meta data about the `author` of the document,
139 `created_on`, and `last_modified_on`, and `type`. None of these data are
140 required. 
142 **Each document can have replies associated with this document**. The replies
143 are stored in folder called `replies`. Each reply itself contains an `index`,
144 which follows the same index guideline as that for `documents`. Each reply can
145 also have meta data to store the name of the person who created that reply or
146 when was it created etc. Replies can have further replies, so a tree like
147 comment system for each document can be implemented with gitology. 
149 Further, each document can have a set of dependencies, stored in a folder
150 called `deps`. 
152 Everything in the document is under version control. `gitology python module`
153 or `git` can be used to find out history of each file in the document. 
155     Note: Some operating systems do not support large number of files in a
156     directory.  This could be a problem if the gitology repository starts to
157     become too big, and reaches the file system limits of the operating system.
158     Gitology comes with a feature that can be used to work around this by
159     further creating subdirectories inside document folder. Gitology uses md5
160     based naming scheme to overcome this limitation. This feature makes
161     guessing the name of the folder, in which a document's data is store,
162     difficult. Gitology ships with md5 use diabled. It can be enabled by adding
163     `USE_MD5=True` under `REPO` section of `.gitologyrc` file.  Gitology
164     repository with support of thie feature can be created by supplying `--md5`
165     flag to `gitology-init` command, eg: `gitology-init --md5
166     ~/Document/gitology_repo`.  `gitology-convert-repo --to-md5` or
167     `gitology-convert-repo --to-flat` can be used to convert existing
168     repositores. 
170 TODO: write about meta: `type`. Can a `document` be part of more than one
171 blog/blog and wiki etc. Can it have multiple types. It can be a `blog` and
172 `note` which is coming in future, so it should be allowed. In that case how
173 should meta properties related to different application, or different instances
174 of the same instance be handled?
176 gitology python api
177 --------------------
179 Gitology comes with a python package to work with gitology repositories. By
180 default gitology package also follows the gitologyrc lookup protocol described
181 above to find the gitology repository to work on. This package also contains
182 methods to programmatically specify the repository location and other
183 configuration options.  As of now, gitology configurations can not be changed
184 on runtime. `gitology.config.settings` contains settings that are read from
185 `gitologyrc` file, or specified programmatically.
187 The main class to work with documents in gitology is
188 `gitology.documents.Document`. It takes document name in constructor and
189 provides access to index(`Document.index`), replies(`Document.replies`),
190 dependencies(`Document.deps`), and meta data(`Document.meta`), about it. 
192 Gitology package also contains `gitology.revisions` module to look up history
193 of any part of the document. 
195 Furhter API reference can be looked up in the `api.rst` file. 
197 gitology blogs
198 ---------------
200 **Gitology repository can be used as a blogs**. Gitology repository contains a
201 folder called `blogs` for this purpose. One gitology repository can have more
202 then one blogs. 
204 *gitology tree for understanding blogs*
206 :: 
208     ~/Documents/gitology_repo/
209       |~ documents/
210       |   |+ hello_world/                   <-- some normal document
211       |   |~ blogs@links/                   <-- document about blog called links
212       |   |   |- index.rst                  <-- "about" the blog/description etc
213       |   |   |- meta.json                  <-- metadata abt blog, title etc
214       /   /   ...
215       |   |~ my_first_blog_post/            <-- a blog post
216       |   |   |- index.rst                  <-- content of blog post is here
217       |   |   |- meta.json                  <-- meta data like author/timestamp
218       |   |   |+ replies/                   <-- replies to this blog post
219       |   |   |+ deps/                      <-- deps for blog post: img etc
220       /   /   ...
221       |   |~ blog@links@labels@python/      <-- lable "python" for blog "links" 
222       |   |   |- index.rst                  <-- labels can have description
223       |   |   |- meta.json                  <-- other data abt label
224       |   |+ blog@links@labels@opensource/
225       /   ...
226       |- editors.txt
227       |- blocked-users.txt
228       |~ blogs/                             <-- all blog info is stored here
229       |   |~ links/                         <-- folder for blog called "links"
230       |   |   |~ labels                     <-- all labels are stored here
231       |   |   |   |- python.lst             <-- label python, contains all url
232       |   |   |   |- opensource.lst             of posts tagged python
233       |   |   |+ 2007/                      <-- info abt posts posted in 2007
234       |   |   |~ 2008/                      <-- for 2008       
235       |   |   |   |+ 01/                    <-- info abt posts in jan 2008
236       |   |   |   |+ 02/                    <-- feb 2008 
237       |   |   |   |+ 03/
238       |   |   |   |~ 04/
239       |   |   |   |   |-01.lst              <-- info abt posts on 1st march 08
240       |   |   |   |   |-02.lst                  contains url<space>documentname
241       |   |   |   |   |-03.lst                  <space>date posted per line
242       /   /   /   /   ...
243       |   |   |   |+ 05/
244       /   /   /   ...
245       |   |   |+ 2009/
246       /   /   ...
247       /   ...
248       ...
250 **blog folder in gitology**
252 Information about post, its document name, the url, and the time it was
253 blogged, is stored under the blog special folder. Each blog special folder,
254 like `blogs/links/` mentioned for a blog named `links` contains the following
255 folder heirarchy.
257 **blog meta data**
259 Each blog in gitology has a unique name. Information about that blog is kept in
260 a folder called `blogs/${blog_name}`. Names should be valid file names. Names
261 are also used to construct the url of the blog, the url is `/${blog_name}`. 
263 Blog name is exposed in blog's url, so it should be chosen accordingly. 
265 For each blog there is a gitology document, named: `blogs@${blog_name}`.
267 Example: for a blog named `links`, the data is stored in `blogs/links` folder
268 in gitology repository. The blog itself appears unders `/links/`. The document
269 for this blog is stored under the name `blogs@links`, physically stored in
270 `documents/blogs@links/` folder. 
272 The title of the blog is stored in `title` meta data of the blog document. A
273 blog typically has a tag line, which is stored in `subtitle` meta data of the
274 blog. Blog can also have longer description, stored in the `index` of the blog
275 document. 
277 Any document used as blog has `type` meta data `blog`.
279 To eash blog creation, gitology comes with a command `gitology-blog-start`. It
280 asks for blog name, title and subtitle and creates the document and blog folder
281 for you.  `gitology-alter-blog` can be used to change these properties of
282 existing blogs. 
284 **blog posts**
286 **Blog posts are stored as documents in gitology repository**. Any existing
287 document can be converted to blog post by using `gitology-blog-document`
288 command line tool.  This tool will ask for the blog name and name of the
289 document. It will pick the meta data `title` from the document if it exists,
290 otherwise it will prompt for the title. It will then check `url` meta data of
291 blog post document, if it does not exist it will prompt the user for it. Blog
292 post can have other meta data like `author`, `comments_allowed`,
293 `number_of_comments` etc. 
295 The content of post is stored in the document as its primary content, called
296 `document index`. 
298 To start a blog post from scratch, gitology comes with a commnd line tool
299 called `gitology-blog-new-post`. It will create a new document, ask for title,
300 and url; and open default editor of user to enter the post content. 
302 Any document that is used as a blog post is given a `type` meta data called
303 `blog_post`.
305 Gitology repository stores the connection between a blog post document, and 
306 the blog in the directory for the blog under `blogs/${blog_name}`. This folder
307 contains a folder for each year. It has folders named
308 `blogs/{%blog_name}/2008/`, `blogs/${blog_name/2009/` and so on. Each of these
309 year folders contains folders for months, eg `blogs/${blog_name/2008/01` for
310 posts in january of 2008, `blogs/${blog_name/2008/02` for posts in february
311 2008 and so on. Within each of the month folder, there are text files for each
312 date, eg `blogs/${blog_name/2008/02/01.lst` for posts on 1st of february 2008 
313 etc. The date text file contains one entry per line for each blog post. The 
314 format is: `/desired/url/of/post/ post_document_name 2008:02:01 04:30pm`. 
316 Gitology blog system does not enforce any URL scheme on blog posts. Users can
317 chose any scheme they prefer, `/writings/topic/` or `/blog/2008/02/07/topic/`
318 or even `/blog/2008/march/topic.html` and so on. 
320 Note: Gitology is designed with the mindset that a blog post can someday become
321 a wiki page if it gets popular and if author feels there is value in letting
322 others edit the post page. Gitology is also designed with the mindset that URLs
323 should not change, nor should there be duplication of content on multiple urls.
324 For all these reasons, using the term `blog` in url may be avoided, and more
325 generic url scheme should be preferred.
327 **Gitology ships with a django application that can be used to expose the blogs
328 stored in gitology repositories on web**. The application is called
329 `gitology.d`.  This application supports basic blog and threaded comments,
330 along with feeds. To learn how to use this application please see `installing
331 gitology.d` section. 
333 *offline online syncronization of gitology blog*
335 The web application lets you modify the post from the web. The comments posted
336 by visitors on web are stored in gitology repoistory under `replies` folder of
337 the document for that blog post. All these modifications are checked in the
338 revision control system used by gitology repository. The revision control
339 system can then be used to syncronize the gitology repository deployed on the
340 webserver with the one on author's local machine. 
342 **blog categories**
344 Gitology blogs support categories. Each post can have one or more categories.
346 Each category has a gitology `document` associated with it, containing meta
347 data and category description. The name of the `document` for category is based
348 on categories name and blog name. e.g. for a blog named `links`, and category
349 named `programming`, the name would be `blogs@links@labels@programming`. The
350 name of the category should be valid directory name. The actual title of the
351 category that is shown to the user is stored as meta data `title` on category
352 document. The url of category page is based on meta data `slug`, the url of
353 category page would be `/links/labelled/programming/` for the above example. 
355 Any document that is used as a blog post is given a `type` meta data called
356 `blog_label`. 
358 A category is associated to a blog by means of a text file named after category
359 name. This text file resides in the folder
360 `blogs/${blog_name}/labels/%{category_name}.lst`. The text file contains the
361 urls of the blog posts that have this category. For example all posts in blog
362 `links` that belong to `programming` category are stored in the mentioned
363 `.lst` file, one url per line. Each post url can appear in one or more
364 category's `.lst` file.
366 The `document` for blog post also contains category information as document
367 meta data.  This is the master source of category information, and all category
368 `.lst` files can be generated based on this using the gitology tool
369 `gitology-sync`. The category information stored in blog post document's
370 meta data will be updated by `gitology-blog-document`. 
372     NOTE: `gitology-blog-document` comment can be used multiple time on the
373     same blog document to update information about blog document. You can edit
374     the title of a blog post or its categories after blogging it first, but
375     rerunning this command line tool. 
377 gitology wiki
378 -------------
380 Gitology comes with a wiki system. Any `document` stored in gitology repository
381 can be exposed to web as a wiki page. Gitology wiki comes with fine grained
382 permission system to control who can view or edit the document online. 
384 *wiki in gitology repository*
388     ~/Documents/gitology_repo/
389       |~ documents/
390       |   |+ python/                    <-- document to be put on wiki
391       |   |+ python-meta-programming/   <-- another document for wiki
392       /   /   ...
393       |- editors.txt
394       |- blocked-users.txt
395       |+ blogs/
396       |~ wiki/                          <-- this maps documents to url
397       |   |- python.txt                 <-- this represents url /python/,
398       |   |~ python/                        contains "python", document name
399       |   |   |- meta-programming.txt   <-- url: /python/meta-programming/
400       /   /   ...                       <-- other wiki urls
401       /   ...
402       ...
404 **creating wiki pages**
406 To expose an existing `document` as wiki, gitology comes with a command line
407 tool called `gitology-wiki-document`. This command takes the name of the
408 `document` and the `url` at which it should be accessible, along with read and
409 write permissions. Gitology also comes with a command to create a new
410 `document` and simultaneously expose it to web as wiki, called
411 `gitology-wiki-new`. 
413 Gitology wiki does not enforce any url scheme. And documents can go to any
414 arbitrary url, `/wiki/python/` or `/articles/python/` or even
415 `/somepath/python.html` etc. Gitology is designed to make it easy for users to
416 convert a wiki document to blog post on a later date, or vice versa. For this
417 reason gitology recommends not using wiki as part of url, and organize document
418 urls in more natural fashion. 
420 Gitology repository contains a folder called `wiki`. If a document named
421 `python` is exposed to web on url `/python_tips/`, `gitology-wiki-document` or
422 `gitology-wiki-new` will create a file named `python_tips.txt` under the folder
423 `wiki`. This text file will contain the name of the document in it, in this
424 case `python`. URL heirarchy can be achieved by creating folder heirarchy in
425 `wiki` folder. eg to expose a document named `python` to web as wiki on the
426 url`/articles/python-tips/`, gitology will create
427 `wiki/articles/python-tips.txt`. This fille contain `python` which is the name
428 of the document. 
430 `gitology-wiki-document` can be called repeatedly on any `document` or url, to
431 alter the document name or url or any other meta data controlling wiki, for
432 example authorship permission.
434 Gitology wiki supports a threaded comment system. Comments are stored in
435 `replies` folder of the document that is exposed as wiki. 
437 Gitology web application can authenticate users using openid, and openid's of
438 users can be given permissions to view and or edit the document online.
440 gitology's django web application
441 =================================
443 Gitology comes with a package `gitology.d`. It is a django application and can
444 be plugged into any existing django website. Gitology source distribution comes
445 with an example project, `amitucom`, that can be used as starting point for
446 intigrating `gitology.d` with django projects. 
448 Gitology stores all its relevant files as text files in the gitology
449 repository. For this reason`gitology.d.models` do not expose any models. There
450 are basically some views and templates and a urls.py file connecting views to
451 urls. 
453 There are a lot of url's that are read from gitology repository and are not to
454 be hard coded in django project. Example include things like the names of
455 blogs, and their urls, wiki pages etc. Gitology dynamically constructs the
456 `urlconf` object in a middleware, `gitology.d.middleware.GitologyMiddleware`. 
458 For performace reason, `GitologyMiddleware` caches the `urlconf` object in
459 memory unless a text file, `gitology.cache` is updated.
461 Gitology comes with a utility called `gitology-sync` that should be called
462 everytime something in gitology repository is changed that should change url
463 configuration, like a new post getting added to some blog or some old wiki
464 getting removed. Gitology tools like `gitology-blog-*`, `gitology-wiki-*`
465 automatically call `gitology-sync` to keep things in sync. If gitology
466 repository has been modified by external commands, that gitology is designed to
467 facilitate, `gitology-sync` should be called from time to time.
469 **adding gitology.d in a django project**
471 Follow the following steps to add `gitology.d` to a django project:
473 #. add 'gitology.d' to `INSTALLED_APPS` in `settings.py` so that `templatetags`
474    shipped with gitology are available to templates.  
476 #. add the following at the end of your `urls.py`:
480    import gitology.d.urls
481    urlpatterns += gitology.d.urls.urlpatterns
483 3. add `gitology.d.middleware.GitologyMiddleware` to your `MIDDLEWARE_CLASSES`
484    in `settings.py`. 
486 #. add the following in `settings.py` so that django can read templates stored
487    in gitology repository:
491    from gitology import settings as gsettings
492    TEMPLATE_FOLDERS = (gsettings.LOCAL_REPO_PATH.joinpath("templates"), )
495 You will also have to tell `gitology.d` about the `.gitologyrc` configuration
496 file. This can be achieved by setting `GITOLOGY_CONFIG_FILE` environment
497 variable before importing `gitlogy.d` modules. 
499 `GITOLOGY_CONFIG_FILE` environment variable can be set in `modpython` projects
500 by adding a `SetEnv GITOLOGY_CONFIG_FILE /location/of/gitologyrc` in apache's
501 httpd.conf. Another way to achieve the same could be to programatically set
502 environment variable in `settings.py` eg, inside `settings.py`::
504         import os
505         os.environ["GITOLOGY_CONFIG_FILE"] = "/path/of/gitlogyrc"
507 gitology command line tools
508 ---------------------------
510 Gitology comes with a variety of tools to make working with gitology repository
511 easy.
513 **common options**
515 All `gitology-*` command line tools follow a few common options. 
517 -h, --help:
518     Show the help about the command line arguments, and exit.
520 --about:
521     Show a brief description of what this tool does, and exit.
523 --version:
524     Version of gitology being used, and exit. 
526 --rc=GITOLOGY_RC_FILE_LOCATION:
527     Location of gitology rc file can be overwritten for the execution of this
528     command by specifying this command line parameter.
530 **gitology-init**
532 `gitology-init` is used for creating a new gitology repository. If no option is
533 supplied it asks for a location where repository should be created. Repository
534 name can also be supplied as command line argument. It also takes the following
535 options:
537 --use-md5: 
538     If this command line option is supplied, a md5 based repository would be
539     created. This is useful if the repository is going to have a large number
540     of documents and file system can not support that many files in one
541     directory. This table lists number of documents allowed for various file systems:
542    
543     ==========  =====================================
544     Filesystem  Maximum umber of files in a directory
545     ==========  =====================================
546     fat32       65535
547     ntfs        TK
548     ext3        TK
549     reiserfs    TK
550     ==========  =====================================
552     While systems can handle a large number of folders inside a single folder,
553     the recommended number for windows is about 10,000 after which md5 based
554     folder structure should be considered. 
556     For simplicyty, gitology uses a non md5 based directory structure for
557     repository.
559     The tool `gitology-convert-repo` can be used to convert repository with md5
560     to one without md5 and vice versa.
562 --rcs=RCS_TO_USE: 
563     Revision control system to use. Gitology 0.1 only support `none` and `git`
564     as the revision control systems. The default value for this parameter is
565     `git`.
567 **gitology-info**
569 If no command line arguments are supplied, this command prints a summary of
570 gitology repository.  Exact details can be tweaked by the following command
571 line arguments:
573 --rc-file:
574     Print the file name of the rc file being used, and exit. The default is
575     `$HOME/.gitologyrc` for unix like systems and `$HOME/_gitologyrc` under
576     windows like system. Default can be overwritten by environment variable
577     `GITOLOGY_CONFIG_FILE`. This parameter first reads the environment variable
578     and then checks the default rc file path for the operating system in use. 
580 --repo-path:
581     Print the location of gitology repository, and exit. It follows gitology
582     repository lookup protocol for this purpose.
584 --repo-size:
585     Prints the size of repository in human readable format, and exits.
587 --number-of-documents:
588     Prints the number of documents in the repository, and exists.
590 --document=DOCUMENT_NAME:
591     Prints information about the document, end exits. The following information
592     are printed: its size, creation time, author, 
594 --blogs:
595     Prints all blogs and their titles, and exits.
597 --blog[=BLOG_NAME]:
598     Prints information about the blog whose name is given and exits. If no name
599     is supplied, special name `main` is assumed.
601 --url=URL:
602     Prints the application used by the url and other properties when available,
603     and exits. 
605 **gitology-sync**
607 Gitology requires some files that are autogenerated for proper functioning.
608 This command can be used to regenrate those files. As of now the only files are
609 `label.lst` files in `blogs/$(blog_name)/labels/` folders. Also it `touches`
610 the `url.cache` file to force webserver to reload `urlconf` from filesystem. It
611 stores latest timestamp in the `url.cache` file so that last modification time
612 of this file is always chaning whenever something else changes in the
613 repository. This behaviour is used by django middleware that comes with
614 gitology, `gitology.d.midddleware.GitologyMiddleware`.
616 This command supports the following arguments:
618 --blogs:
619     Only regenrate files related to blogs. 
621 --blog=BLOG_NAME:
622     Only regenerate files for the blog whose name is `BLOG_NAME`.
625 **gitogoy-document-create**
627 This command can be used to create a new document. It takes the name of the new
628 document to be created on the command line as the only argument. If no document
629 name is supplied, it asks for the document name interactively. 
631 By default on creating the new document, gitology goes to folder required for
632 this document. This is achieved by making this command a bash function and it
633 should be included in user's or system's `bashrc` file. This behaviour is only
634 available on unix like systems with working bash or an equivalent shell. 
636 This command's behaviour can be tweaked by the following options:
638 --no-cd: 
639     Do not change current directory to the new document's folder.     
641 **gitology-document-cd**
643 Change the current directory to the document's folder whose name is supplied on
644 command line. If no name is specified, it will interactively ask for it. 
646 **gitology-document-search**
648 This command can be used to list document names that match various search
649 criteria. If no arguments are given it takes the argument provided on command
650 line and matches it against all document names, meta information, document
651 content, replies, and dependencies file names and dependency content for text
652 files. 
654 --name[=REGULAR_EXPRESSION]:
655     This will print documents whose name matches the given regular expression.
656     If no regular expression is provided, it will assume that the command line
657     argument provided should only be matched with document names. 
659 --meta[=NAME[=VALUE]]: 
660     This can be used to match documents with some meta info.  If no NAME or
661     VALUE are specified, it will take the command argument and match it only
662     against meta information of all documents. 
664     If NAME is supplied, it lists all document that has a meta attribute named
665     NAME set.
667     If both NAME and VALUE are supplied, it lists all documents that has a meta
668     attribute named NAME and its value matches with the regular expression
669     passed as VALUE.
671 --content[=EXPRESSION]:
672     This will force search within document content. If EXPRESSION is supplied,
673     document list will be further narrowed down to documents whose content
674     matches the passed expression.
676 --reply[=EXPRESSION]:
677     If this argument is used but no EXPRESSION is supplied, it will search for
678     documents that have a comment whose index contains the regular expression
679     provided on command line. 
681     If EXPRESSION is supplied, it will be used instead as the regular expression.
682     
683     Further arguments are possible to match documents with less than or more
684     than a given number of comments. 
686 --deps[=EXPRESSION]:
687     Search within dependencies.
689 --deps_name[=EXPRESSION]:
690     Search documents that contain a dependency named on command line. 
692 **gitology-document-rename**
694 This command takes two command line arguments, document by name given by first
695 parameter is renamed into second parameter.  This further updates corresponding
696 files in `/blogs/` and `/wiki/` and other places within gitology repository
697 that hard codes document name. 
699 **gitology-document-delete**
701 Deletes the document whose name is given on command line. If the document is
702 being used as part of something, it prints information about it and exits
703 without deleting the document.
705 -f, --force:
706     This can be used to force deletion of a document even when its being used
707     by some other program. This will most probably break things so use it with
708     caution.
710 **gitology-document-info**
712 This lists various information about the document.
714 -m, --show-meta:
715     This will display all meta data of the document.
718 **gitology-blog-start**
720 This command line utility can be used to start a new blog. It takes blog name
721 as command line parameter. If name is not supplied it asks for it. It also
722 looks for title, subtitle of the blog, if they are not supplied via command
723 line arguments, it asks for them interactively.
725 --title=TITLE:
726     Use TITLE as the title of the blog. 
728 --subtitle=SUBTITLE:
729     Use SUBTITLE as the subtitle of the blog. 
731 **gitology-blog-document**
733 This command takes the document name from command line, and adds it as a post.
734 The blog to use where this post will go is provided as a separate command line
735 parameter. 
737 --blog-name=NAME:
738     Name of the blog to use. If this option is not supplied, it is asked
739     interactively. 
741 --title=TITLE:
742     If this option is not supplied, this command will try to read title from
743     document's meta data named `title`.
745     If the title entered by user is not the same as the `title` metadata of the
746     document, this command can optionally change the document meta data of the
747     document. 
749 --timestamp=TIMESTAMP:
750     This optional paramter can be used to change the timestamp on which the
751     blog is being posted. If not provided, current timestamp is used instead. 
753 --url=URL:
754     URL on which the blog post should appear. 
756 --label=LABEL_NAME1[,LABEL_NAME2[,...]]:
757     Set the labels for the given post. More than one names can be supplied. If
758     those labels don't exist, they will be created on demand, after confirming
759     with the user.  Label meta data will also be asked during that step. 
761 **gitology-wiki-document**
763 This command takes the document name from command line, and adds exposes it as
764 a wiki page.
766 --url=URL:
767     URL on which the wiki should appear. 
769 importing existing blogs and wiki into gitology
770 -----------------------------------------------
772 Gitology source distribution comes with an example import script, under
773 `src/importers` folder, that reads blog data from a json file and creates a
774 gitology repository based on it. 
776 In future gitology will include tools to import blog and wiki data from
777 wordpress, blogger, liverjournal, mediawiki etc. [HELP needed :-)]
779 installation
780 ------------
782 Gitology is composed of gitology-core and gitology.d, a django application. 
784 Gitology core consists of a set of command line scripts to work with gitology
785 repositories, and a django app to expose the repo on web.
787 **gitology core dependencies**
789 #. Python 2.4 or above
790 #. Django 1.0 or above.
791 #. git
793 **gitololgy.d, django app dependencies**
795 #. gitology core
796 #. python-yadis
797 #. python-openid 2.2.1 or above
798 #. django-openid [branch=openid-2.0+auth]
799 #. docutils
801 **installing dependencies on ubuntu**
803 *installing django*
805 First confirm that you don't have old version of django installed.
809     $ python
810     >>> import django
811     >>> django
812     Traceback (most recent call last):
813       File "<stdin>", line 1, in <module>
814     ImportError: No module named django
815     >>> 
817 If you don't get the above exceptiom, you may have some django installed. Check its version:
821     $ python
822     >>> import django
823     >>> django.VERSION
824     >>> django.VERSION
825     (1, 0, 'final')
826     >>> 
828 Django versions less than 1.0 is not supported. 
830 How to delete old version of django:
834     $ python 
835     >>> import django
836     >>> django
837     <module 'django' from '/home/amitu/Projects/Django/django/__init__.pyc'>
838     >>> raise SystemExit
839     $ rm -rf $(the folder that contains old django). 
841 Get new django:
845     $ wget http://www.djangoproject.com/download/1.0.2/tarball/
846     $ tar -xzf Django-1.0.2-final.tar.gz
847     $ cd Django-1.0.2-final
848     $ sudo python setup.py install
850 *installing python-yadis*
854     $ sudo easy_install python-yadis
856 If you get an error saying command not found for easy_install, install 
857 setuptools first:
861     $ sudo apt-get install python-setuptools
863 *installing python-openid 2.2.1*
867     $ wget http://openidenabled.com/files/python-openid/packages/python-openid-2.2.1.tar.gz
868     $ tar -xzf python-openid-2.2.1.tar.gz
869     $ cd python-openid-2.2.1
870     $ sudo python setup.py install 
872 *installing django-openid*
876     $ svn checkout http://django-openid.googlecode.com/svn/branches/openid-2.0+auth/django_openidconsumer
878 Because django-openid does not come with an installation method as yet, you
879 will have to manually copy it on of the folders in python's path. To get the
880 system folders on python path, do the following:
884     $ python
885     >>> import sys
886     >>> print sys.path
888 It will list a directories, copy django_openidconsumer in any of the
889 directories there.
891 *Installind docutils*
895     $ sudo apt-get install python-docutils
898 **installing gitology**
900 :: 
902     $ git clone http://repo.or.cz/r/gitology.git
903     $ cd gitology
905 *To test gitology before installing, do the following*
907 :: 
909     $ python setup.py test
910     $ sudo python setup.py install
912 *To test gitology works*
916     $ gitology --version
917     0.1
918     $ 
920 Congratulations! Please file file bug report at so and so. Patches and feedback
921 most welcome.
923 *Bonus: bash auto completion script*
925 Gitology comes with a powerful auto completion script to assist command line
926 usage. It is installed by the name `gitology-bash-completion`. It can be
927 enabled by adding the following line to your `~/.bashrc` file. It can also be installed system wide
928 by placing it unders `/etc/bash.d/`...