• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

tests/H18-Nov-2020-172,709148,410

xml2rfc/H18-Nov-2020-50,81641,240

xml2rfc.egg-info/H03-May-2022-187122

LICENSEH A D30-Jun-20191.5 KiB2721

MANIFEST.inH A D14-Feb-2019180 109

PKG-INFOH A D18-Nov-20207.7 KiB187122

READMEH A D14-Feb-20193.6 KiB9064

changelogH A D18-Nov-2020162 KiB4,0812,697

setup.cfgH A D18-Nov-202067 85

setup.pyH A D18-Nov-20203.8 KiB13298

test.pyH A D14-Oct-201917.6 KiB499392

tox.iniH A D05-Nov-2020499 2419

README

1Introduction
2============
3
4The IETF_ uses a specific format for the standards and other documents it
5publishes as RFCs_, and for the draft documents which are produced when
6developing documents for publications.  There exists a number of different
7tools to facilitate the formatting of drafts and RFCs according to the
8existing rules, and this tool, **xml2rfc**, is one of them.  It takes as input
9an xml file which contains the text and meta-information about author names
10etc., and transforms it into suitably formatted output.  The input xml file
11should follow the grammars in RFC7749_ (for v2 documents) or RFC7991_ (for
12v3 documents). Note that the grammar for v3 is still being refined, and
13changes will eventually be captured in the `bis draft for 7991`_.
14Changes not yet captured can be seen in the xml2rfc source `v3.rng`_.
15
16**xml2rfc** provides a variety of output formats. See the command line
17help for a full list of formats. It also provides conversion from v2 to
18v3, and can run the preptool_ on its input.
19
20.. _IETF: https://www.ietf.org/
21.. _RFCs: https://www.rfc-editor.org/
22.. _RFC7749: https://tools.ietf.org/html/rfc7749
23.. _RFC7991: https://tools.ietf.org/html/rfc7991
24.. _bis draft for 7991: https://tools.ietf.org/html/draft-iab-rfc7991bis
25.. _v3.rng: https://trac.tools.ietf.org/tools/xml2rfc/trac/browser/trunk/cli/xml2rfc/data/v3.rng
26.. _preptool: https://tools.ietf.org/html/rfc7998
27
28Installation
29============
30
31Installation of the python package is done as usual with 'pip install xml2rfc',
32using appropriate switches and/or sudo.
33
34Installation of support libraries for the PDF-formatter
35-------------------------------------------------------
36
37In order to generate PDFs, xml2rfc uses the WeasyPrint module, which
38depends on external libaries that must be installed as native packages
39on your platform, separately from the xml2rfc install.
40
41First, install the Cairo, Pango, and GDK-PixBuf library files on your
42system.  See installation instructions on the WeasyPrint Docs:
43
44    https://weasyprint.readthedocs.io/en/stable/install.html
45
46(Python 3 is not needed if your system Python is 2.7, though).
47
48(On some OS X systems with System Integrity Protection active, you may
49need to create a symlink from your home directory to the library installation
50directory (often /opt/local/lib):
51
52    ln -s /opt/local/lib ~/lib
53
54in order for weasyprint to find the installed cairo and pango libraries.
55Whether this is needed or not depends on whether you used macports or homebrew
56to install cairo and pango, and the homebrew / macport version.)
57
58Next, install the pycairo and weasyprint python modules using pip.
59Depending on your system, you may need to use 'sudo' or install in
60user-specific directories, using the --user switch.  On OS X in
61particular, you may also need to install a newer version of setuptools
62using --user before weasyprint can be installed.  If you install with
63the --user switch, you may need to also set PYTHONPATH, e.g.,
64
65    PYTHONPATH=/Users/henrik/Library/Python/2.7/lib/python/site-packages
66
67for Python 2.7.
68
69The basic pip commands (modify as needed according to the text above)
70are:
71
72    pip install 'pycairo>=1.18' 'weasyprint<=0.42.3'
73
74With these installed and available to xml2rfc, the --pdf switch will be
75enabled.
76
77For PDF output, you also need to install the Noto font set.  Download the full
78set from https://noto-website-2.storage.googleapis.com/pkgs/Noto-unhinted.zip,
79and install as appropriate for your platform.
80
81Usage
82=====
83
84xml2rfc accepts a single XML document as input and outputs to one or more conversion formats.
85
86**Basic Usage**: ``xml2rfc SOURCE [options] FORMATS...``
87
88Run ``xml2rfc --help`` for a full listing of command-line options.
89
90