Skip to content

Commit

Permalink
Merge pull request #33 from davidomarf/hotfix-0.7.4
Browse files Browse the repository at this point in the history
Hotfix 0.7.4
  • Loading branch information
davidomarf authored Oct 30, 2019
2 parents be10b5b + 0cc4977 commit a5cad15
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = 'David Omar Flores Chavez'

# The full version, including alpha/beta/rc tags
release = 'v0.7.3'
release = 'v0.7.4'


# -- General configuration ---------------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion ginpar/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,15 @@ def render_index(build_path, sketches, site, page_template):

def param_to_dict(param):
param_var = list(param)[0]
if "name" in param[param_var]:
name = param[param_var]["name"]
else:
name = camel_to_space(param_var.capitalize())
return {
"var": param_var,
"id": param_var.lower(),
"attrs": param[param_var]["attrs"],
"name": param_var.capitalize()
"name": name
}


Expand Down
6 changes: 4 additions & 2 deletions ginpar/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"""
import os
import yaml
from datetime import date

import click
from jinja2 import Environment, FileSystemLoader
Expand Down Expand Up @@ -74,8 +75,9 @@ def new(sketch):

sketch_template = _jinja_env.get_template("sketch.js")
data_template = _jinja_env.get_template("data.yaml")

create_file(os.path.join(path, "sketch.js"), sketch_template.render())
create_file(os.path.join(path, "data.yaml"), data_template.render())
create_file(os.path.join(path, "data.yaml"), data_template.render(
today = date.today().strftime("%Y-%m-%d")
))

echo(f"\nYour new sketch {path} is ready.\n")
14 changes: 8 additions & 6 deletions ginpar/templates/sketch/data.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
- var: DIMENSIONS
attrs:
type: dimensions
value:
- 2048
- 2048
date: {{ today }}
params:
- DIMENSIONS:
attrs:
type: dimensions
value:
- 2048
- 2560
2 changes: 1 addition & 1 deletion ginpar/templates/sketch/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* to do it, you **must** use `var` instead of `let` or `const`.
*/

var DIMENSIONS = [400, 2048]
var DIMENSIONS = [2048, 2048]

/**
* Standard function of p5js
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import setuptools

version = '0.7.3'
version = '0.7.4'

requires = ['jinja2 >= 2.7', 'pyyaml', 'click']

Expand Down

0 comments on commit a5cad15

Please sign in to comment.