web-skeleton
============
Generate a static `h5bp `_
html5/css/js structure, with js-yuno incorporated.
Available commands:
* init :ref:`init`
* skeleton :ref:`skeleton`
* render :ref:`render`
* gclass :ref:`gclass`
* rsync :ref:`rsync`
Install
=======
Install with::
cd
virtualenv env_web_skeleton
source env_web_skeleton/bin/activate
easy_install web_skeleton
.. warning:: remember install
sudo apt-get install ruby-compass
sudo easy_install -U scour
Quick Start
===========
.. _init:
Build a project
---------------
Create a new project directory with the command::
web-skeleton init myblog
This command creates the `myblog` directory with the next structure::
* The `web-skeleton.ini` file is the configuration file.
* The `assets` directory contains the assets skeletons.
It's the structure of the preconfigured directories
with js, css, img files, etc.
* The `htmlrendercode` contains the python code that generate the html code.
* The `tags` directory contains the final result, organized by `tag` versions.
.. _skeleton:
Create a new tag (new h5bp structure)
-------------------------------------
Create a new tag output directory with the command::
web-skeleton skeleton
Execute this command in the `myblog` directory to create a new skeleton,
a new directory in the `tags` directory with the name of the current tag.
The current tag is defined in the web-skeleton.ini file.
The selected skeleton is the one configurated in the web-skeleton.ini file.
.. _render:
Create your static html code
----------------------------
Create your index.html with the command::
web-skeleton render
This command executes the code of the `htmlrendercode` directory,
generating the content of `index.html` file.
The index.html file is created in the current tag directory.
The called code is::
from base import get_base
base = get_base(code_path, output_path, debug)
html = base.render()
`get_base` is the only function being called from web_skeleton.
The rest is up to you.
This function must return a class with a `render` method.
The `render` method must return a string with the html code.
The parameters are::
:param code_path: path where python and templates code reside.
:param output_path: current output tag directory.
:param debug: True if you want debug.
.. _gclass:
Create a new gclass
-------------------
This command create a new `gclass`::
web-skeleton gclass name
It will create four files: *name.js* and *name.css*
in the gclasss directory.
Addition to creating the files,
two symbolic links are created:
* A link to javascript file is created in the current output tag directory
plus **static/js/bottom/gclass**.
* A link to css file is created in the current output tag directory
plus **static/css/gclass**.
If some file already exists, it is not overridden.
.. _rsync:
Publish the static html code
----------------------------
You can publish your static html code in the configurated servers
with the command::
web-skeleton rsync
Assets
======
Assets currently avaiable:
h5bp+jquery
-----------
A skeleton based on:
* `html5boilerplate `_.
* `jquery `_.
* `Mako `_.
* `Webassets `_.
* `Sass `_.
* `Compass `_.
.. warning:: needed webassets >= 0.8.dev.
You need to download this webassets version
from ``_
sample-logo
-----------
It's not a skeleton.
A utility for build all icons needed in h5bp
if you have a logo in svg format.
Html render code
================
web-skeleton execute the next code when `render` command is executed::
from base import get_base
base = get_base(code_path, output_path, debug)
html = base.render()
where:
* code_path: path where python and templates code reside.
* output_path: current output tag directory.
* debug: True if you want debug.
That is, in your `htmlrendercode` directory you only need a ``base.py`` module,
with a ``get_base()`` factory function that returns a class with the
``render`` method.
In the supplied code, I use the next packages to generate html code:
* ``ghtml`` (``Mako`` and ``ginsfsm``)
* ``webassets``
web-skeleton.ini
===================
This is the initial configuration file::
[DEFAULT]
current_tag = 0.00.aa
[tags]
0.00.aa =
[0.00.aa]
assets = assets/h5bp+jquery
remote-server =
In each tag you configure the assets used to create a new tag skeleton
and the remote server to rsync the output.
The current tag it will be used with the ``render`` and ``rsync`` commands.
License
-------
Copyright (c) 2015, Niyamaka.
`web-skeleton` is released under terms of the
`MIT License `_.
Indices and tables
==================
* :ref:`genindex`
* :ref:`search`