クイックスタート

このガイドでは、数分でtypsphinxを使い始めることができます。

基本的なセットアップ

  1. **typsphinxをインストール**(まだの場合):

    pip install typsphinx
    
  2. Sphinxプロジェクトに追加

    conf.pyextensions リストに typsphinx を追加:

    extensions = [
        "typsphinx",
    ]
    

    注釈

    エントリーポイントのおかげで、extensions への追加はオプションです。ビルダーは自動的に検出されます。

  3. Typst出力をビルド

    # Generate Typst markup
    sphinx-build -b typst source/ build/typst
    
    # Or generate PDF directly
    sphinx-build -b typstpdf source/ build/pdf
    

初めてのPDF

初めてのPDFを生成する最小限の例です:

  1. シンプルな index.rst を作成:

    Welcome to My Documentation
    ===========================
    
    This is a sample document.
    
    Features
    --------
    
    - Easy to use
    - Beautiful PDFs
    - Fast compilation
    
  2. PDFをビルド:

    sphinx-build -b typstpdf source/ build/pdf
    
  3. PDFは build/pdf/index.pdf にあります!

設定オプション

conf.py にオプションを追加して出力をカスタマイズできます:

# Project information
project = "My Project"
author = "Your Name"
release = "1.0.0"

# Typst configuration
typst_documents = [
    ("index", "myproject", project, author, "typst"),
]

# Use mitex for LaTeX math
typst_use_mitex = True

# Custom template (optional)
typst_template = "_templates/custom.typ"

次のステップ