0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Sphinx】Indexロールの使い方

Last updated at Posted at 2021-09-21

「.. index::」と段落の前に索引ページの掲載を指定するだけでなく、:index:`言葉` と書くことで文章中の単語を索引ページからアクセスできるようになる。

📝書き方の例

次のrstファイルは、可能な記載方法を確認したもの。

indexロールの記載例
###################

標準的な書き方

- 副用語なし: :index:`やよ|用語`
- 副用語あり: :index:`やよ|用語; はふ|副用語`

タイトルと実体を分ける

- single(暗黙)

    - :index:`ようご|用語3^<ささ|索引3>`
    - :index:`ようご|用語4^<ささ|索引4-1; さくいん|索引4-2>`
    
- single(明示)

    - :index:`ようご|用語5^<single: さくいん|索引5>`
    - :index:`ようご|用語6^<single: さくいん|索引6-1^; さくいん|索引6-2>`
    
- pair

    - :index:`ようご|用語7^<pair: さくいん|索引7-1^; さくいん|索引7-2>`
    
- triple

    - :index:`ようご|用語8^<triple: さくいん|索引8-1^; さくいん|索引8-2; さくいん|索引8-3>`

- single(多数)

    - :index:`ようご|用語9^<ささ|索引9-1, ささ|索引9-2, ささ|索引9-3, ささ|索引9-4, ささ|索引9-5>`
    - :index:`ようご|用語A^<ささ|索引A-1, ささ|索引A-21; ささ|索引A-22, ささ|索引A-3>`
    
索引ページと見比べることで、それぞれ「single/pair/triple」として処理されていることがわかる.

⚠補足

上記の「ようご」の指定を有効にするには、次の拡張が必要です。

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?