diff --git a/patacrep/authors.py b/patacrep/authors.py index dadcc909..03221ebc 100644 --- a/patacrep/authors.py +++ b/patacrep/authors.py @@ -17,11 +17,11 @@ def compile_authwords(authwords): 'ignore': authwords.get('ignore', []), 'after': [ re.compile(RE_AFTER.format(word)) - for word in authwords.get('after') + for word in authwords.get('after', []) ], 'separators': [ re.compile(RE_SEPARATOR.format(word)) - for word in ([" %s" % word for word in authwords['separators']] + [',', ';']) + for word in ([" %s" % word for word in authwords.get('separators', [])] + [',', ';']) ], } diff --git a/patacrep/data/templates/songbook/default.tex b/patacrep/data/templates/songbook/default.tex index 52d759b9..5eef827a 100644 --- a/patacrep/data/templates/songbook/default.tex +++ b/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 *) diff --git a/patacrep/data/templates/songbook_model.yml b/patacrep/data/templates/songbook_model.yml index 05c40f2b..a3d3ce1b 100644 --- a/patacrep/data/templates/songbook_model.yml +++ b/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 diff --git a/patacrep/data/templates/styles/chords.sty b/patacrep/data/templates/styles/chords.sty index 236606e7..5f498e69 100644 --- a/patacrep/data/templates/styles/chords.sty +++ b/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 diff --git a/patacrep/data/templates/styles/patacrep.sty b/patacrep/data/templates/styles/patacrep.sty index 5ed071c2..8b88af75 100644 --- a/patacrep/data/templates/styles/patacrep.sty +++ b/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} diff --git a/patacrep/templates.py b/patacrep/templates.py index ca6740a1..c18ef454 100644 --- a/patacrep/templates.py +++ b/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'] diff --git a/patacrep/tools/__main__.py b/patacrep/tools/__main__.py index 13794b14..1bfc3fab 100644 --- a/patacrep/tools/__main__.py +++ b/patacrep/tools/__main__.py @@ -2,85 +2,26 @@ """Command line client to :mod:`tools`""" -import argparse import logging -import operator -import os -import pkgutil -import re import sys +import argdispatch + import patacrep # Logging configuration logging.basicConfig(level=logging.INFO) LOGGER = logging.getLogger("patatools") -def _execlp(program, args): - """Call :func:`os.execlp`, adding `program` as the first argument to itself.""" - return os.execlp(program, program, *args) - -def _iter_subcommands(): - """Iterate over subcommands. - - The objects returned are tuples of: - - the name of the command; - - its description; - - the function to call to execute the subcommand. - """ - subcommands = [] - - # Get python subcommands - path = [os.path.join(item, "patacrep", "tools") for item in sys.path] - prefix = "patacrep.tools." - module_re = re.compile(r'{}(?P[^\.]*)\.__main__'.format(prefix)) - for module_loader, name, _ in pkgutil.walk_packages(path, prefix): - match = module_re.match(name) - if match: - module = module_loader.find_module(match.string).load_module() - if hasattr(module, "SUBCOMMAND_DESCRIPTION"): - subcommands.append(match.groupdict()['subcommand']) - yield ( - match.groupdict()['subcommand'], - getattr(module, "SUBCOMMAND_DESCRIPTION"), - module.main, - ) - -class ArgumentParser(argparse.ArgumentParser): - """Proxy class to circumvent an :mod:`argparse` bug. - - Contrarily to what documented, the `argparse.REMAINDER - `_ `nargs` setting - does not include the remainder arguments if the first one begins with `-`. - - This bug is reperted as `17050 `_. This - class can be deleted once this bug has been fixed. - """ - - def parse_args(self, args=None, namespace=None): - if args is None: - args = sys.argv[1:] - subcommands = [command[0] for command in set(_iter_subcommands())] - if len(args) > 0: - if args[0] in subcommands: - args = [args[0], "--"] + args[1:] - - value = super().parse_args(args, namespace) - - if hasattr(value, 'remainder'): - value.remainder = value.remainder[1:] - return value - - def commandline_parser(): """Return a command line parser.""" - parser = ArgumentParser( + parser = argdispatch.ArgumentParser( prog="patatools", description=( "Miscellaneous tools for patacrep." ), - formatter_class=argparse.RawTextHelpFormatter, + formatter_class=argdispatch.RawTextHelpFormatter, ) parser.add_argument( @@ -96,11 +37,7 @@ def commandline_parser(): ) subparsers.required = True subparsers.dest = "subcommand" - - for command, message, function in sorted(_iter_subcommands(), key=operator.itemgetter(0)): - sub1 = subparsers.add_parser(command, help=message, add_help=False) - sub1.add_argument('remainder', nargs=argparse.REMAINDER) - sub1.set_defaults(function=function) + subparsers.add_submodules("patacrep.tools") return parser @@ -108,9 +45,7 @@ def main(args=None): """Main function""" if args is None: args = sys.argv - parser = commandline_parser() - args = parser.parse_args(args[1:]) - args.function(["patatools-{}".format(args.subcommand)] + args.remainder) + commandline_parser().parse_args(args[1:]) if __name__ == "__main__": main() diff --git a/patacrep/tools/cache/__main__.py b/patacrep/tools/cache/__main__.py index 6bf2cd8e..5c75d52d 100644 --- a/patacrep/tools/cache/__main__.py +++ b/patacrep/tools/cache/__main__.py @@ -1,4 +1,4 @@ -"""`patatools cache` command: cache manipulation.""" +"""Perform operations on cache.""" import argparse import logging @@ -11,7 +11,6 @@ from patacrep import errors from patacrep.songbook import open_songbook LOGGER = logging.getLogger("patatools.cache") -SUBCOMMAND_DESCRIPTION = "Perform operations on cache." def filename(name): """Check that argument is an existing, readable file name. @@ -27,7 +26,7 @@ def commandline_parser(): parser = argparse.ArgumentParser( prog="patatools cache", - description=SUBCOMMAND_DESCRIPTION, + description="Convert between song formats.", formatter_class=argparse.RawTextHelpFormatter, ) diff --git a/patacrep/tools/convert/__main__.py b/patacrep/tools/convert/__main__.py index a7b25455..65b82d8b 100644 --- a/patacrep/tools/convert/__main__.py +++ b/patacrep/tools/convert/__main__.py @@ -1,4 +1,4 @@ -"""`patatools.convert` command: convert between song formats""" +"""Convert between song formats.""" import os import logging @@ -10,7 +10,6 @@ from patacrep.utils import yesno from patacrep.build import config_model LOGGER = logging.getLogger("patatools.convert") -SUBCOMMAND_DESCRIPTION = "Convert between song formats" def _usage(): return "patatools convert INPUTFORMAT OUTPUTFORMAT FILES" diff --git a/setup.py b/setup.py index 4d0c74c5..aacfe910 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup( packages=find_packages(exclude=["test*"]), license="GPLv2 or any later version", install_requires=[ - "unidecode", "jinja2", "ply", "pyyaml", + "argdispatch", "unidecode", "jinja2", "ply", "pyyaml", ], entry_points={ 'console_scripts': [ diff --git a/test/test_songbook/.gitignore b/test/test_book/.gitignore similarity index 100% rename from test/test_songbook/.gitignore rename to test/test_book/.gitignore diff --git a/test/test_songbook/__init__.py b/test/test_book/__init__.py similarity index 100% rename from test/test_songbook/__init__.py rename to test/test_book/__init__.py diff --git a/test/test_songbook/content.tex.control b/test/test_book/content.tex.control similarity index 95% rename from test/test_songbook/content.tex.control rename to test/test_book/content.tex.control index 9fd7d242..38a79074 100644 --- a/test/test_songbook/content.tex.control +++ b/test/test_book/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} diff --git a/test/test_songbook/content.yaml b/test/test_book/content.yaml similarity index 100% rename from test/test_songbook/content.yaml rename to test/test_book/content.yaml diff --git a/test/test_songbook/content_datadir/content/foo.tex b/test/test_book/content_datadir/content/foo.tex similarity index 100% rename from test/test_songbook/content_datadir/content/foo.tex rename to test/test_book/content_datadir/content/foo.tex diff --git a/test/test_songbook/content_datadir/content/inter.isg b/test/test_book/content_datadir/content/inter.isg similarity index 100% rename from test/test_songbook/content_datadir/content/inter.isg rename to test/test_book/content_datadir/content/inter.isg diff --git a/test/test_songbook/content_datadir/content/song.csg b/test/test_book/content_datadir/content/song.csg similarity index 100% rename from test/test_songbook/content_datadir/content/song.csg rename to test/test_book/content_datadir/content/song.csg diff --git a/test/test_songbook/content_datadir/content/song.tsg b/test/test_book/content_datadir/content/song.tsg similarity index 100% rename from test/test_songbook/content_datadir/content/song.tsg rename to test/test_book/content_datadir/content/song.tsg diff --git a/test/test_songbook/content_datadir/songs/include.sbc b/test/test_book/content_datadir/songs/include.sbc similarity index 100% rename from test/test_songbook/content_datadir/songs/include.sbc rename to test/test_book/content_datadir/songs/include.sbc diff --git a/test/test_songbook/content_datadir/songs/inter.isg b/test/test_book/content_datadir/songs/inter.isg similarity index 100% rename from test/test_songbook/content_datadir/songs/inter.isg rename to test/test_book/content_datadir/songs/inter.isg diff --git a/test/test_songbook/content_datadir/songs/song.csg b/test/test_book/content_datadir/songs/song.csg similarity index 100% rename from test/test_songbook/content_datadir/songs/song.csg rename to test/test_book/content_datadir/songs/song.csg diff --git a/test/test_songbook/content_datadir/songs/song.tsg b/test/test_book/content_datadir/songs/song.tsg similarity index 100% rename from test/test_songbook/content_datadir/songs/song.tsg rename to test/test_book/content_datadir/songs/song.tsg diff --git a/test/test_songbook/datadir.tex.control b/test/test_book/datadir.tex.control similarity index 96% rename from test/test_songbook/datadir.tex.control rename to test/test_book/datadir.tex.control index 1154a6fd..687a6096 100644 --- a/test/test_songbook/datadir.tex.control +++ b/test/test_book/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} diff --git a/test/test_songbook/datadir.yaml b/test/test_book/datadir.yaml similarity index 100% rename from test/test_songbook/datadir.yaml rename to test/test_book/datadir.yaml diff --git a/test/test_songbook/datadir_datadir/img/datadir.png b/test/test_book/datadir_datadir/img/datadir.png similarity index 100% rename from test/test_songbook/datadir_datadir/img/datadir.png rename to test/test_book/datadir_datadir/img/datadir.png diff --git a/test/test_songbook/datadir_datadir/scores/datadir.ly b/test/test_book/datadir_datadir/scores/datadir.ly similarity index 100% rename from test/test_songbook/datadir_datadir/scores/datadir.ly rename to test/test_book/datadir_datadir/scores/datadir.ly diff --git a/test/test_songbook/datadir_datadir/songs/datadir.csg b/test/test_book/datadir_datadir/songs/datadir.csg similarity index 100% rename from test/test_songbook/datadir_datadir/songs/datadir.csg rename to test/test_book/datadir_datadir/songs/datadir.csg diff --git a/test/test_songbook/datadir_datadir/songs/datadir.tsg b/test/test_book/datadir_datadir/songs/datadir.tsg similarity index 100% rename from test/test_songbook/datadir_datadir/songs/datadir.tsg rename to test/test_book/datadir_datadir/songs/datadir.tsg diff --git a/test/test_songbook/datadir_datadir/songs/datadir2.csg b/test/test_book/datadir_datadir/songs/datadir2.csg similarity index 100% rename from test/test_songbook/datadir_datadir/songs/datadir2.csg rename to test/test_book/datadir_datadir/songs/datadir2.csg diff --git a/test/test_songbook/datadir_datadir/songs/datadir2.sg b/test/test_book/datadir_datadir/songs/datadir2.sg similarity index 100% rename from test/test_songbook/datadir_datadir/songs/datadir2.sg rename to test/test_book/datadir_datadir/songs/datadir2.sg diff --git a/test/test_songbook/datadir_datadir/songs/relative.csg b/test/test_book/datadir_datadir/songs/relative.csg similarity index 100% rename from test/test_songbook/datadir_datadir/songs/relative.csg rename to test/test_book/datadir_datadir/songs/relative.csg diff --git a/test/test_songbook/datadir_datadir/songs/relative.ly b/test/test_book/datadir_datadir/songs/relative.ly similarity index 100% rename from test/test_songbook/datadir_datadir/songs/relative.ly rename to test/test_book/datadir_datadir/songs/relative.ly diff --git a/test/test_songbook/datadir_datadir/songs/relative.png b/test/test_book/datadir_datadir/songs/relative.png similarity index 100% rename from test/test_songbook/datadir_datadir/songs/relative.png rename to test/test_book/datadir_datadir/songs/relative.png diff --git a/test/test_songbook/datadir_datadir/songs/relative.tsg b/test/test_book/datadir_datadir/songs/relative.tsg similarity index 100% rename from test/test_songbook/datadir_datadir/songs/relative.tsg rename to test/test_book/datadir_datadir/songs/relative.tsg diff --git a/test/test_songbook/datadir_datadir/songs/subdir/subdir.csg b/test/test_book/datadir_datadir/songs/subdir/subdir.csg similarity index 100% rename from test/test_songbook/datadir_datadir/songs/subdir/subdir.csg rename to test/test_book/datadir_datadir/songs/subdir/subdir.csg diff --git a/test/test_songbook/datadir_datadir/songs/subdir/subdir.ly b/test/test_book/datadir_datadir/songs/subdir/subdir.ly similarity index 100% rename from test/test_songbook/datadir_datadir/songs/subdir/subdir.ly rename to test/test_book/datadir_datadir/songs/subdir/subdir.ly diff --git a/test/test_songbook/datadir_datadir/songs/subdir/subdir.png b/test/test_book/datadir_datadir/songs/subdir/subdir.png similarity index 100% rename from test/test_songbook/datadir_datadir/songs/subdir/subdir.png rename to test/test_book/datadir_datadir/songs/subdir/subdir.png diff --git a/test/test_songbook/datadir_datadir/songs/subdir/subdir.tsg b/test/test_book/datadir_datadir/songs/subdir/subdir.tsg similarity index 100% rename from test/test_songbook/datadir_datadir/songs/subdir/subdir.tsg rename to test/test_book/datadir_datadir/songs/subdir/subdir.tsg diff --git a/test/test_songbook/datadir_datadir2/img/datadir2.png b/test/test_book/datadir_datadir2/img/datadir2.png similarity index 100% rename from test/test_songbook/datadir_datadir2/img/datadir2.png rename to test/test_book/datadir_datadir2/img/datadir2.png diff --git a/test/test_songbook/datadir_datadir2/scores/datadir2.ly b/test/test_book/datadir_datadir2/scores/datadir2.ly similarity index 100% rename from test/test_songbook/datadir_datadir2/scores/datadir2.ly rename to test/test_book/datadir_datadir2/scores/datadir2.ly diff --git a/test/test_songbook/lang_default.tex.control b/test/test_book/lang_default.tex.control similarity index 94% rename from test/test_songbook/lang_default.tex.control rename to test/test_book/lang_default.tex.control index 42f1e087..40391656 100644 --- a/test/test_songbook/lang_default.tex.control +++ b/test/test_book/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} diff --git a/test/test_songbook/lang_default.yaml b/test/test_book/lang_default.yaml similarity index 100% rename from test/test_songbook/lang_default.yaml rename to test/test_book/lang_default.yaml diff --git a/test/test_songbook/lang_en.tex.control b/test/test_book/lang_en.tex.control similarity index 94% rename from test/test_songbook/lang_en.tex.control rename to test/test_book/lang_en.tex.control index 11a9f401..55573ddd 100644 --- a/test/test_songbook/lang_en.tex.control +++ b/test/test_book/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} diff --git a/test/test_songbook/lang_en.yaml b/test/test_book/lang_en.yaml similarity index 100% rename from test/test_songbook/lang_en.yaml rename to test/test_book/lang_en.yaml diff --git a/test/test_songbook/lang_fr.tex.control b/test/test_book/lang_fr.tex.control similarity index 94% rename from test/test_songbook/lang_fr.tex.control rename to test/test_book/lang_fr.tex.control index 1255dcce..aca45a48 100644 --- a/test/test_songbook/lang_fr.tex.control +++ b/test/test_book/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} diff --git a/test/test_songbook/lang_fr.yaml b/test/test_book/lang_fr.yaml similarity index 100% rename from test/test_songbook/lang_fr.yaml rename to test/test_book/lang_fr.yaml diff --git a/test/test_songbook/languages.tex.control b/test/test_book/languages.tex.control similarity index 95% rename from test/test_songbook/languages.tex.control rename to test/test_book/languages.tex.control index 46d888dc..a1cfa123 100644 --- a/test/test_songbook/languages.tex.control +++ b/test/test_book/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} diff --git a/test/test_songbook/languages.yaml b/test/test_book/languages.yaml similarity index 100% rename from test/test_songbook/languages.yaml rename to test/test_book/languages.yaml diff --git a/test/test_songbook/languages_datadir/songs/language.csg b/test/test_book/languages_datadir/songs/language.csg similarity index 100% rename from test/test_songbook/languages_datadir/songs/language.csg rename to test/test_book/languages_datadir/songs/language.csg diff --git a/test/test_songbook/languages_datadir/songs/language_location.csg b/test/test_book/languages_datadir/songs/language_location.csg similarity index 100% rename from test/test_songbook/languages_datadir/songs/language_location.csg rename to test/test_book/languages_datadir/songs/language_location.csg diff --git a/test/test_songbook/languages_datadir/songs/no_language.csg b/test/test_book/languages_datadir/songs/no_language.csg similarity index 100% rename from test/test_songbook/languages_datadir/songs/no_language.csg rename to test/test_book/languages_datadir/songs/no_language.csg diff --git a/test/test_songbook/languages_datadir/songs/wrong_language.csg b/test/test_book/languages_datadir/songs/wrong_language.csg similarity index 100% rename from test/test_songbook/languages_datadir/songs/wrong_language.csg rename to test/test_book/languages_datadir/songs/wrong_language.csg diff --git a/test/test_songbook/languages_datadir/songs/wrong_location.csg b/test/test_book/languages_datadir/songs/wrong_location.csg similarity index 100% rename from test/test_songbook/languages_datadir/songs/wrong_location.csg rename to test/test_book/languages_datadir/songs/wrong_location.csg diff --git a/test/test_songbook/onthefly/content.onthefly.tex.control b/test/test_book/onthefly/content.onthefly.tex.control similarity index 93% rename from test/test_songbook/onthefly/content.onthefly.tex.control rename to test/test_book/onthefly/content.onthefly.tex.control index 8a882c85..3ee52e2e 100644 --- a/test/test_songbook/onthefly/content.onthefly.tex.control +++ b/test/test_book/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} diff --git a/test/test_songbook/onthefly/content.onthefly.yaml b/test/test_book/onthefly/content.onthefly.yaml similarity index 100% rename from test/test_songbook/onthefly/content.onthefly.yaml rename to test/test_book/onthefly/content.onthefly.yaml diff --git a/test/test_songbook/special.yaml b/test/test_book/special.yaml similarity index 100% rename from test/test_songbook/special.yaml rename to test/test_book/special.yaml diff --git a/test/test_songbook/special_datadir/songs/special.csg b/test/test_book/special_datadir/songs/special.csg similarity index 100% rename from test/test_songbook/special_datadir/songs/special.csg rename to test/test_book/special_datadir/songs/special.csg diff --git a/test/test_songbook/syntax.tex.control b/test/test_book/syntax.tex.control similarity index 92% rename from test/test_songbook/syntax.tex.control rename to test/test_book/syntax.tex.control index 1c925801..af7acb06 100644 --- a/test/test_songbook/syntax.tex.control +++ b/test/test_book/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} diff --git a/test/test_songbook/syntax.yaml b/test/test_book/syntax.yaml similarity index 100% rename from test/test_songbook/syntax.yaml rename to test/test_book/syntax.yaml diff --git a/test/test_songbook/syntax_datadir/songs/musicnote.csg b/test/test_book/syntax_datadir/songs/musicnote.csg similarity index 100% rename from test/test_songbook/syntax_datadir/songs/musicnote.csg rename to test/test_book/syntax_datadir/songs/musicnote.csg diff --git a/test/test_songbook/test_compilation.py b/test/test_book/test_compilation.py similarity index 100% rename from test/test_songbook/test_compilation.py rename to test/test_book/test_compilation.py diff --git a/test/test_songbook/unicode.tex.control b/test/test_book/unicode.tex.control similarity index 93% rename from test/test_songbook/unicode.tex.control rename to test/test_book/unicode.tex.control index 7d088978..38ce6118 100644 --- a/test/test_songbook/unicode.tex.control +++ b/test/test_book/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} diff --git a/test/test_songbook/unicode.yaml b/test/test_book/unicode.yaml similarity index 100% rename from test/test_songbook/unicode.yaml rename to test/test_book/unicode.yaml diff --git a/test/test_songbook/unicode_datadir/songs/nonbreak.csg b/test/test_book/unicode_datadir/songs/nonbreak.csg similarity index 100% rename from test/test_songbook/unicode_datadir/songs/nonbreak.csg rename to test/test_book/unicode_datadir/songs/nonbreak.csg