Code Monkey home page Code Monkey logo

sphinx_template's Introduction

README

ライブラリのインストール

Sphinx をはじめとした必要なライブラリをインストール

pip install sphinx
pip install commonmark
pip install recommonmark
pip install nbsphinx
pip install sphinx_rtd_theme

資料作成

.
├── Makefile
├── README.md
├── _build
│   ├── doctrees
│   └── html
├── conf.py
├── index.rst
├── make.bat
└── src
    ├── 1.md
    ├── 2.ipynb
    ├── 3.ipynb
    └── 4.md

資料の設定

資料に関する設定はconf.pyに記述します。

変更するであろう主な部分は以下くらいです。

project = 'プロジェクト名'
copyright = '2018, 会社名'
author = '会社名'

また、Sphinxのテーマは以下に設定していますが、こちらはお好きなものに変更していただければと思います。必要に応じて、テーマをインストールしてください。テーマ一覧は最下部の参考URLを御覧ください。

html_theme = "sphinx_rtd_theme"

資料の構成を定義

index.rst内の以下に構成を定義します。

====================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:
   :glob:

   src/1
   src/2
   src/3

====================================

重要なのは以下の部分になります。

   src/1
   src/2
   src/3

こちらがファイルの読み込み先を示しています。src フォルダの1というファイルを読み込んでいます。 基本的に.mdor .ipynbの拡張子であれば読み込んでくれます。

ビルド

作業ディレクトリにて

make html

_build > htmlフォルダの中のindex.htmlを開けばOKです。

cd _build/html
open index.html

備考

PDF作成

作業ディレクトリに移ってから下記のコマンドで_build以下にpdfができます

docker run --rm -it -v ${PWD}:/docs/ kikagaku/sphinx

参考URL

sphinx_template's People

Watchers

James Cloos avatar Kohei Imanishi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.