diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-11-06 23:53:00 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-11-06 23:53:00 +0100 |
commit | f5bd5efea9340c39c673d999d419a97bb6a20990 (patch) | |
tree | 5d725bbee6f3f554e14995f098c95467c872ee35 /http.py | |
parent | Initial commit. (diff) | |
download | man-http-master.tar.gz man-http-master.tar.xz |
Diffstat (limited to 'http.py')
-rwxr-xr-x | http.py | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +import csv +from roff import ( + now, + roff_table, + section_heading, + subsection_heading, + title_heading, +) +title_heading('HTTP', 7, + footer_middle=f"{now():%Y-%m-%d}") + +section_heading("STATUS CODES") + +with open('http-status-codes-1.csv') as f: + entries = list(csv.DictReader(f)) + +roff_table([("Code", 'R'), + ("Description", "L"), + ("Reference", 'L')], + ["Value", "Description", "Reference"], + entries) + +section_heading('HEADERS') + +with open("field-names.csv") as f: + entries = list(csv.DictReader(f)) + +for entry in entries: + subsection_heading(entry["Field Name"]) + print(entry["Status"] + ", ") + print(entry["Reference"]) + print() + print(entry["Comments"]) |