Backends
BibTeXFormat.write_to_file
— Method.function write_to_file(self, formatted_entries, filename)
BibTeXFormat.write_to_stream
— Function.function write_to_stream(self::BaseBackend, formatted_bibliography::Array, stream=IOBuffer(), citations::Vector{String})
Given a list of formatted bibliography, formatted_bibliography
, the function generates the output according to self::BaseBackend
specificed. The output includes the prologue and the epilogue.
BibTeXFormat.write_to_stream
— Function.function write_to_stream(self::BaseBackend, formatted_bibliography::Array, stream=IOBuffer())
Given a list of formatted bibliography, formatted_bibliography
, the function generates the output according to self::BaseBackend
specificed. The output includes the prologue and the epilogue.
BibTeXFormat.write_to_stream
— Function.function write_to_stream(self::BaseBackend, formatted_bibliography_item:Tuple, stream=IOBuffer())
Given a formatted_bibliography_item
, the function generates the output according to self::BaseBackend
specificed.
BibTeXFormat.write_to_string
— Method.function write_to_string(self, formatted_entries, citations::Vector{String})
BibTeXFormat.write_to_string
— Method.function write_to_string(self, formatted_entries)
BibTeXFormat.BaseBackend
— Type.This is the base type for the backends. We encourage you to implement as many of the symbols and tags as possible when you create a new plugin.
symbols["ndash"]
: Used to separate pagessymbols["newblock"]
: Used to separate entries in the bibliographysymbols["bst_script"]
: A non-breakable spacetags[""em']
: emphasize texttags["strong"]
: emphasize text even moretags["i"]
: italicize text, not semantictags["b"]
: embolden text, not semantictags["tt"]
: typewrite text, not semantic
BibTeXFormat.format
— Method.function format(self::T, t::Protected, text) where T<:BaseBackend
Format a "protected" piece of text.
In LaTeX backend, it is formatted as a {braced group}. Most other backends would just output the text as-is.
BibTeXFormat.format
— Method.function format(self::T, str::String) where T<:BaseBackend
Format the given string str_. The default implementation simply returns the string ad verbatim. Override this method for non-string backends.
BibTeXFormat.render_sequence
— Method.function render_sequence(self::T, rendered_list) where T <:BaseBackend
Render a sequence of rendered Text objects. The default implementation simply concatenates the strings in rendered_list. Override this method for non-string backends.
HTML
BibTeXFormat.HTMLBackend
— Type.struct HTMLBackend <: BaseBackend
julia> import BibTeXFormat.RichTextElements: RichText, Tag, TextSymbol
julia> import BibTeXFormat: render, HTMLBackend
julia> print(render(Tag("em", RichText("Л.:", TextSymbol("nbsp"), "<<ХимиÑ>>")),HTMLBackend()))
<em>Л.: <<ХимиÑ>></em>
LaTeX
BibTeXFormat.LaTeXBackend
— Type.LaTeX output backend.
julia> import BibTeXFormat: LaTeXBackend, render
julia> import BibTeXFormat.RichTextElements: Tag, HRef
julia> latex = LaTeXBackend();
julia> print(render(Tag("em", ""),latex))
julia> print(render(Tag("em", "Non-", "empty"),latex))
\emph{Non-empty}
julia> print(render(HRef("/", ""),latex))
julia> print(render(HRef("/", "Non-", "empty"),latex))
\href{/}{Non-empty}
julia> print(render(HRef("http://example.org/", "http://example.org/"),latex))
\url{http://example.org/}
BibTeXFormat.format
— Method.function format(self::LaTeXBackend, p::Protected, text)
julia> import BibTeXFormat.RichTextElements: Protected
julia> import BibTeXFormat: render_as
julia> print(render_as(Protected("CTAN"), "latex"))
{CTAN}
Markdown
BibTeXFormat.MarkdownBackend
— Type.A backend to support markdown output. It implements the same features as the HTML backend.
In addition to that, you can use the keyword php_extra=True to enable the definition list extension of php-markdown. The default is not to use it, since we cannot be sure that this feature is implemented on all systems.
More information: http://www.michelf.com/projects/php-markdown/extra/#def-list
BibTeXFormat.format
— Method.Format the given string str_. Escapes special markdown control characters.