diff options
author | Ludovic Courtès | 2022-04-19 23:42:26 +0200 |
---|---|---|
committer | Ludovic Courtès | 2022-05-05 22:23:23 +0200 |
commit | 424bef0d0aac2a5a8607cf9f76a6def5ee0ca183 (patch) | |
tree | 45a682403c6bfe78725214de837ae4be2a1b91fe /src/guile/skribilo/package/jfp.scm | |
parent | 621eb1945aec8f26f5aee4bdf896f2434e145182 (diff) | |
download | skribilo-424bef0d0aac2a5a8607cf9f76a6def5ee0ca183.tar.gz skribilo-424bef0d0aac2a5a8607cf9f76a6def5ee0ca183.tar.lz skribilo-424bef0d0aac2a5a8607cf9f76a6def5ee0ca183.zip |
biblio: Replace template interpreter with a macro (a "compiler").
This allows us to catch invalid templates at macro-expansion time and is
more efficient.
* src/guile/skribilo/biblio/template.scm (evaluate-bib-entry-template):
Remove.
(define-template-engine, bibliography-template): New macros.
(output-bib-entry-template): Rewrite and remove 'get-field' optional
argument.
(make-bib-entry-template/default, make-bib-entry-template/skribe): Use
'bibliography-template' instead of quasiquote/unquote.
* src/guile/skribilo/package/jfp.scm (le): Likewise.
* src/guile/skribilo/package/lncs.scm (bib-entry-template): Likewise.
* src/guile/skribilo/biblio.scm (&biblio-template-error): Remove.
(handle-biblio-error): Adjust accordingly.
* tests/biblio.test: New file.
* tests/Makefile.am (TESTS): Add it.
Diffstat (limited to 'src/guile/skribilo/package/jfp.scm')
-rw-r--r-- | src/guile/skribilo/package/jfp.scm | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/src/guile/skribilo/package/jfp.scm b/src/guile/skribilo/package/jfp.scm index 140ff4c..fa6fcc6 100644 --- a/src/guile/skribilo/package/jfp.scm +++ b/src/guile/skribilo/package/jfp.scm @@ -1,7 +1,7 @@ ;;; jfp.scm -- The Skribe style for JFP articles. ;;; ;;; Copyright 2003, 2004 Manuel Serrano -;;; Copyright 2007, 2020 Ludovic Courtès <ludo@chbouib.org> +;;; Copyright 2007, 2020, 2022 Ludovic Courtès <ludo@chbouib.org> ;;; ;;; ;;; This file is part of Skribilo. @@ -26,9 +26,9 @@ #:autoload (skribilo output) (output) #:autoload (skribilo evaluator) (evaluate-document) #:use-module (skribilo lib) - #:autoload (skribilo biblio template) (output-bib-entry-template) + #:use-module (skribilo biblio template) #:autoload (skribilo utils keywords) (the-body) - #:use-module (skribilo package base) + #:use-module ((skribilo package base) #:hide (author)) #:use-module (srfi srfi-1) #:use-module (skribilo utils syntax) @@ -228,37 +228,44 @@ (output-bib-entry-template n e (case (markup-option n 'kind) - ((techreport) - `(author (" (" year ")") " " (or title url) ". " - number ", " institution ", " - address ", " month ", " - ("pp. " pages) ".")) - ((article) - `(author (" (" year ")") " " (or title url) ". " - journal ", " volume ", " ("(" number ")") ", " - address ", " month ", " - ("pp. " pages) ".")) - ((inproceedings) - `(author (" (" year ")") " " (or title url) ". " - book(or title url) ", " series ", " ("(" number ")") ", " - address ", " month ", " - ("pp. " pages) ".")) - ((book) - '(author (" (" year ")") " " (or title url) ". " - publisher ", " address - ", " month ", " ("pp. " pages) ".")) - ((phdthesis) - '(author (" (" year ")") " " (or title url) ". " type ", " - school ", " address - ", " month ".")) - ((misc) - '(author (" (" year ")") " " (or title url) ". " - publisher ", " address - ", " month ".")) - (else - '(author (" (" year ")") " " (or title url) ". " - publisher ", " address - ", " month ", " ("pp. " pages) ".")))))) + ((techreport) + (bibliography-template + author (" (" year ")") " " (or title url) ". " + number ", " institution ", " + address ", " month ", " + ("pp. " pages) ".")) + ((article) + (bibliography-template + author (" (" year ")") " " (or title url) ". " + journal ", " volume ", " ("(" number ")") ", " + address ", " month ", " + ("pp. " pages) ".")) + ((inproceedings) + (bibliography-template + author (" (" year ")") " " (or title url) ". " + booktitle (or title url) ", " series ", " ("(" number ")") ", " + address ", " month ", " + ("pp. " pages) ".")) + ((book) + (bibliography-template + author (" (" year ")") " " (or title url) ". " + publisher ", " address + ", " month ", " ("pp. " pages) ".")) + ((phdthesis) + (bibliography-template + author (" (" year ")") " " (or title url) ". " type ", " + school ", " address + ", " month ".")) + ((misc) + (bibliography-template + author (" (" year ")") " " (or title url) ". " + publisher ", " address + ", " month ".")) + (else + (bibliography-template + author (" (" year ")") " " (or title url) ". " + publisher ", " address + ", " month ", " ("pp. " pages) ".")))))) ;; abstract (markup-writer 'jfp-abstract le :options '(postscript) |