reflows all of the text, but makes no content changes.
The numbered list was indented appropriately for recognition, but
(again) no content changes occurred.
* Refactored the file I/O model throughout, to support multiple
processing paths. PEP source text is now read into a list of lines.
* In ``fixfile()``:
- Updated its parameters for the new I/O model.
- Changed ``fo`` to ``outfile``, ``fi`` to ``inpath`` and
``input_lines``.
- Input is read in by iterating over the list of input lines, rather
than using "readlines()".
- Opening and closing of files is done by the caller, "make_html()".
- Added PEP number processing in Requires header.
- Linked "Content-Type: text/plain" to PEP 9.
* Added ``fix_rst_pep()``, which imports and calls Docutils code.
* Added ``get_pep_type()``, which checks for a Content-Type header and
returns the value, defaulting to "text/plain". If no PEP header is
found, ``None`` is returned: input is not a PEP.
* Added ``get_input_lines()`` to read input file into a list.
* Expanded ``make_html()`` to catch errors and process the different
PEP formats via the new ``PEP_TYPE_DISPATCH`` dict.
* Added ``check_requirements()`` to check both Python and Docutils
requirements. ``pep_type_error()`` is called if the required
software is not available.
* In ``main()``:
- Added an ``argv`` parameter, so that pep2html.py can be imported
and command-line options passed in. Yes, I use this functionality
in the Docutils "buildhtml.py" front end.
- Files skipped (due to an error) are not pushed onto the server.
New Meta-PEP, "Sample reStructuredText PEP Template"
====================================================
* I've presumed to use "PEP 12", as the next available Meta-PEP
number; I'll change it if I'm mistaken. (Barry: PEP 12 was agreed
on as fine).
* Its status is "Draft". If acceptable as-is, please change the
Status header to "Active". (Barry: Done)
* I've listed Barry as co-author. Since much of the text was copied
from PEP 9, I figure it's only fair. (Barry: thanks!)
* This PEP is marked up using reStructuredText, naturally.
* The "Abstract", "Rationale", and "How to Use This Template" sections
are based on PEP 9. "Abstract" has a reference back to PEP 9.
"Rationale" contains a one-paragraph rationale for reStructuredText
PEPs. "How to Use This Template" has been marked up a bit.
* The "ReStructuredText PEP Formatting Requirements" section is the
big difference. Subsection "General" contains the same text-level
instructions as in PEP 9: two spaces at sentence end; 70 columns; no
tabs; Emacs stanza. The rest of the section describes the
reStructuredText syntax and PEP-specific conventions.