yuuho.wiki

カオスの欠片を集めて知恵の泉を作る

ユーザ用ツール

サイト用ツール


tips:sphinx:start

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
tips:sphinx:start [2022/03/16 07:02] – [sphinx-quickstart で生成されるファイル] yuuhotips:sphinx:start [2022/03/16 08:06] (現在) – [設定の変更など] yuuho
行 83: 行 83:
     - ./build/     - ./build/
     - ./source/     - ./source/
 +      - ./source/_static/
 +      - ./source/_templates/
 +      - ./source/conf.py
 +      - ./source/index.rst
     - ./make.bat     - ./make.bat
     - ./Makefile     - ./Makefile
行 88: 行 92:
 となった。 となった。
  
-=== ページの生成 ===+==== ページの生成 (make html) で生成されるファイル ====
  
 +=== 生成 ===
 ''.'' で <code bash>make html</code> すればよい。 ''.'' で <code bash>make html</code> すればよい。
  
 +=== 結果 ===
 実行したディレクトリを ''.'' とすると 実行したディレクトリを ''.'' とすると
 <code> <code>
行 99: 行 105:
       - ./build/html      : gh-pages として公開すれば良いディレクトリ       - ./build/html      : gh-pages として公開すれば良いディレクトリ
     - ./source/     - ./source/
 +      - ./source/_static/
 +      - ./source/_templates/
 +      - ./source/conf.py
 +      - ./source/index.rst
     - ./make.bat     - ./make.bat
     - ./Makefile     - ./Makefile
行 107: 行 117:
  
 ''build/html/'' の中で ''python -m http.server'' すれば良い。\\ ''build/html/'' の中で ''python -m http.server'' すれば良い。\\
-なので、 ''build/html/'' さえ gh-pages で公開すれば良さそう。+なので、 ''build/html/'' さえ gh-pages で公開すれば良さそう。\\ 
 +-> github pages は jekyll というソフトで実装されているため相対リンクなどを有効にするために特殊な設定が必要。\\ 
 +-> 拡張機能を入れるべし
  
  
行 117: 行 129:
 [[https://kuma8.hatenablog.jp/entry/20110925/1316937363]] [[https://kuma8.hatenablog.jp/entry/20110925/1316937363]]
  
 +  * 拡張機能
 +    * ''./source/conf.py'' の ''extensions'' という listオブジェクトの中に以下の文字列を追加。\\ 特にインストール操作など必要ない。書き込むだけ。
 +      * ''"sphinx.ext.githubpages"''
  
 +=== メモ2 ===
 +
 +<code>
 +.. hoge::
 +</code>
 +みたいな感じで hoge 機能を使える。
 +使える機能としては ''toctree'' や ''index'' ''note'' ''warning'' などある。
 +<code>
 +.. fuga fuga piyo piyo
 +</code>
 +で単純にコメントを書く。
 +
 +=== メモ3 ===
 +
 +よく使われているテーマ。
 +[[https://qiita.com/ganyariya/items/543e5bc55ef0777cbd0c]]
 +
 +<code bash>pip install sphinx-rtd-theme</code>
 +
 +<code python conf.py>
 +extensions = [
 +    'sphinx.ext.autodoc',
 +    'sphinx.ext.viewcode',
 +    'sphinx.ext.todo',
 +    'sphinx.ext.napoleon',
 +    'sphinx_rtd_theme'
 +]
 +html_theme = 'sphinx_rtd_theme'
 +</code>
tips/sphinx/start.1647414179.txt.gz · 最終更新: 2022/03/16 07:02 by yuuho