README.txt 4.65 KB
Newer Older
denis's avatar
denis committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
VISUAL CULTURE GIT VIEWER
=========================

# <http://kisskissbankbank.com/visual-culture-a-tool-for-design-collaboration>

OSP Visual Culture Git Viewer
-----------------------------

We are Open Source Publishing. A group of designers working in Brussels. We make books and posters and websites, and we do that using only Free and Open Source Software. That is because we feel it is important to have an intimate relation with our tools. If all designers use the same tools made by the same company, this is bound to make us less creative and less relevant.

For working together and sharing our source files, we use a system called Git. This system, originally developed for computer code, is great to work together. Yet when we started sharing our source code through the internet, we found all interfaces to git were geared to sharing text files. We want to create an interface for sharing our work

We have been displaying the contents of our repository in a more graphic way on our web-site: showing previews in the filelistings of the fonts and the illustrations and the pdf’s. You are now browsing through the code that makes this possible. We want to take this a whole step further still, and build this into a platform where you can in a visual way view the development of your graphic design projects, the changes in between files, and comment and share and make visible your process. [Please support our crowdfunding campaign!](http://kisskissbankbank.com/visual-culture-a-tool-for-design-collaboration)

- - -

* Note: this is for installing the Visual Culture API
  for working on the OSP website, there is a more simple
  application that interfaces with the API.
  See README-OSP.txt *

Installation
============

## OS Dependencies

### Debian / Ubuntu

Libgit2 needs to be compiled from source:

    sudo apt-get install build-essential cmake
    mkdir -p ~/src
    cd ~/src
    curl https://codeload.github.com/libgit2/libgit2/tar.gz/v0.21.2 | tar xvz
    cd libgit2-0.21.2
    mkdir build && cd build
    cmake ..
    cmake --build .
    sudo cmake --build . --target install
    sudo ldconfig

Note: if you have this error:
    ImportError: libgit2.so.0: cannot open shared object file: No such file or directory

Do:
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

### OS X

50
Note that you need to install version 0.21, so a simple
denis's avatar
denis committed
51

52
    brew install libmagic libgit2
denis's avatar
denis committed
53

54 55
might not work. Check https://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula
or install from source.
denis's avatar
denis committed
56

57
## Python modules
denis's avatar
denis committed
58

59
Next to the modules mentioned in README-OSP.md you should install the following python modules into your virtual environment:
denis's avatar
denis committed
60

61 62
pip install "python-magic<0.5"
pip install "pygit2<0.22"
denis's avatar
denis committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150


## Setting up django

From inside the `visualculture` folder:

    cp settings.py.example settings.py

In the settings file, you will at least need to change the `GIT_ROOT` setting.
This is the folder that Visual Culture will scan for git repositories.

Then run:

    python manage.py syncdb

You can then use `python manage.py runserver` to run the application. Visit
within a browser the URL `http://localhost:8000/`.


Adding vc image rendering components
------------------------------------


### Image support

pip install pillow



### PDF-SUPPORT: Poppler

#### Ubuntu/Debian

    sudo apt-get install libpoppler-cpp-dev libpoppler-qt4-dev libboost-dev libboost-python-dev libboost-system-dev libboost-thread-dev

Debian note:

1 remove the leading 'lib' from the resulting library filename
2 drop it wherever Python can find it and it will be available as a module
3 because the Debian we run on doesn't have libpoppler-cpp, I got the 0.20 tarball, compile it and installed it in the venv we use for this deployment, then adjusted PKG_CONFIG_PATH to make cmake find it

Then:

    mkdir build && cd build
    cmake ..
    make
    ln -s libvc_poppler.so ../../visualculture/visual_culture/readers/vc_poppler.so


#### OSX

    brew install poppler boost



### FONT-SUPPORT

    sudo apt-get install python-fontforge fontforge


#### OSX

    brew install fontforge



Maintenance
===========

### Empty the cache

    rm -rf {MEDIAROOT}/cache



Folder structure
================

- iceberg: images showcasing Visual Culture
- vc_pypoppler: Poppler library for PDF support in case you can't install it with your package manager
- visual: this is where Visual Culture will store its cache of rendered images during development
- visualculture: project folder
    - git_info: visual culture api
    - osp: OSP's django website
    - templates: templates for error 404 and 500
    - test_browser: a test browser
    - vc_cache: cache folder
    - visual_culture: readers of different file formats