Backends

Backends

function  write_to_file(self, formatted_entries, filename)
source
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.

source
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.

source
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.

source
function write_to_string(self, formatted_entries, citations::Vector{String})
source
function write_to_string(self, formatted_entries)
source

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 pages

  • symbols["newblock"] : Used to separate entries in the bibliography

  • symbols["bst_script"] : A non-breakable space

  • tags[""em'] : emphasize text

  • tags["strong"]: emphasize text even more

  • tags["i"] : italicize text, not semantic

  • tags["b"] : embolden text, not semantic

  • tags["tt"] : typewrite text, not semantic

source
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.

source
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.

source
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.

source

HTML

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>Л.:&nbsp;&lt;&lt;Химия&gt;&gt;</em>
source

LaTeX

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/}
source
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}
source

Markdown

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

source

Format the given string str_. Escapes special markdown control characters.

source

Text