Browse Source

Merge pull request #212 from patacrep/diagrampage

Improved diagram page option
pull/216/head
oliverpool 8 years ago
parent
commit
387951713a
  1. 11
      patacrep/data/templates/songbook/default.tex
  2. 12
      patacrep/data/templates/songbook_model.yml
  3. 13
      patacrep/data/templates/styles/chords.sty
  4. 8
      patacrep/data/templates/styles/patacrep.sty
  5. 5
      patacrep/templates.py
  6. 12
      test/test_songbook/content.tex.control
  7. 12
      test/test_songbook/datadir.tex.control
  8. 12
      test/test_songbook/lang_default.tex.control
  9. 12
      test/test_songbook/lang_en.tex.control
  10. 12
      test/test_songbook/lang_fr.tex.control
  11. 12
      test/test_songbook/languages.tex.control
  12. 12
      test/test_songbook/onthefly/content.onthefly.tex.control
  13. 12
      test/test_songbook/syntax.tex.control
  14. 12
      test/test_songbook/unicode.tex.control

11
patacrep/data/templates/songbook/default.tex

@ -103,12 +103,11 @@ description:
(* block chords *)
% list of chords
\ifchorded
\ifdiagram
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\ifdiagrampage
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\setcounter{songnum}{1}%
(* endblock *)

12
patacrep/data/templates/songbook_model.yml

@ -27,7 +27,15 @@ schema:
type: //rec
required:
show: //bool
diagrampage: //bool
diagrampage:
type: //any
of:
- type: //str
value: "none"
- type: //str
value: "important"
- type: //str
value: "all"
repeatchords: //bool
lilypond: //bool
tablatures: //bool
@ -97,7 +105,7 @@ default:
chords:
show: yes
diagramreminder: important
diagrampage: yes
diagrampage: all
repeatchords: yes
lilypond: no
tablatures: no

13
patacrep/data/templates/styles/chords.sty

@ -24,7 +24,7 @@
\raisebox{2em}{\chordname{##1}} %
} %
% Placing boxes
\ifimportantdiagramonly%
\ifdiagrampagereduced%
\pl@cechord{#1}%
\hspace{\stretch{1}}%
\usebox{\@chordgroupbox@ii}%
@ -75,7 +75,17 @@
\newcommand{\chords}{
\ifdiagrampage
\begin{songs}{}
%important diagrams are hidden by \chordtabs
\renewcommand{\gtab}{\@ifstar
\gtab@Original%
\gtab@Original%
}
\renewcommand{\utab}{\@ifstar
\utab@Original%
\utab@Original%
}
%hide song number
\definecolor{SongNumberBgColor}{HTML}{FFFFFF}
\renewcommand{\snumbgcolor}{SongNumberBgColor}
@ -391,5 +401,6 @@
\fi
\end{songs}
\fi
}
\endinput

8
patacrep/data/templates/styles/patacrep.sty

@ -26,6 +26,14 @@
\newif{\iflilypondauto}
\DeclareOption{lilypond}{\lilypondautotrue\lilypondtrue}
% diagram: insert a page of diagrams before the songs
\newif{\ifdiagrampage}
\DeclareOption{diagrampage}{\diagrampagetrue}
% diagram: insert a page of the "important diagrams" before the songs
\newif{\ifdiagrampagereduced}
\DeclareOption{diagrampagereduced}{\diagrampagereducedtrue\diagrampagetrue}
% diagram: display chord diagrams at the beginning
\newif{\ifdiagram}
\DeclareOption{diagram}{\diagramtrue}

5
patacrep/templates.py

@ -296,4 +296,9 @@ def iter_bookoptions(config):
elif config['chords']['diagramreminder'] == "all":
yield 'diagram'
if config['chords']['diagrampage'] == "important":
yield 'diagrampagereduced'
elif config['chords']['diagrampage'] == "all":
yield 'diagrampage'
yield config['chords']['instrument']

12
test/test_songbook/content.tex.control

@ -26,6 +26,7 @@
chorded,
pictures,
diagram,
diagrampage,
guitar,
]{patacrep}
@ -79,13 +80,12 @@ guitar,
\showindex{\authorindexname}{authidx}
% list of chords
\ifchorded
\ifdiagram
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\ifdiagrampage
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\setcounter{songnum}{1}%
\phantomsection
\addcontentsline{toc}{section}{\songlistname}

12
test/test_songbook/datadir.tex.control

@ -28,6 +28,7 @@ chorded,
pictures,
repeatchords,
importantdiagramonly,
diagrampage,
guitar,
]{patacrep}
@ -82,13 +83,12 @@ guitar,
\showindex{\authorindexname}{authidx}
% list of chords
\ifchorded
\ifdiagram
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\ifdiagrampage
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\setcounter{songnum}{1}%
\phantomsection
\addcontentsline{toc}{section}{\songlistname}

12
test/test_songbook/lang_default.tex.control

@ -26,6 +26,7 @@ chorded,
pictures,
repeatchords,
importantdiagramonly,
diagrampage,
guitar,
]{crepbook}
@ -113,13 +114,12 @@ guitar,
\showindex{\authorindexname}{authidx}
% list of chords
\ifchorded
\ifdiagram
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\ifdiagrampage
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\setcounter{songnum}{1}%
\phantomsection
\addcontentsline{toc}{section}{\songlistname}

12
test/test_songbook/lang_en.tex.control

@ -26,6 +26,7 @@ chorded,
pictures,
repeatchords,
importantdiagramonly,
diagrampage,
guitar,
]{crepbook}
@ -113,13 +114,12 @@ guitar,
\showindex{\authorindexname}{authidx}
% list of chords
\ifchorded
\ifdiagram
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\ifdiagrampage
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\setcounter{songnum}{1}%
\phantomsection
\addcontentsline{toc}{section}{\songlistname}

12
test/test_songbook/lang_fr.tex.control

@ -26,6 +26,7 @@ chorded,
pictures,
repeatchords,
importantdiagramonly,
diagrampage,
guitar,
]{crepbook}
@ -113,13 +114,12 @@ guitar,
\showindex{\authorindexname}{authidx}
% list of chords
\ifchorded
\ifdiagram
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\ifdiagrampage
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\setcounter{songnum}{1}%
\phantomsection
\addcontentsline{toc}{section}{\songlistname}

12
test/test_songbook/languages.tex.control

@ -27,6 +27,7 @@ chorded,
pictures,
repeatchords,
importantdiagramonly,
diagrampage,
guitar,
]{patacrep}
@ -82,13 +83,12 @@ guitar,
\showindex{\authorindexname}{authidx}
% list of chords
\ifchorded
\ifdiagram
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\ifdiagrampage
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\setcounter{songnum}{1}%
\phantomsection
\addcontentsline{toc}{section}{\songlistname}

12
test/test_songbook/onthefly/content.onthefly.tex.control

@ -25,6 +25,7 @@
chorded,
pictures,
diagram,
diagrampage,
guitar,
]{patacrep}
@ -77,13 +78,12 @@ guitar,
\showindex{\authorindexname}{authidx}
% list of chords
\ifchorded
\ifdiagram
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\ifdiagrampage
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\setcounter{songnum}{1}%
\phantomsection
\addcontentsline{toc}{section}{\songlistname}

12
test/test_songbook/syntax.tex.control

@ -27,6 +27,7 @@ chorded,
pictures,
repeatchords,
importantdiagramonly,
diagrampage,
guitar,
]{patacrep}
@ -79,13 +80,12 @@ guitar,
\showindex{\authorindexname}{authidx}
% list of chords
\ifchorded
\ifdiagram
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\ifdiagrampage
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\setcounter{songnum}{1}%
\phantomsection
\addcontentsline{toc}{section}{\songlistname}

12
test/test_songbook/unicode.tex.control

@ -27,6 +27,7 @@ chorded,
pictures,
repeatchords,
importantdiagramonly,
diagrampage,
guitar,
]{patacrep}
@ -79,13 +80,12 @@ guitar,
\showindex{\authorindexname}{authidx}
% list of chords
\ifchorded
\ifdiagram
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\ifdiagrampage
\phantomsection
\addcontentsline{toc}{section}{\chordlistname}
\chords
\fi
\setcounter{songnum}{1}%
\phantomsection
\addcontentsline{toc}{section}{\songlistname}

Loading…
Cancel
Save