View source with formatted comments or as raw
    1/*  Part of SWI-Prolog
    2
    3    Author:        Jan Wielemaker
    4    E-mail:        J.Wielemaker@vu.nl
    5    WWW:           http://www.swi-prolog.org
    6    Copyright (c)  2018, CWI Amsterdam
    7    All rights reserved.
    8
    9    Redistribution and use in source and binary forms, with or without
   10    modification, are permitted provided that the following conditions
   11    are met:
   12
   13    1. Redistributions of source code must retain the above copyright
   14       notice, this list of conditions and the following disclaimer.
   15
   16    2. Redistributions in binary form must reproduce the above copyright
   17       notice, this list of conditions and the following disclaimer in
   18       the documentation and/or other materials provided with the
   19       distribution.
   20
   21    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   22    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   23    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   24    FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   25    COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
   26    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   27    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   28    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   29    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   30    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
   31    ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   32    POSSIBILITY OF SUCH DAMAGE.
   33*/
   34
   35:- module(pldoc_style,
   36          []).   37:- autoload(library(option),[merge_options/3]).   38
   39:- multifile
   40    theme/3,
   41    html_text:style/3.   42
   43html_text:style(Element, Condition, CSS) :-
   44    style(Element, Condition, CSS0),
   45    (   theme(Element, Condition, CSS1)
   46    ->  merge_options(CSS1, CSS0, CSS)
   47    ;   CSS = CSS0
   48    ).
   49
   50style(div, class(synopsis),
   51      [text_align(right), margin_bottom(2), margin_top(2)]).
   52style(div, class(title),
   53      [text_align(center), margin_bottom(3), margin_top(2), font_weight(bold)]).
   54style(div, class('abstract-title'),
   55      [margin_bottom(2), text_align(center), font_weight(bold)]).
   56style(div, class(author),
   57      [text_align(center), margin_bottom(3), margin_top(2)]).
   58style(div, class(abstract),
   59      [margin_bottom(3), margin_top(2)]).
   60style(div, class('toc-h1'),
   61      [margin_left(2)]).
   62style(div, class('toc-h2'),
   63      [margin_left(4)]).
   64style(div, class('toc-h3'),
   65      [margin_left(6), font_weight(normal)]).   % FIXME: Requires hierarchy
   66style(div, class('toc-h4'),
   67      [margin_left(8), font_weight(normal)]).
   68style(span, class('synopsis-hdr'),
   69      [margin_right(1), font_weight(normal), color(green)]).
   70style(span, class(autoload),
   71      [margin_left(1), font_weight(normal), color(green)]).
   72style(span, class('pred-tag'),
   73      [float(right)]).
   74style(var, true,
   75      [color(red), font_weight(normal)]).
   76style(code, true,
   77      [color(blue)]).
   78style(pre, true,
   79      [color(blue)]).
   80style(a, true,
   81      [text_decoration(none), font_weight(bold)]).
   82style(table, class(arglist),
   83      [margin_left(4), margin_right(4)]).
   84style(p, class(warning),
   85      [text_align(center), color(red)]).
   86style(span, class('help-query'),
   87      [font_weight(bold)])