Browse Source

Merge pull request #212 from patacrep/diagrampage

Improved diagram page option
pull/216/head
oliverpool 9 years ago
parent
commit
387951713a
  1. 5
      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. 6
      test/test_songbook/content.tex.control
  7. 6
      test/test_songbook/datadir.tex.control
  8. 6
      test/test_songbook/lang_default.tex.control
  9. 6
      test/test_songbook/lang_en.tex.control
  10. 6
      test/test_songbook/lang_fr.tex.control
  11. 6
      test/test_songbook/languages.tex.control
  12. 6
      test/test_songbook/onthefly/content.onthefly.tex.control
  13. 6
      test/test_songbook/syntax.tex.control
  14. 6
      test/test_songbook/unicode.tex.control

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

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

12
patacrep/data/templates/songbook_model.yml

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

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

@ -24,7 +24,7 @@
\raisebox{2em}{\chordname{##1}} % \raisebox{2em}{\chordname{##1}} %
} % } %
% Placing boxes % Placing boxes
\ifimportantdiagramonly% \ifdiagrampagereduced%
\pl@cechord{#1}% \pl@cechord{#1}%
\hspace{\stretch{1}}% \hspace{\stretch{1}}%
\usebox{\@chordgroupbox@ii}% \usebox{\@chordgroupbox@ii}%
@ -75,7 +75,17 @@
\newcommand{\chords}{ \newcommand{\chords}{
\ifdiagrampage
\begin{songs}{} \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 %hide song number
\definecolor{SongNumberBgColor}{HTML}{FFFFFF} \definecolor{SongNumberBgColor}{HTML}{FFFFFF}
\renewcommand{\snumbgcolor}{SongNumberBgColor} \renewcommand{\snumbgcolor}{SongNumberBgColor}
@ -391,5 +401,6 @@
\fi \fi
\end{songs} \end{songs}
\fi
} }
\endinput \endinput

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

@ -26,6 +26,14 @@
\newif{\iflilypondauto} \newif{\iflilypondauto}
\DeclareOption{lilypond}{\lilypondautotrue\lilypondtrue} \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 % diagram: display chord diagrams at the beginning
\newif{\ifdiagram} \newif{\ifdiagram}
\DeclareOption{diagram}{\diagramtrue} \DeclareOption{diagram}{\diagramtrue}

5
patacrep/templates.py

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

6
test/test_songbook/content.tex.control

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

6
test/test_songbook/datadir.tex.control

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

6
test/test_songbook/lang_default.tex.control

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

6
test/test_songbook/lang_en.tex.control

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

6
test/test_songbook/lang_fr.tex.control

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

6
test/test_songbook/languages.tex.control

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

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

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

6
test/test_songbook/syntax.tex.control

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

6
test/test_songbook/unicode.tex.control

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

Loading…
Cancel
Save