[−][src]Crate bookbinder_common
A set of utilites used across crates. Note that these call some external commands:
latexmk
(and by extension xelatex)pdftocairo
(only if required to convert a pdf image -- will gracefully fallback if not present)
The following are not necessary for normal operation, but are useful in development:
epubcheck
pdftotext
If used in combination with bookbinder
, the following packages are needed for LaTex calls:
-titlesec
-caption
-geometry
-ulem
-textcase
-xpatch
-amsmath
-amssymb
-bookmark
-booktabs
-etoolbox
-fancyhdr
-fancyvrb
-footnotehyper
-listings
-longtable
-unicode-math
-upquote
-xcolor
-xurl
-fontspec
-graphicx
-microtype
-hyperref
-fmtcount
-appendix
Modules
fonts | Bundle some default fonts and make them accessible, as well as standardising access to system fonts. |
Enums
MimeType | A mimetype relevant to book production |
Traits
GuessMimeType | Helper to guess the mimetype of paths |
MimeTypeHelper | Various helpful functions for analysing filepaths |
Functions
call_latex | call lualatex on a particular str and return the pdf |
call_latex_verbose | call lualatex on a particular str and return the pdf, displaying lualatex's output as it goes |
convert_pdf_to_svg | convert a pdf file to an svg; requires that pdftocairo (part of poppler) be installed. Note that we can't link poppler without licensing difficulties, so there are no plans to incorporate this as a dependency. |
convert_svg_file_to_png | Convert an svg file to a png with a resolution of |
convert_svg_to_jpg | Convert a svg str to a jpg file |
convert_svg_to_png | Convert a svg str to a png file |
convert_to_jpg | Convert an image at path |
display_isbn | present a nicely-printed version of an isbn-13 |
epubcheck | Call |
escape_to_html | escape |
escape_to_latex | escape |
get_current_year | get the current year as a string |
number_to_letter | given a number, return the corresponding letter e.g. 0 -> A, 1 -> B, 2 -> C. Returns an error if the number is greater than 25 |
number_to_roman | given a number, return it in roman format e.g. 1 -> I, 10 -> X, etc |
number_to_words | given a number, return its equivalent in words |
simplify_svg | Use usvg to simplify an svg; this is most important in that text is rendered as paths |
validate_isbn | Validate that a |