Skip to content

Commit c8cd028

Browse files
committed
Add recipe to return a citation reference
1 parent 13dfed8 commit c8cd028

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

tools/make/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ include $(TOOLS_MAKE_LIB_DIR)/examples/Makefile
4444
include $(TOOLS_MAKE_LIB_DIR)/complexity/Makefile
4545
include $(TOOLS_MAKE_LIB_DIR)/docs/Makefile
4646
include $(TOOLS_MAKE_LIB_DIR)/workshops/Makefile
47+
include $(TOOLS_MAKE_LIB_DIR)/bib/Makefile
4748
include $(TOOLS_MAKE_LIB_DIR)/markdown-equations/Makefile
4849
include $(TOOLS_MAKE_LIB_DIR)/debug/Makefile
4950

tools/make/lib/bib/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# DEPENDENCIES #
3+
4+
include $(TOOLS_MAKE_LIB_DIR)/bib/reference.mk

tools/make/lib/bib/reference.mk

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
# VARIABLES #
3+
4+
# Define the command for `node`:
5+
NODE ?= node
6+
7+
# Define the citation:
8+
CITATION ?=
9+
10+
# Define the command for returning a citation reference:
11+
CITATION_REFERENCE ?= $(NODE) $(TOOLS_DIR)/bib/citation-reference/bin/cli
12+
13+
# Define the command-line options to be used when executing the command:
14+
CITATION_REFERENCE_FLAGS ?= \
15+
--database $(ROOT_DIR)/docs/references/bib.bib \
16+
--csl $(ROOT_DIR)/docs/references/csl/chicago-author-date.csl
17+
18+
19+
# TARGETS #
20+
21+
# Return a reference.
22+
#
23+
# This target returns a reference corresponding to a citation identifier.
24+
25+
citation-reference: $(NODE_MODULES)
26+
$(QUIET) $(CITATION_REFERENCE) $(CITATION_REFERENCE_FLAGS) $(CITATION)
27+
28+
.PHONY: citation-reference

0 commit comments

Comments
 (0)