if __name__ == "__main__":
args = parse_args()
- print(args.source)
- print(args.out_path)
- print(args.template_path)
with open(args.source) as f:
lines = f.readlines()
doc = Parser(Section, rules).parse(lines)
- print(doc)
-
temp = html.parse(args.template_path)
temp.getroot().attrib['lang'] = doc.property['lang']
temp.xpath('//title')[0].text = doc.property['title']
img = temp.xpath('//div[contains(@class, "logo")]/img')[0]
- img.attrib['src'] = f"/img/logo-{doc.property['lang']}"
img.attrib['alt'] = doc.property['title']
+ langname = temp.xpath('//div[contains(@id, "current-lang")]/span')[0]
+ langname.text = doc.property['language']
for sec in temp.xpath('//section'):
id = sec.attrib['id']
fg = html.fromstring(doc[id])
sec.append(fg)
+ for a in temp.xpath('//a'): a.attrib['target'] = '_blank'
+
with open(args.out_path, 'w') as f:
f.write(html.tostring(temp, encoding='utf-8').decode())
Sawarabi Gothic and Mincho are normal ordinary fonts and have not notable
features. But it can be said that their design concept might be a little
traditional (or old fashioned), if compared with
-[VL Gothic](http://dicey.org/vlgothic/) (or [M+ FONTS](https://mplus-fonts.osdn.jp/))
+[VL Gothic](http://dicey.org/vlgothic/) and [M+ FONTS](https://mplus-fonts.osdn.jp/)
which have already been popular as free Japanese fonts.
Though both of fonts are available, they have not yet enough characters for
You can download the latest Sawarabi Fonts from the following links:
<div id="download-box">
-<script charset="utf-8" type="text/javascript" src="https://osdn.net/projects/sawarabi-fonts/files/compact.js"></script>
+<script src="https://osdn.net/projects/sawarabi-fonts/files/compact.js"></script>
<noscript>
<p style="border: 1px solid black">
(The download links cannot be shown because your browser disable JavaScript.
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" href="css/style.css" type="text/css" />
- <script src="js/mobile.js" type="text/javascript"></script>
- <script src="js/jquery-2.1.0.min.js" type="text/javascript"></script>
- <script src="js/lang.js" type="text/javascript"></script>
- <script src="js/doc-header/ja.js" type="text/javascript"></script>
- <script src="js/doc-header.js" type="text/javascript"></script>
+ <script src="js/mobile.js"></script>
+ <script src="js/jquery-2.1.0.min.js"></script>
+ <script src="js/lang.js"></script>
+ <script src="js/doc-header/ja.js"></script>
+ <script src="js/doc-header.js"></script>
</head>
<body>
<nav>
<div class="container">
<div id="navbar">
- <div class="logo"><img src="img/logo-en.png" alt="Sawarabi Fonts" /></div>
+ <div class="logo">
+ <img src="img/logo-ja.png" alt="Sawarabi Fonts" />
+ </div>
<div id="lang">
- <div id="current-lang" class="item" title="Select your language">English</div>
+ <div id="current-lang" class="item" title="Select your language">
+ <svg xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="21"
+ height="21"
+ style="position:relative; top:.25em;">
+ <circle cx="10.5" cy="10.5" r="9.45"
+ fill="none" stroke="black" stroke-width="1" />
+ <line x1="10.5" y1="1.05" x2="10.5" y2="19.95"
+ stroke="black" stroke-width="1" />
+ <line x1="1.05" y1="10.5" x2="19.95" y2="10.5"
+ stroke="black" stroke-width="1" />
+ <path d="M3.78,3.78 C6.3,7.98 14.7,7.98 17.22,3.78"
+ fill="none" stroke="black" stroke-width="1" />
+ <path d="M3.78,17.22 C6.3,13.02 14.7,13.02 17.22,17.22"
+ fill="none" stroke="black" stroke-width="1" />
+ <path d="M10.5,1.05 C3.78,3.15 3.78,17.85 10.5,19.95"
+ fill="none" stroke="black" stroke-width="1" />
+ <path d="M10.5,1.05 C17.22,3.15 17.22,17.85 10.5,19.95"
+ fill="none" stroke="black" stroke-width="1" />
+ </svg>
+ <span>English</span>
+ </div>
<div id="lang-menu-container" class="container">
</div>
</div>
<header>
<div class="container">
- <div class="buttons-container"><div class="inner-container"></div></div>
+ <div class="buttons-container">
+ <div class="inner-container">
+ </div>
+ </div>
<canvas id="header-canvas" width="680" height="300"></canvas>
</div>
</header>
- <article id="docs">
+ <div id="docs">
<div class="container">
<section id="about">
<section id="links">
</section>
</div>
- </article>
+ </div>
<footer>
<div class="container">