forked from CryHavoc/dottes
Replace Change and Credit with Markdown-enabled Notes section.
Data in Notes is taken from N: section starting "Dottes:".
This commit is contained in:
parent
945454da9d
commit
3061852caf
|
@ -56,30 +56,20 @@ if __name__ == "__main__":
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
|
|
||||||
input_path = pathlib.Path(args.input.name)
|
input_path = pathlib.Path(args.input.name)
|
||||||
|
fname = input_path.stem
|
||||||
|
fdir = input_path.parent
|
||||||
|
|
||||||
vars = dict()
|
vars = dict()
|
||||||
vars["changename"] = ""
|
vars["notesvisibility"] = "no"
|
||||||
vars["changetitle"] = ""
|
|
||||||
vars["changevisibility"] = "no"
|
|
||||||
vars["creditvisibility"] = "no"
|
|
||||||
|
|
||||||
vars["name"] = input_path.stem
|
vars["name"] = fname
|
||||||
vars["title"] = getFieldDisplayText(lines, "T", latex=args.latex)
|
vars["title"] = getFieldDisplayText(lines, fdir, "T", latex=args.latex)
|
||||||
vars["subtitle"] = getFieldDisplayText(lines, "T", n=2, latex=args.latex)
|
vars["subtitle"] = getFieldDisplayText(lines, fdir, "T", n=2, latex=args.latex)
|
||||||
vars["composer"] = getFieldDisplayText(lines, "C", latex=args.latex)
|
vars["composer"] = getFieldDisplayText(lines, fdir, "C", latex=args.latex)
|
||||||
vars["key"] = getFieldDisplayText(lines, "K", latex=args.latex)
|
vars["key"] = getFieldDisplayText(lines, fdir, "K", latex=args.latex)
|
||||||
vars["changefile"] = getFieldDisplayText(lines, "N", starts="Change:", latex=args.latex)
|
vars["notes"] = getFieldDisplayText(lines, fdir, "N", starts="Dottes:", latex=args.latex)
|
||||||
vars["credit"] = getFieldDisplayText(lines, "N", starts="Credit:", latex=args.latex)
|
if vars["notes"]:
|
||||||
|
vars["notesvisibility"] = "yes"
|
||||||
if vars["changefile"]:
|
|
||||||
vars["changevisibility"] = "yes"
|
|
||||||
vars["changename"] = pathlib.Path(vars["changefile"]).stem
|
|
||||||
cf = pathlib.Path(input_path.parent, vars["changefile"])
|
|
||||||
with cf.open() as f:
|
|
||||||
vars["changetitle"] = getFieldDisplayText(f, "T", latex=args.latex)
|
|
||||||
|
|
||||||
if vars["credit"]:
|
|
||||||
vars["creditvisibility"] = "yes"
|
|
||||||
|
|
||||||
for val in args.values:
|
for val in args.values:
|
||||||
keyval = val.partition("=")
|
keyval = val.partition("=")
|
||||||
|
|
|
@ -43,12 +43,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<img class="dottes-png" src="${name}.png" alt="${title} dots">
|
<img class="dottes-png" src="${name}.png" alt="${title} dots">
|
||||||
<div class="dottes-credit-${creditvisibility}">
|
<div class="dottes-notes-${notesvisibility}">
|
||||||
From ${credit}.
|
${notes}
|
||||||
</div>
|
|
||||||
<div class="dottes-change-${changevisibility}">
|
|
||||||
Change: <a class="dottes-change-link"
|
|
||||||
href="${changename}.html">${changetitle}</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="dottes-tune-footer">
|
<div class="dottes-tune-footer">
|
||||||
<div class="dottes-tune-footer-row">
|
<div class="dottes-tune-footer-row">
|
||||||
|
|
|
@ -47,8 +47,8 @@
|
||||||
|
|
||||||
% Show the main tune graphic and optional change.
|
% Show the main tune graphic and optional change.
|
||||||
% Args are tune name, tune title, tune subtitle, composer, tune graphic
|
% Args are tune name, tune title, tune subtitle, composer, tune graphic
|
||||||
% filename, change name, change title, credit.
|
% filename, notes.
|
||||||
\newcommand{\showtune}[8]{%
|
\newcommand{\showtune}[6]{%
|
||||||
\phantomsection
|
\phantomsection
|
||||||
\begin{tabularx}{\textwidth}{LCR}
|
\begin{tabularx}{\textwidth}{LCR}
|
||||||
\addcontentsline{toc}{section}{#2}
|
\addcontentsline{toc}{section}{#2}
|
||||||
|
@ -59,11 +59,8 @@
|
||||||
\multicolumn{3}{c}{%
|
\multicolumn{3}{c}{%
|
||||||
\includegraphics[width=\textwidth,height=0.8\textheight,keepaspectratio]{#5}%
|
\includegraphics[width=\textwidth,height=0.8\textheight,keepaspectratio]{#5}%
|
||||||
}\tabularnewline
|
}\tabularnewline
|
||||||
\multicolumn{3}{p{\textwidth}}{%
|
|
||||||
\ifemptyarg{#8}{}{From {#8}. }%
|
|
||||||
\ifemptyarg{#6}{}{Change: \hyperlink{#6}{#7}.}%
|
|
||||||
}\tabularnewline
|
|
||||||
\end{tabularx}
|
\end{tabularx}
|
||||||
|
#6
|
||||||
\vfill
|
\vfill
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
\showtune{$name}{$title}{$subtitle}{$composer}{$graphicsdir/$name}{$changename}{$changetitle}{$credit}
|
\showtune{$name}{$title}{$subtitle}{$composer}{$graphicsdir/$name}{$notes}
|
||||||
|
|
|
@ -266,24 +266,11 @@ div.dottes-tune-list-item-image
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.dottes-change-no
|
div.dottes-notes-no
|
||||||
{
|
{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.dottes-change-yes
|
div.dottes-notes-yes
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
div.dottes-change-link
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
div.dottes-credit-no
|
|
||||||
{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.dottes-credit-yes
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue