Skip to content

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

License

Notifications You must be signed in to change notification settings

KaKkouo/kana_text

Repository files navigation

Documentation Status Build Status (CircleCI) Code Coverage Status (Codecov) BSD 2 Clause

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

installtion

$ pip install sphindexer sphinxcontrib.kana_text

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'
#kana_text_on_genindex = False

Warning

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

rst file:

.. index:: ようご|用語^21
.. glossary::

   ようごいち|用語壱^212
     用語1の説明。
夜空に浮かぶ\ :index:`あまた|数多^21`\ の星々が\ :kana:`きらめいて|煌めいて^2c`\ いる。

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

:term:`linkt to the term<ようごいち|用語壱^212>`

build:

$ make html

genindex.html

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

note

The indexer function of this package is handled by "sphindexer". This package also serves as a reference implementation of how to add reading information.

If you want to use your own notation for reading, please refer to the implementation on Github and create your own notation. The analysis of your own notation will be integrated into "KanaText".

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages