From: Karim Hamidou Date: Thu, 3 Mar 2016 04:09:55 +0000 (-0800) Subject: starting from scratch with RFC conversion X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=61ed4d3839bfed761773ee2e30b2ebc8138fc13d;p=rfcspot.git starting from scratch with RFC conversion --- diff --git a/rfc.css b/rfc.css index 186ac795..0b9087cb 100644 --- a/rfc.css +++ b/rfc.css @@ -120,9 +120,18 @@ table td { } -.homepage > input { - font-size: 16px; - width: 40%; +.homepage { + display: flex; + align-items: center; + justify-content: center; +} + +.homepage .centered { + position: relative; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); } /*---------------------- Syntax Highlighting -----------------------------*/ diff --git a/src/render_rfc.py b/src/render_rfc.py new file mode 100644 index 00000000..a763dfa3 --- /dev/null +++ b/src/render_rfc.py @@ -0,0 +1,35 @@ +# render_rfc: convert an RFC from text to HTML. +# Does the following things: +# 1. remove page breaks and signatures +# 2. add links to the table of contents +import re +import sys + + +def remove_top_space(data): + topspace_regexp = re.compile(r"^(\n){4,}", re.MULTILINE) + data = topspace_regexp.sub('', data, count=1) + return data + +def remove_page_breaks(data): + pagebreak_regexp = re.compile(r"((\n){2,}^.*$\n\f$\n^.*$(\n){3,})", re.MULTILINE) + data = pagebreak_regexp.sub(r'\n', data) + return data + + +def render_rfc(filename): + with open(filename) as fd: + data = fd.read() + + for fn in [remove_top_space, remove_page_breaks]: + out = fn(data) + + return out + + +def main(): + print render_rfc(sys.argv[1]) + + +if __name__ == '__main__': + main() diff --git a/templates/index.html b/templates/index.html index ba794654..dd308b6e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,24 +1,18 @@ - + RFC Czar: RFC for the rest of us. - - - - - -
-
-

- RFCs for rest of us.
-

-
- -
-
-
+ +
+

+ RFCs for the rest of us.
+

+
+ +
+