File: custom_roles.txt

package info (click to toggle)
python-docutils 0.14%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,976 kB
  • sloc: python: 44,718; lisp: 14,476; xml: 1,782; sh: 167; makefile: 150
file content (49 lines) | stat: -rw-r--r-- 990 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Custom Roles
------------

* A role based on an existing role.

  .. role:: custom(literal)

  :custom:`one` :custom:`two` :custom:`three`

* A new role.

  .. role:: customnew

  :customnew:`one two three`

* A role with class attribute.

  .. role:: customclass
     :class: special

  :customclass:`interpreted text`

* A language-switching role:

  .. role:: language-de

  Let's count in German :language-de:`eins zwei drei`.

* A role with multiple class attributes, styled with raw directives:

  .. role:: customx
     :class: green sc language-en-GB

  .. raw:: latex

     \newcommand{\DUrolegreen}[1]{\textcolor{green}{#1}}
     \newcommand{\DUrolesc}[1]{\textsc{#1}}

  The following works in most browsers but does not validate
  (``<style>`` is only allowed in the document head)::

    .. raw:: html

      <style type="text/css"><!--
       .green {color: green;}
       .sc {font-variant: small-caps;}
       --></style>

  :customx:`British colourful text in small-caps`.