From 1cacfa8610ea9309d8059ae6ee83f95ba3a9c9f8 Mon Sep 17 00:00:00 2001 From: Alexandre Dupas Date: Mon, 16 Aug 2010 23:32:51 +0200 Subject: [PATCH 1/3] Add both option and nooption flags --- crepbook.cls | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crepbook.cls b/crepbook.cls index eeccdc9a..5902f079 100644 --- a/crepbook.cls +++ b/crepbook.cls @@ -15,8 +15,11 @@ % Options \DeclareOption{tabs}{\tabstrue} +\DeclareOption{notabs}{\tabsfalse} \DeclareOption{lilypond}{\lilypondtrue} +\DeclareOption{nolilypond}{\lilypondfalse} \DeclareOption{nodiagram}{\nodiagramtrue} +\DeclareOption{diagram}{\nodiagramfalse} \DeclareOption{10pt}{\PassOptionsToClass{\CurrentOption}{article}} \DeclareOption{11pt}{\PassOptionsToClass{\CurrentOption}{article}} From a09ede4e77177fa2037def524b66e6664fae5a78 Mon Sep 17 00:00:00 2001 From: Alexandre Dupas Date: Mon, 16 Aug 2010 23:33:52 +0200 Subject: [PATCH 2/3] Add flag type for parameter --- songbook.py | 10 +++++++++- templates/minimal.tmpl | 7 ++++++- templates/patacrep.tmpl | 7 ++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/songbook.py b/songbook.py index ca3489db..01952d2e 100755 --- a/songbook.py +++ b/songbook.py @@ -38,6 +38,14 @@ def toValue(parameter, data): return joinText.join(data) elif parameter["type"] == "color": return data[1:] + elif parameter["type"] == "enum": + return data + elif parameter["type"] == "flag": + if "join" in parameter: + joinText = parameter["join"] + else: + joinText = '' + return joinText.join(data) def formatDeclaration(name, parameter): value = "" @@ -111,7 +119,7 @@ def makeDepend(sb, output): # check for lilypond deps (in songs data) if necessary lilypond = [] - if "booktype" in sb and "lilypond" in sb["booktype"]: + if "bookoptions" in sb and "lilypond" in sb["bookoptions"]: for filename in deps: tmpl = open(filename) lilypond += matchRegexp(lilypondPattern, tmpl) diff --git a/templates/minimal.tmpl b/templates/minimal.tmpl index 35ab9924..74c642fa 100644 --- a/templates/minimal.tmpl +++ b/templates/minimal.tmpl @@ -25,7 +25,12 @@ % Template parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%:[ -%%: {"name":"booktype", "description":"Booktype", "type":"stringlist", "default":["chorded"], "join":","} +%%: {"name":"booktype", "description":"Type", "type":"enum", "values":["chorded","lyric"], "default":"chorded", "mandatory":true}, +%%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","lilypond","tabs"], "join":",", "mandatory":true, "default":["diagram"]}, +%%: {"name":"mainfontsize", "description":"Font Size", "type":"enum", "values":["10pt","11pt","12pt"], "default":"10pt"}, +%%: {"name":"songnumberbgcolor", "description":"Number Shade", "type":"color", "default":"#D1E4AE"}, +%%: {"name":"notebgcolor", "description":"Note Shade", "type":"color", "default":"#D1E4AE"}, +%%: {"name":"indexbgcolor", "description":"Index Shade", "type":"color", "default":"#D1E4AE"} %%:] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % begin document diff --git a/templates/patacrep.tmpl b/templates/patacrep.tmpl index b7c28d3b..761aa946 100644 --- a/templates/patacrep.tmpl +++ b/templates/patacrep.tmpl @@ -25,8 +25,10 @@ % Template parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%:[ -%%: {"name":"title", "description":"Title", "default":"Recueil de chansons pour guitare"}, -%%: {"name":"author", "description":"Author", "default":"Romain Goffe \\and Alexandre Dupas"}, +%%: {"name":"title", "description":"Title", "default":"Recueil de chansons pour guitare", "mandatory":true}, +%%: {"name":"author", "description":"Author", "default":"Romain Goffe \\and Alexandre Dupas", "mandatory":true}, +%%: {"name":"booktype", "description":"Type", "type":"enum", "values":["chorded","lyric"], "default":"chorded", "mandatory":true}, +%%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","lilypond","tabs"], "join":",", "mandatory":true, "default":["diagram"]}, %%: {"name":"version", "description":"Version", "default":"3.2"}, %%: {"name":"subtitle", "description":"Subtitle"}, %%: {"name":"web", "description":"Web", "default":"http://www.patacrep.com"}, @@ -35,7 +37,6 @@ %%: {"name":"picturecopyright", "description":"Copyright", "default":"foxygamergirl@deviantart.com"}, %%: {"name":"footer", "description":"Footer", "default":"\\begin{flushleft}\\includegraphics[width=3cm]{on-fire}\\end{flushleft}"}, %%: {"name":"license", "description":"License", "default":"\\input{license.tex}"}, -%%: {"name":"booktype", "description":"Booktype", "type":"stringlist", "default":["chorded"], "join":","}, %%: {"name":"mainfontsize", "description":"Font Size", "values":["10pt","11pt","12pt"], "default":"10pt"}, %%: {"name":"songnumberbgcolor", "description":"Number Shade", "type":"color", "default":"#D1E4AE"}, %%: {"name":"notebgcolor", "description":"Note Shade", "type":"color", "default":"#D1E4AE"}, From 59add63134be9ec5194240f54b8d98406b05d7cc Mon Sep 17 00:00:00 2001 From: Alexandre Dupas Date: Mon, 16 Aug 2010 23:43:35 +0200 Subject: [PATCH 3/3] Update news entries. --- NEWS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NEWS b/NEWS index 04bc988f..177eff69 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +songbook (v0.?) + + (lohrun) Add three new type of template parameters : color, flag and enum. + (lohrun) Add a diagram option to the crepbook class. + (crep) Use LaTeX Songs package v2.11. + + -- Alexandre Dupas Mon, 16 Aug 2010 23:41:45 +0200 + songbook (v0.7) (various authors) Add songs