}
-.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 -----------------------------*/
--- /dev/null
+# 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()
<!DOCTYPE html>
-<html style='height: 100%;'>
+<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>RFC Czar: RFC for the rest of us.</title>
<link rel="stylesheet" href="rfc.css">
</head>
-<body style="height: 100%;" class="homepage">
-<table style="width: 100%;">
- <tr>
- <td style="text-align: center; vertical-align: middle; top: 40%;">
- <center>
- <h2>
- RFCs for <a href="rfc7231.html">rest of us</a>.<br>
- </h2>
- <div>
- <input type="text" placeholder="Type an RFC name or keywords"></input>
- </div>
- </center>
- </td>
- </tr>
-</table>
+<body>
+ <div class="homepage">
+ <h2 class="centered">
+ RFCs for the rest of us.<br>
+ </h2>
+ <div>
+ <input type="text" placeholder="Type an RFC name or keywords"></input>
+ </div>
+ </div>
</body>
</html>