|
1 | 1 | #!/usr/local/python34/bin/python3
|
2 | 2 | # -*- coding: UTF-8 -*-
|
3 |
| -#功能:在html中添加在线纠错链接 |
| 3 | +#功能:在html中添加其他版本链接,在线纠错链接和全文检索框 |
4 | 4 |
|
5 | 5 | import sys
|
6 | 6 | import os
|
|
9 | 9 | import html2sgml_map
|
10 | 10 |
|
11 | 11 | patternInsertPos=re.compile(r'.*<body>',re.S)
|
12 |
| -InsertHTML="""<div class="preheader"><div style="position: relative; overflow: hidden; margin: 10px 0;"> |
| 12 | +InsertHTML="""<div class="preheader"> |
| 13 | +<div style="float: left"> |
| 14 | +<a style="margin : 0px 5px 0px 5px;" href="/docs/9.3/{0}" target="_top">9.3</a> |
| 15 | +<a style="margin : 0px 5px 0px 5px;" href="/docs/9.4/{0}" target="_top">9.4</a> |
| 16 | +<a style="margin : 0px 5px 0px 5px;" href="/docs/9.5/{0}" target="_top">9.5</a> |
| 17 | +<a style="margin : 0px 5px 0px 5px;" href="/docs/9.6/{0}" target="_top">9.6</a> |
| 18 | +<a style="margin : 0px 5px 0px 5px;" href="/docs/10/{0}" target="_top">10</a> |
| 19 | +<span style="margin : 0px 5px 0px 5px;">11</span> |
| 20 | +</div> |
| 21 | +
|
| 22 | +<div style="text-align:right"> |
| 23 | +<a style="margin : 0px 0px 0px 10px;" href="https://github.com/postgres-cn/pgdoc-cn/issues/new" target="_blank" title="在Github上报告问题(请注明问题内容及所在章节)">问题报告</a> |
| 24 | +<a style="margin : 0px 0px 0px 10px;" href="https://github.com/postgres-cn/pgdoc-cn/edit/master/postgresql/doc/src/sgml/{1}" target="_blank" title="直接在Github上纠错本页面">纠错本页面</a> |
| 25 | +</div> |
| 26 | +
|
| 27 | +<div style="position: relative; overflow: hidden; margin: 10px 0;"> |
13 | 28 | <form method="GET" action="/v2/doc_search" style="float: right; width: 400px; max-width: 100%;">
|
14 | 29 | <input type="hidden" name="u" value="/docs/11" />
|
15 | 30 | <input style="width: 80%; height: 40px; font-size: 1.0em; padding: 0 10px; margin: 0; border: 1px solid #ccc; box-sizing: border-box;" type="text" placeholder="在文档中查找..." name="q"
|
16 | 31 | /><button style="width: 20%; height: 40px; font-size: 1.0em; padding: 0; margin: 0; border: 1px solid #ccc; box-sizing: border-box; border-left: 0; cursor: pointer;" type="submit" id="#submit">搜索</button>
|
17 |
| -</form></div> |
18 |
| -<div style="text-align:right"> |
19 |
| -<a style="margin : 0px 0px 0px 10px;" href="https://github.com/postgres-cn/pgdoc-cn/issues/new" target="_blank" title="在Github上报告问题(请注明问题内容及所在章节)">问题报告</a> |
20 |
| -<a style="margin : 0px 0px 0px 10px;" href="https://github.com/postgres-cn/pgdoc-cn/edit/master/postgresql/doc/src/sgml/{0}" target="_blank" title="直接在Github上纠错本页面">纠错本页面</a> |
21 |
| -</div></div>""" |
| 32 | +</form> |
| 33 | +</div> |
| 34 | +
|
| 35 | +</div> |
| 36 | +""" |
22 | 37 |
|
23 | 38 | sgmlDir="../build/doc/src/sgml"
|
24 | 39 | htmlDir=os.path.join(sgmlDir,"html")
|
@@ -47,7 +62,7 @@ def process(file):
|
47 | 62 | print(filename+","+sgmlfile)
|
48 | 63 | match=patternInsertPos.match(content)
|
49 | 64 | print(content[0:match.end()],file=fout)
|
50 |
| - print(InsertHTML.format(sgmlfile),file=fout) |
| 65 | + print(InsertHTML.format(filename,sgmlfile),file=fout) |
51 | 66 | print(content[match.end():],file=fout)
|
52 | 67 | fin.close()
|
53 | 68 | fout.close()
|
|
0 commit comments