Skip to main content
PreProGuardian is a class that allows run many preprocessor watchers with only one command.

## Supported preprocessors stack:

SASS
Jade
Coffee

Will be extended (maybe) later, since I use it for my own projects, and will add watchers as soon as they're needed.

Needless to say, PreProGuard assumes that you have cli utilites for each of preprocessors installed.
(npm install coffeescript, npm install jade, npm install sass)

## Usage:

```
from ppguard import Guardian
g = Guardian("path/to/config.json")
g.run()
```

## Folders structure:

PreProGuardian assumes that you have two main folders - one for sources (option 'sources_root') and one
for results (option 'static_root').

For each folder in sources dir there must be one in results, but not vice versa - you can have any number
of folders and files existing only in results/.

If option 'consistency_check' is set to 1 it will ask if you want to create in compiled files folder any folders that
exists only in source folder. For example: you can create folder "stylesheets" only in sources/ dir,
and if consistency_check is set to 1, on the first run script will ask if you want to create results/stylesheets/.

## Folders to watch

config options 'sass', 'jade' and 'coffee' consists of lists of folders with respect to sources_root where
PreProGuard can find source files.

## Django management command.

I use ppguard in my django projects, with following code:

app_name/management/commands/preprocessors.py:
```
from django.core.management.base import BaseCommand
from ppguard import Guardian

class Command(BaseCommand):
def handle(self, *args, **options):
g = Guardian("/path/to/config.json")
g.run()
```
python manage.py preprocessors

:)


## Misc

It is possible (since v. 0.0.4) to pass variables to jade. You can pass them using 'jade-options' config,
and then use in your templates via #{fieldName}.

Sample config file:

{
"sources_root" : "static-sources/",
"static_root" : "static/",
"jade-options" : {"some": "Dict object", "to": "Pass into templates :)"},
"consistency_check" : 1,
"sass": ["app/styles/", "stylesheets/"],
"jade": ["app/partials/", "templates/"],
"coffee": ["app/controllers/", "app/directives/", "jquery-widgets/"]
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PreProGuardian-0.0.6.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file PreProGuardian-0.0.6.tar.gz.

File metadata

File hashes

Hashes for PreProGuardian-0.0.6.tar.gz
Algorithm Hash digest
SHA256 5a960c252a7cb9d6304802524e0f2c85a30e6a0de0715a356f69beae06acc2e1
MD5 42e1a5bfb58612d777de37906a7ad860
BLAKE2b-256 eef1f5ce6cb317e65d987ccbbbbd6873399babbe2c9180fddc7b3b808d85d5c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page