Skip to content

Commit b6da05c

Browse files
Release 0.1.0.0
2 parents 6a51985 + da86a32 commit b6da05c

18 files changed

+348
-188
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
# stack
55
.stack-work
66
*.yaml.lock
7+
stack-nix*
8+
9+
# cabal
10+
cabal.project.local
11+
cabal.project.local~
12+
/dist-newstyle/
713

814
# vi
915
.*.swp

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@ matrix:
1919
- ghc: 8.2.2
2020
- ghc: 8.4.4
2121
- ghc: 8.6.5
22+
#- ghc: 8.8.3
23+
#- ghc: 8.10.1
2224

2325
# Stack
2426
- ghc: 8.2.2
2527
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-8.2.2.yaml"
2628
- ghc: 8.4.4
2729
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-8.4.4.yaml"
2830
- ghc: 8.6.5
31+
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-8.6.5.yaml"
32+
- ghc: 8.8.3
2933
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack.yaml"
3034

3135
install:

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ following conventions:
2424

2525
[KaC]: <https://keepachangelog.com/en/1.0.0/>
2626

27+
## 0.1.0.0 (2020-07-25)
28+
29+
### Breaking
30+
31+
* Configure sections and queues in a single YAML file
32+
33+
### Non-Breaking
34+
35+
* Add a template option
36+
* Add an output option
37+
* Refactor `Makefile`, add `STACK_NIX_PATH` support
38+
* Add `test-all` command to `Makefile`
39+
* Add Nix configuration
40+
2741
## 0.0.1.0 (2020-01-22)
2842

2943
### Breaking

Makefile

Lines changed: 67 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ SHELL := bash
2020
MAKEFLAGS += --no-builtin-rules
2121
MAKEFLAGS += --warn-undefined-variables
2222

23+
.DEFAULT_GOAL := build
24+
25+
NIX_PATH_ARGS :=
26+
ifneq ($(origin STACK_NIX_PATH), undefined)
27+
NIX_PATH_ARGS := "--nix-path=$(STACK_NIX_PATH)"
28+
endif
29+
2330
RESOLVER_ARGS :=
2431
ifneq ($(origin RESOLVER), undefined)
2532
RESOLVER_ARGS := "--resolver" "$(RESOLVER)"
@@ -48,75 +55,59 @@ endef
4855
##############################################################################
4956
# Rules
5057

51-
_default: build
52-
.PHONY: _default
53-
54-
build:
58+
build: # build package *
5559
> @command -v hr >/dev/null 2>&1 && hr -t || true
56-
> @stack build $(RESOLVER_ARGS) $(STACK_YAML_ARGS)
60+
> @stack build $(RESOLVER_ARGS) $(STACK_YAML_ARGS) $(NIX_PATH_ARGS)
5761
.PHONY: build
5862

59-
clean:
63+
clean: # clean package
6064
> @stack clean
6165
.PHONY: clean
6266

63-
clean-all: clean
67+
clean-all: clean # clean package and remove artifacts
6468
> @rm -rf .stack-work
6569
> @rm -rf build
6670
> @rm -f *.yaml.lock
6771
.PHONY: clean-all
6872

69-
grep:
73+
grep: # grep all non-hidden files for expression E
7074
> $(eval E:= "")
7175
> @test -n "$(E)" || $(call die,"usage: make grep E=expression")
7276
> @$(call all_files) | xargs grep -Hn '$(E)' || true
7377
.PHONY: grep
7478

75-
help:
76-
> @echo "make build build package (default) *"
77-
> @echo "make clean clean package"
78-
> @echo "make clean-all clean package and remove artifacts"
79-
> @echo "make grep grep all non-hidden files for expression E"
80-
> @echo "make help show this help"
81-
> @echo "make hlint run hlint on all Haskell source"
82-
> @echo "make hsgrep grep all Haskell source for expression E"
83-
> @echo "make hsrecent show N most recently modified Haskell files"
84-
> @echo "make hssloc count lines of Haskell source"
85-
> @echo "make man build man page"
86-
> @echo "make recent show N most recently modified files"
87-
> @echo "make repl enter a REPL *"
88-
> @echo "make source-git create source tarball of git TREE"
89-
> @echo "make source-tar create source tarball using tar"
90-
> @echo "make test run tests, optionally for pattern P *"
91-
> @echo "make todo search for TODO items"
92-
> @echo "make version show current version"
79+
help: # show this help
80+
> @grep '^[a-zA-Z0-9_-]\+:[^#]*# ' $(MAKEFILE_LIST) \
81+
> | sed 's/^\([^:]\+\):[^#]*# \(.*\)/make \1\t\2/' \
82+
> | column -t -s $$'\t'
9383
> @echo
84+
> @echo "* Use STACK_NIX_PATH to specify a Nix path."
9485
> @echo "* Use RESOLVER to specify a resolver."
9586
> @echo "* Use CONFIG to specify a Stack configuration file."
9687
.PHONY: help
9788

98-
hlint:
89+
hlint: # run hlint on all Haskell source
9990
> @$(call hs_files) | xargs hlint
10091
.PHONY: hlint
10192

102-
hsgrep:
93+
hsgrep: # grep all Haskell source for expression E
10394
> $(eval E := "")
10495
> @test -n "$(E)" || $(call die,"usage: make hsgrep E=expression")
10596
> @$(call hs_files) | xargs grep -Hn '$(E)' || true
10697
.PHONY: hsgrep
10798

108-
hsrecent:
99+
hsrecent: # show N most recently modified Haskell files
109100
> $(eval N := "10")
110101
> @find . -not -path '*/\.*' -type f -name '*.hs' -printf '%T+ %p\n' \
111102
> | sort --reverse \
112103
> | head -n $(N)
113104
.PHONY: hsrecent
114105

115-
hssloc:
106+
hssloc: # count lines of Haskell source
116107
> @$(call hs_files) | xargs wc -l | tail -n 1 | sed 's/^ *\([0-9]*\).*$$/\1/'
117108
.PHONY: hssloc
118109

119-
man:
110+
man: # build man page
120111
> $(eval VERSION := $(shell \
121112
grep '^version:' $(CABAL_FILE) | sed 's/^version: *//'))
122113
> $(eval DATE := $(shell date --rfc-3339=date))
@@ -127,18 +118,18 @@ man:
127118
> doc/$(BINARY).1.md
128119
.PHONY: man
129120

130-
recent:
121+
recent: # show N most recently modified files
131122
> $(eval N := "10")
132123
> @find . -not -path '*/\.*' -type f -printf '%T+ %p\n' \
133124
> | sort --reverse \
134125
> | head -n $(N)
135126
.PHONY: recent
136127

137-
repl:
138-
> @stack exec ghci $(RESOLVER_ARGS) $(STACK_YAML_ARGS)
128+
repl: # enter a REPL *
129+
> @stack exec ghci $(RESOLVER_ARGS) $(STACK_YAML_ARGS) $(NIX_PATH_ARGS)
139130
.PHONY: repl
140131

141-
source-git:
132+
source-git: # create source tarball of git TREE
142133
> $(eval TREE := "HEAD")
143134
> $(eval BRANCH := $(shell git rev-parse --abbrev-ref $(TREE)))
144135
> @test "${BRANCH}" = "master" || echo "WARNING: Not in master branch!" >&2
@@ -150,7 +141,7 @@ source-git:
150141
> > build/$(PROJECT)-$(VERSION).tar.xz
151142
.PHONY: source-git
152143

153-
source-tar:
144+
source-tar: # create source tarball using tar
154145
> $(eval VERSION := $(shell \
155146
grep '^version:' $(CABAL_FILE) | sed 's/^version: *//'))
156147
> @mkdir -p build
@@ -164,16 +155,51 @@ source-tar:
164155
> @rm -f build/.gitignore
165156
.PHONY: source-tar
166157

167-
test:
158+
test: # run tests, optionally for pattern P *
168159
> $(eval P := "")
169160
> @command -v hr >/dev/null 2>&1 && hr -t || true
170161
> @test -z "$(P)" \
171-
> && stack test $(RESOLVER_ARGS) $(STACK_YAML_ARGS) \
172-
> || stack test $(RESOLVER_ARGS) $(STACK_YAML_ARGS) \
162+
> && stack test $(RESOLVER_ARGS) $(STACK_YAML_ARGS) $(NIX_PATH_ARGS) \
163+
> || stack test $(RESOLVER_ARGS) $(STACK_YAML_ARGS) $(NIX_PATH_ARGS) \
173164
> --test-arguments '--pattern $(P)'
174165
.PHONY: test
175166

176-
todo:
167+
test-all: # run tests for all versions
168+
> $(eval CONFIG := $(shell \
169+
test -f stack-nix-8.2.2.yaml \
170+
&& echo stack-nix-8.2.2.yaml \
171+
|| echo stack-8.2.2.yaml))
172+
> @command -v hr >/dev/null 2>&1 && hr $(CONFIG) || true
173+
> @make test CONFIG=$(CONFIG)
174+
> $(eval CONFIG := $(shell \
175+
test -f stack-nix-8.4.4.yaml \
176+
&& echo stack-nix-8.4.4.yaml \
177+
|| echo stack-8.4.4.yaml))
178+
> @command -v hr >/dev/null 2>&1 && hr $(CONFIG) || true
179+
> @make test CONFIG=$(CONFIG)
180+
> $(eval CONFIG := $(shell \
181+
test -f stack-nix-8.6.5.yaml \
182+
&& echo stack-nix-8.6.5.yaml \
183+
|| echo stack-8.6.5.yaml))
184+
> @command -v hr >/dev/null 2>&1 && hr $(CONFIG) || true
185+
> @make test CONFIG=$(CONFIG)
186+
> $(eval CONFIG := $(shell \
187+
test -f stack-nix.yaml \
188+
&& echo stack-nix.yaml \
189+
|| echo stack.yaml))
190+
> @command -v hr >/dev/null 2>&1 && hr $(CONFIG) || true
191+
> @make test CONFIG=$(CONFIG)
192+
> $(eval STACK_NIX_PATH := $(shell \
193+
test -f stack-nix-nightly.path \
194+
&& cat stack-nix-nightly.path \
195+
|| true))
196+
> @command -v hr >/dev/null 2>&1 && hr nightly || true
197+
> @test -f stack-nix-nightly.path \
198+
> && make test RESOLVER=nightly STACK_NIX_PATH="$(STACK_NIX_PATH)" \
199+
> || make test RESOLVER=nightly
200+
.PHONY: test-all
201+
202+
todo: # search for TODO items
177203
> @find . -type f \
178204
> -not -path '*/\.*' \
179205
> -not -path './build/*' \
@@ -182,6 +208,6 @@ todo:
182208
> | xargs grep -Hn TODO || true
183209
.PHONY: todo
184210

185-
version:
211+
version: # show current version
186212
> @grep '^version:' $(CABAL_FILE) | sed 's/^version: */$(PROJECT) /'
187213
.PHONY: version

default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc883" }:
2+
nixpkgs.pkgs.haskell.packages.${compiler}.callPackage ./queue-sheet.nix { }

doc/queue-sheet.1.md

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,57 +25,64 @@ used to track progress through the queues when offline.
2525
\--version
2626
: show version and exit
2727

28+
-t, \--template *TEMPLATE.tex*
29+
: template file (default: template.tex)
30+
31+
-o, \--output *QUEUES.pdf*
32+
: output file
33+
2834
# ARGUMENTS
2935

3036
*QUEUES.yaml*
3137
: YAML file specifying queue information
3238

3339
# FILES
3440

35-
## `sections.yaml`
41+
## `QUEUES.yaml`
3642

37-
This file defines the names and order of sections. It is a list of section
38-
names (strings).
43+
This file is an object with two properties.
3944

40-
## `QUEUES.yaml`
45+
The *sections* property is a list of section names (strings). Note that the
46+
order determines the order in the output.
4147

42-
This file defines the queues. It is a list of queue objects, which have the
43-
following properties:
48+
The *queues* property is a list of queue objects with the following
49+
properties:
4450

45-
name
51+
*name*
4652
: name of the queue (string, required)
4753

48-
section
54+
*section*
4955
: name of the section (string, required)
5056

51-
split
57+
*split*
5258
: *true* to display items on separate lines (boolean, default *false*)
5359

54-
tags
60+
*tags*
5561
: list of tags (list of string, optional)
5662

57-
date
63+
*date*
5864
: date of last update (string, optional)
5965

60-
prev
66+
*prev*
6167
: previous (complete) item (string, optional)
6268

63-
next
69+
*next*
6470
: list of next items (list of string, optional)
6571

6672
If both *prev* and *next* are specified, then *prev* is ignored.
6773

6874
The following tags are supported:
6975

70-
complete
76+
*complete*
7177
: no new items will be added to the queue
7278

73-
partial
79+
*partial*
7480
: not all items of the source queue are added to the queue
7581

76-
## `template.tex`
82+
## Template
7783

78-
This file is the LaTeX template used to build the PDF, with XeTeX.
84+
A LaTeX template is used to build the PDF, using XeTeX. Unless specified
85+
otherwise, `template.tex` is used.
7986

8087
It is a Jinja2-style template using the following syntax:
8188

@@ -90,44 +97,44 @@ Comments
9097

9198
The context contains a single value:
9299

93-
sections
100+
*sections*
94101
: list of sections
95102

96103
A section is an object with the following properties:
97104

98-
name
105+
*name*
99106
: name of the section (string)
100107

101-
queues
108+
*queues*
102109
: list of queues
103110

104111
A queue is an object with the following properties:
105112

106-
name
113+
*name*
107114
: name of the queue (string)
108115

109-
isSplit
116+
*isSplit*
110117
: *true* to display items on separate lines (boolean)
111118

112-
isPartial
119+
*isPartial*
113120
: *true* if the partial tag is set (boolean)
114121

115-
isComplete
122+
*isComplete*
116123
: *true* if the complete tag is set (boolean)
117124

118-
date
125+
*date*
119126
: date or empty string if no date (string)
120127

121-
prevItem
128+
*prevItem*
122129
: previous item or empty string if not set (string)
123130

124-
nextItems
131+
*nextItems*
125132
: list of next items (list of strings)
126133

127134
## `QUEUES.pdf`
128135

129-
The output is a file with the same base name as the queues file, but with a
130-
`.pdf` extension.
136+
Unless specified otherwise, the built PDF is output to a file with the same
137+
base name as the queues file but with a `.pdf` extension.
131138

132139
# EXIT CODES
133140

example/podcasts.pdf

-214 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)