catalog.layout.fop
Functionality to render a tree of catalog items as accessible PDF
braille-signatures
Same as layout/braille-signatures but insert zero with spaces. See insert-zero-width-space
coverpage-recto
multimethod
Return a hiccup style sexp for the recto (the front) of the coverpage for given title
, year
and issue
. Dispatch on the format (fmt
) of the requested catalog.
coverpage-verso
multimethod
Return a hiccup style sexp for the verso (the back) of the coverpage for given title
, issue
of the requested catalog. Dispatch on the format (fmt
) of the requested catalog.
document
(document items fmt year issue editorial recommendations & {:keys [description], :as args})
Return the xsl-fo XML for a catalog document. To produce PDF pass this XML to a xsl-fo processor. items
contains a tree of catalog entries. fmt
is the kind of format we want the catalog in (see document-sexp). year
and issue
are placed on the coverpage. editorial
and recommendations
are also placed inside the catalog (at least for some formats). Lastly optional args such as query
or customer
can be passed. These will be used on the cover page of custom catalogs.
document-sexp
multimethod
Return a hiccup style sexp for a catalog document. Dispatch on the format (fmt
) of the requested catalog.
:all-formats
a standard catalog:grossdruck
a large print catalog using a big font:hörbuch
a catalog used for narrators to read the catalog with some specific sorting requirements:hörfilm
a catalog with all hörfile for a given year:ludo
a catalog with all games for a given year:taktilesbuch
a catalog with all tactile books for a given year:print-and-braille
a catalog with all print-and-braille books for a given year:custom
a catalog with a custom selection of catalog entries specific for a customer:custom-grossdruck
a catalog with a custom selection of catalog entries specific for a customer and in large print
format-sexp
(format-sexp items fmt level {:keys [with-toc?], :or {with-toc? true}, :as opts})
Return a hiccup style sexp for a format
generate-document
(generate-document items fmt year issue editorial recommendations out)
Return the xsl-fo XML for a catalog document and store it in out
. Similar to document but additionally stores the XML. Used for debugging.
generate-pdf!
(generate-pdf! document out)
Return a pdf in out
for given document
, which is a string containing xsl-fo XML. The pdf is generated using the Apache Fop xsl-fo formatting objects processor.
heading
(heading level path {:keys [path-to-numbers]})
Return a heading block for given level
and path
.
The last part of path
is used as the title of the section. If path
is found in path-to-numbers
then the heading is numbered. If the last part of path is a keyword then this is looked up in the translations and the actual translation is used as the title instead.
md-to-fop
(md-to-fop markdown path opts)
Return a hiccup style sexp for given markdown
at path
with opts
.
The markdown
is parsed, converted to a clojure data structure and finally converted to a hiccup style sexp by the to-fop multimethod.
render-narrators
Same as layout/render-narrators but insert zero with spaces. See insert-zero-width-space
style
(style class)
(style class attrs)
Return a map of style attributes for given class
. The attributes are looked up in the *stylesheet*
dynamic var. Optionally additional attrs
can be defined that will be merged with the attrs of given class
subgenre-sexp
(subgenre-sexp items fmt genre subgenre level opts)
Return a hiccup style sexp for a subgenre
subgenres-sexp
(subgenres-sexp items fmt genre level opts)
Return a hiccup style sexp for all subgenres for given genre
to-fop
multimethod
Return a hiccup style sexp containing the fo markup for given node at path
and opts
.
toc
(toc items path depth {:keys [heading?], :as opts})
Return a hiccup style sexp for a fo TOC for given items
, path
and depth
.
Optionally a TOC heading (the actual value is looked up in the translation map) can be enabled through opts
.