sphinxcontrib.kana-text

KanaText class extends the functionality of Text class, for someone who use index/glossary directives.


Keywords
sphinx, sphinxcontrib, japanese, ja, kana_text, glossary, index, kana, python3
License
BSD-1-Clause
Install
pip install sphinxcontrib.kana-text==0.30.2

Documentation

This is a sphinx extention. It extends the functionality of the Text class. Any person, who uses index/glossary directives with Japanse Kanji, is to be so happy.

https://i.gyazo.com/4cbf3408c162fb2bfcc493661d35a42b.png

If word_list.txt is used by kana_text_word_file parameter, the genindex.html is created without editing rst files.

QUICK START

conf.py:

extensions = ['sphinxcontrib.kana_text']
#kana_text_word_file = '~/.config/sphinx/word_list.txt'
#kana_text_word_list = ['ใ‚ˆใ†ใ”|็”จ่ชž^21', 'ใถใ‚“ใ—ใ‚‡ใ•ใใ›ใ„|ๆ–‡ๆ›ธไฝœๆˆ^2222',]
#kana_text_indexer_mode = 'small'
#html_kana_text_on_genindex = False

Warning

  • 'word_list.txt' is required for kana_text_word_file
  • 'genindex.html' is required for html_kana_text_on_genindex = True.
  • both parameters are valid only against genindex.html.

rst file:

.. index:: ใ‚ˆใ†ใ”|็”จ่ชž^21
.. glossary::

   ใ‚ˆใ†ใ”ใ„ใก|็”จ่ชžๅฃฑ^212
     ็”จ่ชž๏ผ‘ใฎ่ชฌๆ˜Žใ€‚
ๅคœ็ฉบใซๆตฎใ‹ใถ\ :index:`ใ‚ใพใŸ|ๆ•ฐๅคš^21`\ ใฎๆ˜Ÿใ€…ใŒ\ :kana:`ใใ‚‰ใ‚ใ„ใฆ|็…Œใ‚ใ„ใฆ^2c`\ ใ„ใ‚‹ใ€‚

https://i.gyazo.com/63fe4ccfaa8a57bb2d8db50c0a689cad.png

build:

$ make kana

genindex.html

$ sphinx-kana-genindex
$ mv genindex.html.sample path_to_sphinx_project/_templates/genindex.html