xml2rfc generates RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies.
Project description
Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
Introduction
The IETF uses a specific format for the standards and other documents it publishes as RFCs, and for the draft documents which are produced when developing documents for publications. There exists a number of different tools to facilitate the formatting of drafts and RFCs according to the existing rules, and this tool, xml2rfc, is one of them. It takes as input an xml file that contains the text and meta-information about author names etc., and transforms it into suitably formatted output. The input xml file should follow the grammars in RFC7749 (for v2 documents) or RFC7991 (for v3 documents). Note that the grammar for v3 is still being refined, and changes will eventually be captured in the bis draft for 7991. Changes not yet captured can be seen in the xml2rfc source v3.rng, or in the documentation xml2rfc produces with its --doc
flag.
xml2rfc provides a variety of output formats. See the command line help for a full list of formats. It also provides conversion from v2 to v3, and can run the preptool on its input.
Installation
Installation of the python package is done as usual with pip install xml2rfc
, using appropriate switches.
Installation of support libraries for the PDF-formatter
In order to generate PDFs, xml2rfc uses the WeasyPrint module, which depends on external libraries that must be installed as native packages on your platform, separately from the xml2rfc install.
-
First, install the Pango, and other required libraries on your system. See installation instructions on the WeasyPrint Docs.
-
Next, install WeasyPrint python modules using pip.
pip install 'weasyprint==55.0'
- Finally, install the full Noto Font and Roboto Mono packages:
- Download the full font file from: https://noto-website-2.storage.googleapis.com/pkgs/Noto-unhinted.zip
- Follow the installation instructions at https://www.google.com/get/noto/help/install/
- Go to https://fonts.google.com/specimen/Roboto+Mono, and download the font. Follow the installation instructions above, as applied to this download.
- Go to https://fonts.google.com/noto/specimen/Noto+Sans+Math, and download the font. Follow the installation instructions above, as applied to this download.
With these installed and available to xml2rfc, the --pdf
switch will be enabled.
Usage
xml2rfc accepts a single XML document as input and outputs to one or more conversion formats.
Basic Usage
xml2rfc SOURCE [options] FORMATS...
Run xml2rfc --help
for a full listing of command-line options.
Getting Started
This project is following the standard Git Feature Workflow development model. Learn about all the various steps of the development workflow, from creating a fork to submitting a pull request, in the Contributing guide.
Make sure to read the Styleguides section to ensure a cohesive code format across the project.
You can submit bug reports, enhancements and new feature requests in the discussions area. Accepted tickets will be converted to issues.
Git Cloning Tips
As outlined in the Contributing guide, you will first want to create a fork of the xml2rfc project in your personal GitHub account before cloning it.
For example (replace USERNAME
with your GitHub username):
git clone https://github.com/USERNAME/xml2rfc.git
Docker Dev Environment
Run ./run.sh
command to build and start a docker development environment.
The initial build may take time because it downloads all required fonts as well.
./run.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file xml2rfc-3.18.0.tar.gz
.
File metadata
- Download URL: xml2rfc-3.18.0.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ac1098bdef7301c123f0d9a923c97f20db26b5d2821a4cc091fb66ed5481caa |
|
MD5 | 060494e81a701204db0349468bc505ad |
|
BLAKE2b-256 | af83de038ef67a675ad464bedd77e495375fcd5e5c69b93f4807382a99a3a6c9 |