Skip to content

Commit 2308e21

Browse files
committed
first commit
0 parents  commit 2308e21

File tree

11 files changed

+332
-0
lines changed

11 files changed

+332
-0
lines changed

.github/workflows/release_build.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: release build
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- uses: actions/setup-python@v1
13+
with:
14+
python-version: 3.9
15+
- name: Build pages
16+
run: |
17+
pip install -r requirements.txt
18+
make html
19+
touch build/html/.nojekyll
20+
- name: create zip
21+
run: |
22+
mv ./build/html ./Document
23+
zip -r download.zip ./Document
24+
- name: create release
25+
id: create_release
26+
uses: actions/create-release@v1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
with:
30+
tag_name: ${{ github.ref }}
31+
release_name: ${{ github.ref }}
32+
draft: false
33+
prerelease: false
34+
- name: upload HTML
35+
uses: actions/upload-release-asset@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
upload_url: ${{ steps.create_release.outputs.upload_url }}
40+
asset_path: ./download.zip
41+
asset_name: download.zip
42+
asset_content_type: application/zip

Makefile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
22+
livehtml:
23+
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Automatically build Sphinx documents into HTML with GitHub Actions
2+
Sphinxドキュメントをgithubで管理するためのテンプレートです。
3+
vで始まるタグをpushした際に、Github Actionsにより、
4+
5+
- SphinxドキュメントをHTMLにビルド
6+
- タグ名でリリースページを作成(リリース本文はタグコメント)
7+
- リリースページにzip化したHTMLドキュメントを添付
8+
9+
を実行します。
10+
Sphinxドキュメントをローカルビルドすることなく、各リリースバージョンのドキュメントをダウンロードすることを想定しています。
11+
12+
## Sphinx環境を新規に構築する場合
13+
```
14+
$ pip install sphinx
15+
$ pip install sphinx-rtd-theme
16+
$ pip install sphinx-autobuild
17+
```
18+
19+
```
20+
$ sphinx-quickstart
21+
```
22+
23+
conf.pyおよびMakefileを参照し設定を追加してください。
24+
25+
ローカルビルドは、以下の通りです。build/html以下にファイルが作成されます。
26+
27+
```
28+
$ make html
29+
```
30+
31+
もしくは、以下コマンドでライブ確認が可能です。
32+
33+
```
34+
$ make livehtml
35+
```

make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

requirements.txt

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
alabaster==0.7.12
2+
Babel==2.9.0
3+
certifi==2020.12.5
4+
chardet==4.0.0
5+
colorama==0.4.4
6+
docutils==0.16
7+
idna==2.10
8+
imagesize==1.2.0
9+
Jinja2==2.11.3
10+
livereload==2.6.3
11+
MarkupSafe==1.1.1
12+
packaging==20.9
13+
Pygments==2.8.1
14+
pyparsing==2.4.7
15+
pytz==2021.1
16+
requests==2.25.1
17+
six==1.15.0
18+
snowballstemmer==2.1.0
19+
Sphinx==3.5.4
20+
sphinx-autobuild==2021.3.14
21+
sphinx-rtd-theme==0.5.2
22+
sphinxcontrib-applehelp==1.0.2
23+
sphinxcontrib-devhelp==1.0.2
24+
sphinxcontrib-htmlhelp==1.0.3
25+
sphinxcontrib-jsmath==1.0.1
26+
sphinxcontrib-qthelp==1.0.3
27+
sphinxcontrib-serializinghtml==1.1.4
28+
tornado==6.1
29+
urllib3==1.26.4

source/_static/css/style.css

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
@import url("theme.css");
2+
3+
html {
4+
font-family: sans-serif;
5+
line-height: 1.15;
6+
-webkit-text-size-adjust: 100%;
7+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
8+
}
9+
10+
body, body p, div.line, pre {
11+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
12+
font-size: 11pt !important;
13+
}
14+
15+
.wy-nav-content {
16+
max-width: none;
17+
}
18+
19+
h1, h2, h3, h4, h5, h6 {
20+
font-family: sans-serif;
21+
font-weight: 300;
22+
}
23+
24+
h2 {
25+
margin-top: 50px;
26+
padding-bottom: 3px;
27+
border-bottom: 1px solid #ccc;
28+
}
29+
30+
h3 {
31+
color: #257bb5;
32+
}
33+
34+
dt {
35+
font-weight: normal !important;
36+
font-style: unset !important;
37+
color: #17a2b8;
38+
}
39+
40+
table thead p {
41+
font-weight: normal;
42+
}
43+
44+
table thead tr {
45+
background-color: #D9D9D9 !important;
46+
}
47+
48+
table tbody tr td {
49+
background-color: #F2F2F2 !important;
50+
}
51+
52+
.rst-content .line-block {
53+
margin-bottom: 0;
54+
}
55+
56+
.wy-table-responsive table td, .wy-table-responsive table th {
57+
white-space: normal;
58+
}
59+
60+
colgroup {
61+
display: none;
62+
}

source/conf.py

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'sample_document'
21+
copyright = '2021, airiest'
22+
author = 'airiest'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '1.0.0'
26+
version = '1.0.0'
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = [
34+
]
35+
36+
# Add any paths that contain templates here, relative to this directory.
37+
templates_path = ['_templates']
38+
39+
# The language for content autogenerated by Sphinx. Refer to documentation
40+
# for a list of supported languages.
41+
#
42+
# This is also used if you do content translation via gettext catalogs.
43+
# Usually you set "language" from the command line for these cases.
44+
language = 'ja'
45+
46+
# List of patterns, relative to source directory, that match files and
47+
# directories to ignore when looking for source files.
48+
# This pattern also affects html_static_path and html_extra_path.
49+
exclude_patterns = []
50+
51+
52+
# -- Options for HTML output -------------------------------------------------
53+
54+
# The theme to use for HTML and HTML Help pages. See the documentation for
55+
# a list of builtin themes.
56+
#
57+
extensions = [
58+
'sphinx.ext.autodoc',
59+
'sphinx.ext.viewcode',
60+
'sphinx.ext.todo',
61+
'sphinx.ext.napoleon',
62+
'sphinx_rtd_theme'
63+
]
64+
html_theme = 'sphinx_rtd_theme'
65+
html_style = "css/style.css"
66+
67+
# Add any paths that contain custom static files (such as style sheets) here,
68+
# relative to this directory. They are copied after the builtin static files,
69+
# so a file named "default.css" will overwrite the builtin "default.css".
70+
html_static_path = ['_static']

source/doc/chapter1.rst

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
==============================
2+
Chapter 1
3+
==============================

source/doc/chapter2.rst

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
==============================
2+
Chapter 2
3+
==============================

source/doc/intro.rst

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
==============================
2+
Introduction
3+
==============================

source/index.rst

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. sample_document documentation master file, created by
2+
sphinx-quickstart on Tue Apr 27 22:00:26 2021.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to sample_document's documentation!
7+
===========================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Introduction:
12+
13+
/doc/intro
14+
15+
.. toctree::
16+
:maxdepth: 2
17+
:caption: Contents
18+
19+
/doc/chapter1
20+
/doc/chapter2
21+
22+
Indices and tables
23+
==================
24+
25+
* :ref:`genindex`
26+
* :ref:`modindex`
27+
* :ref:`search`

0 commit comments

Comments
 (0)