• R/O
  • SSH
  • HTTPS

sawarabi-fonts: コミット


コミットメタ情報

リビジョン160 (tree)
日時2019-04-15 21:23:50
作者mshio

ログメッセージ

Update a document generating script.

変更サマリ

差分

--- trunk/html/bin/gen.py (revision 159)
+++ trunk/html/bin/gen.py (revision 160)
@@ -106,22 +106,18 @@
106106
107107 if __name__ == "__main__":
108108 args = parse_args()
109- print(args.source)
110- print(args.out_path)
111- print(args.template_path)
112109
113110 with open(args.source) as f:
114111 lines = f.readlines()
115112 doc = Parser(Section, rules).parse(lines)
116113
117- print(doc)
118-
119114 temp = html.parse(args.template_path)
120115 temp.getroot().attrib['lang'] = doc.property['lang']
121116 temp.xpath('//title')[0].text = doc.property['title']
122117 img = temp.xpath('//div[contains(@class, "logo")]/img')[0]
123- img.attrib['src'] = f"/img/logo-{doc.property['lang']}"
124118 img.attrib['alt'] = doc.property['title']
119+ langname = temp.xpath('//div[contains(@id, "current-lang")]/span')[0]
120+ langname.text = doc.property['language']
125121
126122 for sec in temp.xpath('//section'):
127123 id = sec.attrib['id']
@@ -128,5 +124,7 @@
128124 fg = html.fromstring(doc[id])
129125 sec.append(fg)
130126
127+ for a in temp.xpath('//a'): a.attrib['target'] = '_blank'
128+
131129 with open(args.out_path, 'w') as f:
132130 f.write(html.tostring(temp, encoding='utf-8').decode())
--- trunk/html/css/style.css (revision 159)
+++ trunk/html/css/style.css (revision 160)
@@ -25,7 +25,7 @@
2525 }
2626 nav .container div#navbar div#lang div.item {
2727 padding: 26px 1em 0 1em;
28- width: 80px;
28+ width: 85px;
2929 height: 40px;
3030 cursor: pointer;
3131 background-color: #fff;
@@ -69,7 +69,7 @@
6969 header .container .buttons-container .pressed {
7070 background-color: #c8c8c8;
7171 }
72-article .container {
72+#docs .container {
7373 width: 650px;
7474 margin: 0 auto;
7575 padding: 10px 15px;
--- trunk/html/en.txt (revision 159)
+++ trunk/html/en.txt (revision 160)
@@ -13,7 +13,7 @@
1313 Sawarabi Gothic and Mincho are normal ordinary fonts and have not notable
1414 features. But it can be said that their design concept might be a little
1515 traditional (or old fashioned), if compared with
16-[VL Gothic](http://dicey.org/vlgothic/) (or [M+ FONTS](https://mplus-fonts.osdn.jp/))
16+[VL Gothic](http://dicey.org/vlgothic/) and [M+ FONTS](https://mplus-fonts.osdn.jp/)
1717 which have already been popular as free Japanese fonts.
1818
1919 Though both of fonts are available, they have not yet enough characters for
@@ -44,7 +44,7 @@
4444 You can download the latest Sawarabi Fonts from the following links:
4545
4646 <div id="download-box">
47-<script charset="utf-8" type="text/javascript" src="https://osdn.net/projects/sawarabi-fonts/files/compact.js"></script>
47+<script src="https://osdn.net/projects/sawarabi-fonts/files/compact.js"></script>
4848 <noscript>
4949 <p style="border: 1px solid black">
5050 (The download links cannot be shown because your browser disable JavaScript.
--- trunk/html/ja.txt (revision 159)
+++ trunk/html/ja.txt (revision 160)
@@ -40,7 +40,7 @@
4040 ゴシックが sawarabi-gothic、さわらび明朝が sawarabi-mincho に対応しています。
4141
4242 <div id="download-box">
43-<script charset="utf-8" type="text/javascript" src="https://osdn.net/projects/sawarabi-fonts/files/compact.js"></script>
43+<script src="https://osdn.net/projects/sawarabi-fonts/files/compact.js"></script>
4444 <noscript>
4545 <p style="border: 1px solid black"> (JavaScript が有効になっていない場合は、
4646 ここにリンクは現れません。
--- trunk/html/template.html (revision 159)
+++ trunk/html/template.html (revision 160)
@@ -4,19 +4,43 @@
44 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
55 <title></title>
66 <link rel="stylesheet" href="css/style.css" type="text/css" />
7- <script src="js/mobile.js" type="text/javascript"></script>
8- <script src="js/jquery-2.1.0.min.js" type="text/javascript"></script>
9- <script src="js/lang.js" type="text/javascript"></script>
10- <script src="js/doc-header/ja.js" type="text/javascript"></script>
11- <script src="js/doc-header.js" type="text/javascript"></script>
7+ <script src="js/mobile.js"></script>
8+ <script src="js/jquery-2.1.0.min.js"></script>
9+ <script src="js/lang.js"></script>
10+ <script src="js/doc-header/ja.js"></script>
11+ <script src="js/doc-header.js"></script>
1212 </head>
1313 <body>
1414 <nav>
1515 <div class="container">
1616 <div id="navbar">
17- <div class="logo"><img src="img/logo-en.png" alt="Sawarabi Fonts" /></div>
17+ <div class="logo">
18+ <img src="img/logo-ja.png" alt="Sawarabi Fonts" />
19+ </div>
1820 <div id="lang">
19- <div id="current-lang" class="item" title="Select your language">English</div>
21+ <div id="current-lang" class="item" title="Select your language">
22+ <svg xmlns="http://www.w3.org/2000/svg"
23+ version="1.1"
24+ width="21"
25+ height="21"
26+ style="position:relative; top:.25em;">
27+ <circle cx="10.5" cy="10.5" r="9.45"
28+ fill="none" stroke="black" stroke-width="1" />
29+ <line x1="10.5" y1="1.05" x2="10.5" y2="19.95"
30+ stroke="black" stroke-width="1" />
31+ <line x1="1.05" y1="10.5" x2="19.95" y2="10.5"
32+ stroke="black" stroke-width="1" />
33+ <path d="M3.78,3.78 C6.3,7.98 14.7,7.98 17.22,3.78"
34+ fill="none" stroke="black" stroke-width="1" />
35+ <path d="M3.78,17.22 C6.3,13.02 14.7,13.02 17.22,17.22"
36+ fill="none" stroke="black" stroke-width="1" />
37+ <path d="M10.5,1.05 C3.78,3.15 3.78,17.85 10.5,19.95"
38+ fill="none" stroke="black" stroke-width="1" />
39+ <path d="M10.5,1.05 C17.22,3.15 17.22,17.85 10.5,19.95"
40+ fill="none" stroke="black" stroke-width="1" />
41+ </svg>
42+ <span>English</span>
43+ </div>
2044 <div id="lang-menu-container" class="container">
2145 </div>
2246 </div>
@@ -27,12 +51,15 @@
2751
2852 <header>
2953 <div class="container">
30- <div class="buttons-container"><div class="inner-container"></div></div>
54+ <div class="buttons-container">
55+ <div class="inner-container">
56+ </div>
57+ </div>
3158 <canvas id="header-canvas" width="680" height="300"></canvas>
3259 </div>
3360 </header>
3461
35- <article id="docs">
62+ <div id="docs">
3663 <div class="container">
3764
3865 <section id="about">
@@ -50,7 +77,7 @@
5077 <section id="links">
5178 </section>
5279 </div>
53- </article>
80+ </div>
5481
5582 <footer>
5683 <div class="container">
旧リポジトリブラウザで表示