Skip to content

Commit

Permalink
Adds templates.
Browse files Browse the repository at this point in the history
Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>
  • Loading branch information
mkouhei committed Jan 28, 2016
1 parent 9d6609c commit b099cfd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
28 changes: 14 additions & 14 deletions bootstrap_py/templates/README.rst.j2
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{% set hr=('=' * (pkg_name|length + 2)) -%}
{% set hr=('=' * (name|length + 2)) -%}
{{ hr }}
{{ pkg_name }}
{{ name }}
{{ hr }}

TODO: Rewrite me. Append your package's long description.

Status
======

.. image:: https://secure.travis-ci.org/{{ username }}/{{ pkg_name }}.png?branch=master
:target: http://travis-ci.org/{{ username }}/{{ pkg_name }}
.. image:: https://coveralls.io/repos/{{ username }}/{{ pkg_name }}/badge.png?branch=master
:target: https://coveralls.io/r/{{ username }}/{{ pkg_name }}?branch=master
.. image:: https://img.shields.io/pypi/v/{{ pkg_name }}.svg
:target: https://pypi.python.org/pypi/{{ pkg_name }}
.. image:: https://readthedocs.org/projects/{{ pkg_name }}/badge/?version=latest
:target: https://readthedocs.org/projects/{{ pkg_name }}/?badge=latest
.. image:: https://secure.travis-ci.org/{{ username }}/{{ name }}.png?branch=master
:target: http://travis-ci.org/{{ username }}/{{ name }}
.. image:: https://coveralls.io/repos/{{ username }}/{{ name }}/badge.png?branch=master
:target: https://coveralls.io/r/{{ username }}/{{ name }}?branch=master
.. image:: https://img.shields.io/pypi/v/{{ name }}.svg
:target: https://pypi.python.org/pypi/{{ name }}
.. image:: https://readthedocs.org/projects/{{ name }}/badge/?version=latest
:target: https://readthedocs.org/projects/{{ name }}/?badge=latest
:alt: Documentation Status

Requirements
Expand All @@ -32,9 +32,9 @@ Setup
=====
::

$ pip install --user {{ pkg_name }}
$ pip install --user {{ name }}
or
(venv)$ pip install {{ pkg_name }}
(venv)$ pip install {{ name }}

Usage
=====
Expand All @@ -44,8 +44,8 @@ ToDo: Rewrite me.
::

$ python
>>> import {{ pkg_name|replace('-', '_') }}
>>> {{ pkg_name|replace('-', '_') }}.sample.hello()
>>> import {{ name|replace('-', '_') }}
>>> {{ name|replace('-', '_') }}.sample.hello()
'hello'
>>>

4 changes: 2 additions & 2 deletions bootstrap_py/templates/docs/source/index.rst.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set suffix="'s documentation" -%}
{%- set hr=('=' * (pkg_name|length + suffix|length) -%}
{{ pkg_name }}{{ suffix }}
{%- set hr=('=' * (name|length + suffix|length) -%}
{{ name }}{{ suffix }}
{{ hr }}

Contents:
Expand Down
2 changes: 1 addition & 1 deletion bootstrap_py/templates/docs/source/modules/index.rst.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ References
.. toctree::
:maxdepth: 2

.. automodule:: {{ pkg_name|replace('-', '_') }}.sample
.. automodule:: {{ name|replace('-', '_') }}.sample
:members:
:show-inheritance:
:inherited-members:
Expand Down
10 changes: 10 additions & 0 deletions bootstrap_py/templates/utils/pre-commit.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh -e

rootdir=$(git rev-parse --show-toplevel)
(
cd $rootdir
rm -rf dist .cache *.egg-info _build *.tests
find ./ -name '*.pyc' -delete
tox
python setup.py check -r
)

0 comments on commit b099cfd

Please sign in to comment.