diff --git a/pco_chords.nimble b/pco_chords.nimble index 994b344..f36e12e 100644 --- a/pco_chords.nimble +++ b/pco_chords.nimble @@ -1,6 +1,6 @@ # Package -version = "0.5.2" +version = "0.5.4" author = "Jonathan Bernard" description = "Chord chart formatter compatible with Planning Center Online" license = "MIT" @@ -12,3 +12,9 @@ bin = @["pco_chords"] # Dependencies requires "nim >= 1.6.6", "docopt", "zero_functional" + +# Dependencies from git.jdbernard.com/jdb/nim-package +requires "update_nim_package_version" + +task updateVersion, "Update the version of this tool.": + exec "update_nim_package_version pco_chords 'src/pco_chordspkg/cliconstants.nim'" diff --git a/src/pco_chords.nim b/src/pco_chords.nim index b17304f..112c2a1 100644 --- a/src/pco_chords.nim +++ b/src/pco_chords.nim @@ -38,7 +38,12 @@ when isMainModule: if args["--transpose"]: parseInt($args["--transpose"]) else: 0 - let outputHtml = ast.toHtml(transpose, args["--number-chart"]) + let outputHtml = + if args["--large-print"]: + ast.toHtml(transpose, args["--number-chart"], + stylesheets = @[LARGE_PRINT_STYLESHEET]) + else: + ast.toHtml(transpose, args["--number-chart"]) if args["--output"]: writeFile($args["--output"], outputHtml) else: stdout.write(outputHtml) diff --git a/src/pco_chordspkg/ast.nim b/src/pco_chordspkg/ast.nim index 38a8bd8..330b572 100644 --- a/src/pco_chordspkg/ast.nim +++ b/src/pco_chordspkg/ast.nim @@ -259,7 +259,7 @@ proc parsePitch*(ctx: ParserContext, keyValue: string): ChordChartPitch = # see regexr.com/70nv1 let CHORD_REGEX = "([b#♭♮𝄫𝄪]?[A-G1-7][b#♭♮𝄫𝄪]?)" & # chord root - "(([mM1-9#b♭♮𝄫𝄪Δ+oøoø][0-9]?|min|maj|aug|dim|sus|6\\/9|\\([1-9#b♭]+\\))*)" & # chord flavor/type + "((min|maj|aug|dim|sus|6\\/9|[mM1-9#b♭♮𝄫𝄪Δ+oøoø][0-9]?|\\([1-9#b♭]+\\))*)" & # chord flavor/type "(\\/([b#♭♮𝄫𝄪]?[A-G1-7][b#♭♮𝄫𝄪]?))?" # optional bass let CHORD_PAT = re(CHORD_REGEX) diff --git a/src/pco_chordspkg/cliconstants.nim b/src/pco_chordspkg/cliconstants.nim index b5d1ec8..8ef79e5 100644 --- a/src/pco_chordspkg/cliconstants.nim +++ b/src/pco_chordspkg/cliconstants.nim @@ -1,4 +1,4 @@ -const PCO_CHORDS_VERSION* = "0.5.2" +const PCO_CHORDS_VERSION* = "0.5.4" const USAGE* = """Usage: pco_chords [options] @@ -23,6 +23,7 @@ Options: --help Print this usage information --debug Enable debug logging. --echo-args Echo the input parameters. + --large-print Use the large type styling. """ const ONLINE_HELP* = """ diff --git a/src/pco_chordspkg/html.nim b/src/pco_chordspkg/html.nim index c895738..21b8f50 100644 --- a/src/pco_chordspkg/html.nim +++ b/src/pco_chordspkg/html.nim @@ -52,7 +52,7 @@ h3 .section-text { .line { display: flex; flex-direction: row; - align-items: flex-end; + align-items: end; margin-left: 0.5em; margin-bottom: 0.5em; @@ -65,10 +65,104 @@ h3 .section-text { } .word.space-after { margin-right: 0.5em; } +.word.no-chord { align-self: flex-end; } .chord { font-weight: 600; margin-right: 0.5em; + white-space: nowrap; +} + +.chord .flavor { + font-variant-position: super; +} + +.song-order h3 { + font-style: italic; + font-weight: normal; +} + +.song-order li { + list-style: none; + margin-left: 1em; +} + +@media screen { + body { margin: 1em; } +} + +@media print { + .page-contents { column-count: 2; } +} + +""" + +const LARGE_PRINT_STYLESHEET* = """ +