This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TeX出力時の文書構造を変更する | |
from docutils import nodes | |
from sphinx.writers.latex import LaTeXTranslator | |
class AppendixLaTeXTranslator(LaTeXTranslator): | |
def __init__(self, document: nodes.document, builder: "LaTeXBuilder", | |
theme: "Theme" = None) -> None: | |
super().__init__(document, builder) | |
self.is_mainmatter = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sphinx-term-validator用辞書 | |
# Akihiro Takizawa <[email protected]> | |
# shimizukawa作のsphinx-term-validator (https://github.com/shimizukawa/sphinx-term-validator)用の辞書 | |
# 文字の重複 | |
、、 連続した読点 | |
。。 連続した句点 | |
ーー ー | |
がが が | |
にに に |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 現在のSphinxでは図表番号やnumbered_referenceで参照する図表番号は | |
# サブセクションのレベルでリセットされるが、章(ドキュメント)単位での | |
# 連番に書き換える | |
def transform_fignumbers(app, doctree, docname)-> None: | |
fignumbers = app.env.toc_fignumbers | |
for docname in fignumbers.keys(): | |
for figtype in fignumbers[docname].keys(): | |
cnt = 1 | |
for fig in fignumbers[docname][figtype]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Google App Scriptとgooのふりがな化APIを使って、単語のフリガナを得る関数 | |
ふりがな化API(https://labs.goo.ne.jp/api/jp/hiragana-translation/) */ | |
function getPhonetic(term, app_id="<add your app_id>") { | |
const alnum = /^[a-zA-Z\(\)\.\$\*\+\-\#\{\}\[\] ]+$/; | |
if (term.length==0){ | |
return ''; | |
} else if (term.match(alnum)==null){ | |
const data = { | |
"app_id": app_id, |