Skip to content

Commit

Permalink
merge: Branch 'release-1.1.0b2'.
Browse files Browse the repository at this point in the history
  • Loading branch information
odkr committed May 30, 2021
2 parents 1df3d93 + 648931b commit 16724bc
Show file tree
Hide file tree
Showing 50 changed files with 1,034 additions and 23,902 deletions.
43 changes: 27 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,39 @@ SCPT_DIR := $(BASE_DIR)/scripts
TMP_DIR := $(BASE_DIR)/tmp


# FILES
# =====

SCRIPT ?= $(SCPT_DIR)/debug-wrapper.lua


# PROGRAMMES
# ==========

SHELL ?= sh
RM ?= rm -f
PANDOC ?= pandoc

# The shells to try. Used for installation.
# The shells to try to run the installer with.
# Must be filenames. Order by preference, from best to worst.
# Change PATH to use different versions of the same shell.
SHELLS = dash oksh bash yash zsh mksh ksh sh
SHELLS = oksh ksh bash zsh yash dash mksh $(SHELL)


# TARGETS
# =======

ISSUE_TESTS := test-issue-4
ISSUE_TESTS := test-issue-4 test-issue-4-2

BEHAVIOUR_TESTS := test-easy-citekey test-better-bibtex \
test-zotero-id test-bibliography-json test-bibliography-yaml test-merge \
test-duplicate-bibliography-bib test-duplicate-bibliography-yaml \
test-zotero-id test-bibliography-json \
test-bibliography-yaml test-merge \
test-duplicate-bibliography-bib \
test-duplicate-bibliography-yaml \
test-example-simple test-example-bibliography \
$(ISSUE_TESTS)

OTHER_TESTS := test-resource-path

SCRIPT ?= $(SCPT_DIR)/debug-wrapper.lua
OTHER_TESTS := test-resource-path


# TESTS
Expand All @@ -53,7 +60,8 @@ install-luaunit:
prepare-tmpdir:
mkdir -p "$(TMP_DIR)"
$(RM) "$(TMP_DIR)"/*
cp "$(DATA_DIR)/bibliography.json" "$(TMP_DIR)/update-bibliography.json"
cp "$(DATA_DIR)/bibliography.json" \
"$(TMP_DIR)/update-bibliography.json"

unit-tests: install-luaunit prepare-tmpdir
"$(PANDOC)" --lua-filter "$(SCPT_DIR)/unit-tests.lua" \
Expand All @@ -78,36 +86,39 @@ test-resource-path:
if "$(PANDOC)" --lua-filter "$(SCPT_DIR)/pre-v2_11.lua" \
--from markdown --to plain /dev/null >/dev/null 2>&1; \
then \
"$(PANDOC)" --lua-filter "$(SCRIPT)" --resource-path "$(DATA_DIR)" \
"$(PANDOC)" --lua-filter "$(SCRIPT)" \
--resource-path "$(DATA_DIR)" \
--filter pandoc-citeproc \
--output "$(TMP_DIR)/$@.html" "$(DATA_DIR)/$@.md"; \
cmp "$(TMP_DIR)/$@.html" "$(NORM_DIR)/pre-v2_11/$@.html"; \
else \
$(PANDOC) --lua-filter "$(SCRIPT)" --resource-path "$(DATA_DIR)" \
$(PANDOC) --lua-filter "$(SCRIPT)" \
--resource-path "$(DATA_DIR)" \
--citeproc \
--output "$(TMP_DIR)/$@.html" "$(DATA_DIR)/$@.md"; \
cmp "$(TMP_DIR)/$@.html" "$(NORM_DIR)/$@.html"; \
fi

prologue:
@sed '/^=*$$/ {s/=/-/g;}; s/^\(.\)/-- \1/; s/^$$/--/;' man/pandoc-zotxt.lua.md
@sed '/^=*$$/ {s/=/-/g;}; s/^\(.\)/-- \1/; s/^$$/--/;' \
man/pandoc-zotxt.lua.md

manual:
$(PANDOC) -o man/pandoc-zotxt.lua.1 -f markdown-smart -t man -s \
-M title=pandoc-zotxt.lua \
-M date="$$(date '+%B %d, %Y')" \
-M section=1 \
man/pandoc-zotxt.lua.md
man/man1/pandoc-zotxt.lua.md

docs: manual
ldoc .

install:
@PATH="`getconf PATH`:$$PATH"; \
for SHELL in $(SHELLS); do \
"$$SHELL" </dev/null && break; \
done; \
"$$SHELL" install.sh
"$$SHELL" install.sh; \
[ "$$?" -eq 127 ] || break; \
done

.PHONY: install-luaunit prepare-tmpdir test unit-tests behaviour-tests \
$(BEHAVIOUR_TESTS) $(OTHER_TESTS) unit-tests \
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ file, where Pandoc can pick them up. See the
## Requirements

**pandoc-zotxt.lua** requires [Pandoc](https://www.pandoc.org/) v2.0 or later,
[Zotero](https://www.zotero.org/), and [zotxt](https://github.com/egh/zotxt/).
[Zotero](https://www.zotero.org/), [zotxt](https://github.com/egh/zotxt/), and
[Better BibTeX for Zotero](https://retorque.re/zotero-better-bibtex/).
It should work under any POSIX-compliant operating system (e.g., Linux, macOS,
FreeBSD, OpenBSD, NetBSD) as well as under Windows. It has *not* been tested
under Windows, however.
Expand All @@ -25,14 +26,16 @@ You use **pandoc-zotxt.lua** at your own risk.
2. Unpack the repository.
3. Move it to the `filters` sub-directory of your Pandoc data directory \
(`pandoc --version` tells you where that is).
4. Move the file **pandoc-zotxt.lua** from the repository directory
4. Symlink or move the file `pandoc-zotxt.lua` from the repository directory
up into the `filters` directory.
5. You may also want to copy the manual page from the `man` directory in
the repository to wherever your operating system searches for manual pages
(e.g., `/usr/local/share/man/man1`, `/usr/share/man/man1`).

If you are using a POSIX-compliant system and have
[curl](https://curl.haxx.se/) or
[wget](https://www.gnu.org/software/wget/), you can
install **pandoc-zotxt.lua** by copy-pasting the
following commands into a bourne shell:
If you are using a POSIX-compliant system (e.g., Linux or macOS) and have
[curl](https://curl.haxx.se/) or [wget](https://www.gnu.org/software/wget/),
you can install **pandoc-zotxt.lua** by copy-pasting the following commands
into a Bourne-compatible shell:

```sh
( set -Cefu
Expand All @@ -46,10 +49,6 @@ following commands into a bourne shell:
mv "$NAME-$VERS/pandoc-zotxt.lua" .; )
```

You may also want to copy the manual page from the `man` directory in the
repository to wherever your operating system searches for manual pages
(e.g., `/usr/local/share/man/man1`, `/usr/share/man/man1`).

You also need to install [zotxt](https://github.com/egh/zotxt/) *and*
[Better BibTeX for Zotero](https://retorque.re/zotero-better-bibtex/).

Expand All @@ -66,12 +65,12 @@ and the [source code](pandoc-zotxt.lua) itself for details.
### Requirements

1. A POSIX-compliant operating system.
2. [Pandoc](https://www.pandoc.org/) v2.7.2.
2. [Pandoc](https://www.pandoc.org/) v2.7.2 or later.
3. [pandoc-citeproc](https://github.com/jgm/pandoc-citeproc) v0.16.1.3
(for Pandoc prior to v2.11).

The test suite may or may not work with other versions of
Pandoc and `pandoc-citeproc`.
Pandoc (and `pandoc-citeproc`).

### Assumptions

Expand Down Expand Up @@ -114,7 +113,7 @@ If there's something wrong with **pandoc-zotxt.lua**,

## License

Copyright 2018, 2019, 2020 Odin Kroeger
Copyright 2018, 2019, 2020, 2021 Odin Kroeger

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 16724bc

Please sign in to comment.