Generally, you don’t have to know read here. Please read yogosyu extension.


Module yogosyu

The Sphinx extension to provide yomigana to glossary.

copyright:© 2011-2015 by Suzumizaki-Kimitaka(only for additional works)
license:2-clause BSD.

This is the extension for Sphinx to add the yogosyu directive used to replace glossary.

The yogosyu directive can sort the terms by the order given from the user(document writer). Especially to support the language like Japanese, :yomimark: option is exist and make the way adding the reading(shows how to read) to each term.

This module depends on the module sortorder. The document of the module shows how to make your own order for the languages you want.

yomimark can be one of single_char_or_whitespace_or_unicode. the acceptable words are defined in docutils.parsers.rst.directives as follows:

  • one of the words: tab space
  • any single unicode character except white-spaces
  • the character itself, or the code point represented by:
    • the decimal number
    • the hexadecimal number prefixed x, x, U+, u, or u
    • XML style like ☮

The every term is splited by yomimark. 1st is the term itself, 2nd is treated as Yomigana(how to read). Currently 3rd and followers are simply ignored, but using this way, the ‘mono ruby’ may be supported for the future. (see HTML ruby module for example.)

Not all the entry have to give yomigana. When yomigana is not assigned, the name of the entry is used to sort.

yomigana itself is currently not shown in output HTML files. They’re only used to sort.

class yogosyu.Yogosyu(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Yomigana featured version of

Directive to create a glossary with cross-reference targets for :term: roles. The option yomimark is added.

The base class is docutils.parsers.rst.Directive. The option parser is defined in the module docutils.parsers.rst.directives.



Base codes are copied from the module


Determine sort order used in this module

Parameters:cfg (sphinx.config.Config) – you can give from Sphinx with app.config, builder.config etc.
Return type:None
yogosyu.make_term_from_paragraph_node(termnodes, ids)

Copied function of

Currently, no lines are modified. Called from

yogosyu.make_termnodes_from_paragraph_node(env, node_and_yomi, new_id=None)

helper function of

  • node_and_yomi (tuple) – the entry
  • new_id (str_or_unicode_or_None) – give the id if you already made.

Copied from, modified 2 blocks and the 2nd parameter.


Defined to override


Extend the Sphinx as we want, called from the Sphinx

Parameters:app (sphinx.application.Sphinx) – the object to add builder or something.

Defined to override sphinx.util.nodes.make_refnode().