Skip to content

attakei-lab/sphinxcontrib-budoux

Repository files navigation

sphinxcontrib-budoux

Overview

This is Sphinx extension to break line of heading texts by BudouX.

Simple example

From source is:

あなたに寄り添う最先端のテクノロジー
====================================

Output without this is:

<h1>あなたに寄り添う最先端のテクノロジー</h1>

Output with this is:

<h1 style="word-break: keep-all; overflow-wrap: break-word;">あなたに<wbr/>寄り添う<wbr/>最先端の<wbr/>テクノロジー</h1>

Installation

pip install sphinxcontrib-budoux

Usage

extensions = [
    "sphinxcontrib.budoux",
]

# Tag to ijnect for splitted texts
budoux_split_tag = "wbr"
# Style for splitted-tag
budoux_split_style = "budoux_split_style", "word-break: keep-all; overflow-wrap: break-word;"
# Target tags for apply BudouX
budoux_targets = ["h1", "h2"]

Note

Main targets for edit are heading text, not but contents of paragraph.

If you set p, li and others into budoux_targets`, this may not work correctly that you think.

Example

See doc (written by Japanese).