Skip to content

Commit

Permalink
Add support for blank lines
Browse files Browse the repository at this point in the history
Alongside lined and dotted, this commit adds support for blank sections
in daily notes, reflect, and other note sections.

I wanted this because it's often convenient for me to zoom in a lot and
make really small notes in the daily notes section.

This configuration can be turned on by providing `blank: true` in
a configuration file (`dotted` must be false or not present).
  • Loading branch information
landakram committed Apr 15, 2024
1 parent 75906e8 commit 79f4343
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Config struct {
Year int `env:"PLANNER_YEAR"`
WeekStart time.Weekday
Dotted bool
Blank bool
CalAfterSchedule bool
ClearTopRightCorner bool
AMPMTime bool
Expand Down
14 changes: 9 additions & 5 deletions tpls/_common_07_daily_notes.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{ if $.Cfg.Dotted -}} \vskip-.5\myLenLineHeightButLine\myMash{\myNumDotHeightFull}{\myNumDotWidthFull} {{- else -}}
\vbox to \dimexpr\textheight-\pagetotal-\myLenLineHeightButLine\relax {%
\leaders\hbox to \linewidth{\textcolor{\myColorGray}{\rule{0pt}{\myLenLineHeightButLine}\hrulefill}}\vfil
}
{{end}}
{{- if $.Cfg.Dotted -}}
\vskip-.5\myLenLineHeightButLine\myMash{\myNumDotHeightFull}{\myNumDotWidthFull}
{{- else if $.Cfg.Blank -}}
\vskip\textheight minus \pagetotal
{{- else -}}
\vbox to \dimexpr\textheight-\pagetotal-\myLenLineHeightButLine\relax {%
\leaders\hbox to \linewidth{\textcolor{\myColorGray}{\rule{0pt}{\myLenLineHeightButLine}\hrulefill}}\vfil
}
{{- end}}
14 changes: 9 additions & 5 deletions tpls/_common_09_notes.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{ if $.Cfg.Dotted -}} \vskip-.5\myLenLineHeightButLine\myMash{\myNumDotHeightFull}{\myNumDotWidthFull} {{- else -}}
\vbox to \dimexpr\textheight-\pagetotal-\myLenLineHeightButLine\relax {%
\leaders\hbox to \linewidth{\textcolor{\myColorGray}{\rule{0pt}{\myLenLineHeightButLine}\hrulefill}}\vfil
}
{{end}}
{{- if $.Cfg.Dotted -}}
\vskip-.5\myLenLineHeightButLine\myMash{\myNumDotHeightFull}{\myNumDotWidthFull}
{{- else if $.Cfg.Blank -}}
\vskip\textheight minus \pagetotal
{{- else -}}
\vbox to \dimexpr\textheight-\pagetotal-\myLenLineHeightButLine\relax {%
\leaders\hbox to \linewidth{\textcolor{\myColorGray}{\rule{0pt}{\myLenLineHeightButLine}\hrulefill}}\vfil
}
{{- end}}
5 changes: 3 additions & 2 deletions tpls/macro.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
\newcommand{\myDotGrid}[2]{\leavevmode\multido{\dC=0mm+5mm}{#1}{\multido{\dR=0mm+5mm}{#2}{\put(\dR,\dC){\circle*{0.1}}}}}

\newcommand{\myMash}[3][]{
{{- if $.Cfg.Dotted -}} \vskip\myLenLineHeightButLine#1\myDotGrid{#2}{#3} {{- else -}} \Repeat{#2}{\myLineGrayVskipTop} {{- end -}}
{{- if $.Cfg.Dotted -}} \vskip\myLenLineHeightButLine#1\myDotGrid{#2}{#3} {{- else if $.Cfg.Blank -}}
\vskip#2\myLenLineHeightButLine {{- else -}} \Repeat{#2}{\myLineGrayVskipTop} {{- end -}}
}

\newcommand{\remainingHeight}{%
Expand All @@ -88,4 +89,4 @@
\else
\dimexpr\pagegoal-\pagetotal-\lineskip-9.4pt\relax
\fi%
}
}

0 comments on commit 79f4343

Please sign in to comment.