.\" .\" Copyright (c) 2009 - 2016 Natacha Porté .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd April 13, 2016 .Dt SOLDOUT_RENDERERS 3 .Os .Sh NAME .Nm soldout_renderers , .Nm lus_attr_escape , .Nm lus_body_escape .Nd various markdown to HTML renderers for soldout .Sh SYNOPSIS .In renderers.h .Ft void .Fo lus_attr_escape .Fa "struct buf *ob" .Fa "const char *str" .Fa "size_t len" .Fc .Ft void .Fo lus_body_escape .Fa "struct buf *ob" .Fa "const char *str" .Fa "size_t len" .Fc .Vt extern const struct mkd_renderer mkd_html; .Vt extern const struct mkd_renderer mkd_xhtml; .Vt extern const struct mkd_renderer discount_html; .Vt extern const struct mkd_renderer discount_xhtml; .Vt extern const struct mkd_renderer nat_html; .Vt extern const struct mkd_renderer nat_xhtml; .Sh DESCRIPTION The .Fn lus_attr_escape and .Fn lus_body_escape functions escape all problematic characters in (X)HTML: .Ql < , .Ql > , .Ql & , .Ql \(dq ; and .Ql < , .Ql > , .Ql & respectively. They accept a string .Va str of the length .Va len and output into .Va ob buffer. .Pp All provided renderers come with two flavors, .Va _html producing HTML code (self-closing tags are rendered like this:
), and .Va _xhtml producing XHTML code (self-closing tags like
). .Pp .Va mkd_html and .Va mkd_xhtml implement standard markdown to (X)HTML translation without any extension. .Pp .Va discount_html and .Va discount_xhtml implement on top of the standard markdown some of the extensions found in Discount and PHP-Markdown-like tables. Here is a list of all extensions included in these renderers: .Bl -bullet -width 1m .It image size specification, by appending "=(width)x(height)" to the link .It pseudo-protocols in links: .Bl -bullet -width 1m .It abbr:description for ... .It class:name for ... .It id:name for ... .It raw:text for verbatim unprocessed text inclusion .El .It class blocks: blockquotes beginning with %class% will be rendered as a div of the given class(es) .El .Pp .Va nat_html and .Va nat_xhtml implement on top of Discount extensions and Natasha's own extensions. Here is a list of these extensions: .Bl -bullet -width 1m .It id attribute for headers, using the syntax id#Header text .It class attribute for paragraphs, by putting class name(s) between parenthesis at the very beginning of the paragraph .It and spans, using respectively ++ and -- as delimiters (with emphasis-like restrictions, i.e. an opening delimiter cannot be followed by a whitespace, and a closing delimiter cannot be preceded by a whitespace) .It plain without attribute, using emphasis-like delimiter | .El .Sh RETURN VALUES The .Fn lus_attr_escape and .Fn lus_body_escape functions do not return a value. .Sh SEE ALSO .Xr soldout 3 , .Xr soldout_buffer 3 , .Xr soldout_markdown 3 .Sh AUTHORS .An -nosplit The .Nm soldout library was written by .An Natasha Qo Kerensikova Qc Porte Aq Mt natacha@instinctive.eu . Manual page was originally written by .An Massimo Manghi Aq Mt mxmanghi@apache.org , and rewritten to mdoc format by .An Svyatoslav Mishyn Aq Mt juef@openmailbox.org .