Skip to content

Commit fc7f48e

Browse files
First Version
0 parents  commit fc7f48e

19 files changed

+1040
-0
lines changed

.gitignore

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
db.sqlite3
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# Environments
85+
.env
86+
.venv
87+
env/
88+
venv/
89+
ENV/
90+
env.bak/
91+
venv.bak/
92+
93+
# Spyder project settings
94+
.spyderproject
95+
.spyproject
96+
97+
# Rope project settings
98+
.ropeproject
99+
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Adriano Romanazzo (Multiverse Kid)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
prune pug4py.egg-info
2+
3+
include pug4py/pug_compile.js
4+
include pug4py/yarn.lock
5+
include pug4py/package.json

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Pug4Py - Pug Templates for Python
2+
3+
What is pug4py?
4+
-------------
5+
6+
Pug4Py is a simple script that allows you to use all the functions of Pug (NodeJs)
7+
in any python framework with the addition that you can also use the
8+
mako syntax (a popular and fast template engine for python).
9+
10+
Here is a small example of usage:
11+
12+
```python
13+
from pug4py.pug import Pug
14+
15+
pug = Pug("pug")
16+
17+
def say_hello():
18+
return "Hello World"
19+
20+
pug.render("example.pug", say_hello=say_hello, year="2019", author="https://github.com/multiversecoder/pug4py")
21+
22+
```
23+
24+
25+
Requirements
26+
------------
27+
28+
You need Python 3.7 or later to run pug4py, node v12.10.0 and yarn
29+
30+
In Ubuntu, Mint and Debian you can install Requirements like this:
31+
32+
$ apt-get install python3 python3-pip
33+
$ curl -sL https://deb.nodesource.com/setup_12.10.0 | sudo -E bash -
34+
$ apt update && apt install nodejs
35+
$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
36+
$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
37+
$ apt update && apt install yarn
38+
39+
40+
For fedora
41+
42+
$ dnf install python3 python3-pip
43+
$ curl -sL https://deb.nodesource.com/setup_12.10.0 | sudo -E bash -
44+
$ dnf update && dnf install nodejs
45+
$ curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo
46+
$ dnf install yarn
47+
48+
For other systems
49+
50+
- Install Python3
51+
- Install Nodejs
52+
- Install Yarn
53+
54+
Pug Installation
55+
-----------------
56+
57+
Pug will be installed implicitly when the Pug class is initialized and installed inside the pug4py package directory
58+
59+
Quick start
60+
-----------
61+
62+
pug4py can be installed using pip:
63+
64+
$ python3 -m pip install -U pug4py
65+
66+
or:
67+
68+
$ pip install pug4py
69+
70+
for install pug4py from source:
71+
72+
$ git clone https://github.com/multiversecoder/pug4py
73+
$ cd ./pug4py
74+
$ pip install .
75+
76+
77+
Development status
78+
------------------
79+
80+
pug4py is beta software, but it has already been used in production and it has an extensive test suite.
81+
82+

pug4py/__init__.py

Whitespace-only changes.

pug4py/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "pug4py",
3+
"version": "1.0.0",
4+
"description": "Pug4Py is a tool that allows you to integrate Pug js as a templating engine into any Python framework.",
5+
"main": "index.js",
6+
"repository": "https://github.com/multiversecoder/pug4py",
7+
"author": "Adriano Romanazzo",
8+
"license": "MIT",
9+
"private": true,
10+
"dependencies": {
11+
"pug": "^2.0.4"
12+
}
13+
}

0 commit comments

Comments
 (0)