사용자 도구

사이트 도구


sphinx

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
sphinx [2019/03/12 00:18] – [불릿 포인트] rex8312sphinx [2024/03/23 02:38] (현재) – 바깥 편집 127.0.0.1
줄 25: 줄 25:
   sys.path.append('{PROJECT_DIR}')   sys.path.append('{PROJECT_DIR}')
  
 +  # {PROJECT_DIR}/docs 일 경우
 +  import os
 +  import sys
 +  sys.path.insert(0, os.path.abspath('..'))
  
 ===== index.rst ==== ===== index.rst ====
줄 131: 줄 135:
   * http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html   * http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
   * https://sphinx-rtd-theme.readthedocs.io/en/latest/demo/demo.html?highlight=ref#id16   * https://sphinx-rtd-theme.readthedocs.io/en/latest/demo/demo.html?highlight=ref#id16
 +  * https://pythonhosted.org/an_example_pypi_project/sphinx.html
 ==== head ==== ==== head ====
  
줄 199: 줄 204:
 <code rst> <code rst>
  
-본문 내용중에 [#]_ 을 삽입 +본문 내용중에 [#]_ 또는 [#something]_ 을 삽입
-본문 내용 끝+
  
 +본문 내용 끝에 삽입
 +
 +.. rubric:: Footnotes
 .. [#] 풋노트 1 .. [#] 풋노트 1
 +.. [#something] 풋노트 2
 +
 +----
 +
 +
 +citation은 footnote와 유사하지만, global하게 사용
 +
 +[Ref]_ , [ABC112]_
 +
 +.. [Ref] Reference
 +.. [ABC112] Abc 112
  
 </code> </code>
줄 239: 줄 257:
 </code> </code>
  
 +<code rst>
 +.. literalinclude:: example.py
 +   :pyobject: Timer.start
 +</code>
  
 +<code rst>
 +.. literalinclude:: example.py
 +   :diff: example.py.orig
 +</code>
 ==== 디렉토리 구조 ==== ==== 디렉토리 구조 ====
  
줄 265: 줄 291:
  
 <code rst> <code rst>
-:source:`Lib/logging/__init__.py`+:source:`Lib/logging/__init__.py` 
 +`scripts/0_setup_script_dev.sh <../../../scripts/0_setup_script_dev.sh>`_
  
 :mod:`search` :mod:`search`
 +
 +# automodule
  
 :class:`search.mcts` :class:`search.mcts`
 +
 +# autoclass
  
 :classmethod:`search.mcts.act` :classmethod:`search.mcts.act`
  
 :func:`search.search` :func:`search.search`
 +
 +# autoclass
  
 :data:`search.MAX_DEPTH` :data:`search.MAX_DEPTH`
줄 348: 줄 381:
    * :ref:`Advanced Tutorial <logging-advanced-tutorial>`    * :ref:`Advanced Tutorial <logging-advanced-tutorial>`
    * :ref:`Logging Cookbook <logging-cookbook>`    * :ref:`Logging Cookbook <logging-cookbook>`
 +</code>
 +
 +===== Table =====
 +
 +<code rst>
 +.. list-table:: Title
 +   :widths: 25 25 50
 +   :header-rows: 1
 +
 +   * - Heading row 1, column 1
 +     - Heading row 1, column 2
 +     - Heading row 1, column 3
 +   * - Row 1, column 1
 +     -
 +     - Row 1, column 3
 +   * - Row 2, column 1
 +     - Row 2, column 2
 +     - Row 2, column 3
 +</code>
 +
 +  * https://sublime-and-sphinx-guide.readthedocs.io/en/latest/tables.html
 +
 +
 +**tabulate**
 +
 +<code python>
 +# conda install tabulate
 +
 +from tabulate import tabulate
 +table = [["Sun",696000,1989100000], ["Earth",6371,5973.6], ["Moon",1737,73.5], ["Mars",3390,641.85]]
 +print(tabulate(table, ["P", "L", "b"], 'rst'))
 +
 +# =====  ======  =============
 +# P                        b
 +# =====  ======  =============
 +# Sun    696000     1.9891e+09
 +# Earth    6371  5973.6
 +# Moon     1737    73.5
 +# Mars     3390   641.85
 +# =====  ======  =============
 </code> </code>
sphinx.1552349897.txt.gz · 마지막으로 수정됨: 2024/03/23 02:37 (바깥 편집)