init commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
docs/build
|
||||
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
FROM python:alpine
|
||||
RUN pip install --upgrade pip
|
||||
LABEL version="1.0.3" maintainer="rskntroot@gmail.com"
|
||||
|
||||
RUN apk add --no-cache \
|
||||
make \
|
||||
py3-sphinx
|
||||
RUN pip install myst-parser pydata-sphinx-theme
|
||||
|
||||
WORKDIR /opt/sphinx
|
||||
|
||||
11
README.md
11
README.md
@@ -1,2 +1,9 @@
|
||||
# sphinx
|
||||
Sphinx-Docs for Markdown on Alpine
|
||||
# rskio sphinx-docs
|
||||
|
||||
rskio website using sphinx-docs w/ markdown support on alpine-linux dockerized
|
||||
|
||||
## Setup
|
||||
|
||||
```
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
2
bin/entrypoint.sh
Executable file
2
bin/entrypoint.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
make html
|
||||
21
docker-compose.yml
Normal file
21
docker-compose.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
sphinx-docs:
|
||||
image: rskio/sphinx-docs
|
||||
build: .
|
||||
volumes:
|
||||
- ./docs/:/opt/sphinx/
|
||||
- ./bin/entrypoint.sh:/opt/entrypoint.sh
|
||||
entrypoint: /opt/entrypoint.sh
|
||||
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
ports:
|
||||
- 9999:80
|
||||
volumes:
|
||||
- ./docs/build/html:/opt/sphinx/html/:ro
|
||||
- ./nginx/etc/conf.d/:/etc/nginx/conf.d/:ro
|
||||
depends_on:
|
||||
sphinx-docs:
|
||||
condition: service_completed_successfully
|
||||
20
docs/Makefile
Normal file
20
docs/Makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?=
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
SOURCEDIR = source
|
||||
BUILDDIR = build
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
28
docs/source/conf.py
Normal file
28
docs/source/conf.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# For the full list of built-in configuration values, see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
||||
|
||||
project = 'Rskio'
|
||||
copyright = '2024, rskntroot'
|
||||
author = 'rskntroot'
|
||||
release = '1.0.0'
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
||||
|
||||
# Markdown Support - https://www.sphinx-doc.org/en/master/usage/markdown.html
|
||||
extensions = ['myst_parser']
|
||||
|
||||
templates_path = ['_templates']
|
||||
exclude_patterns = []
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
||||
|
||||
# PyData Theme - https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html (0.15.3)
|
||||
html_theme = "pydata_sphinx_theme"
|
||||
html_static_path = ['_static']
|
||||
40
docs/source/docs/example.md
Normal file
40
docs/source/docs/example.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Example
|
||||
|
||||
## This is an Example Markdown File
|
||||
|
||||
### sphinx-docs
|
||||
|
||||
Sphinx Docs can be described as "website as code" similar to "infrastructure as code".
|
||||
|
||||
Currently, this site is built out with the following components:
|
||||
|
||||
```
|
||||
docker:
|
||||
img: python:alpine
|
||||
os:
|
||||
apk: py3-sphinx
|
||||
python:
|
||||
pip:
|
||||
- myst-parser
|
||||
- pydata-sphinx-theme
|
||||
```
|
||||
|
||||
Sphinx is used generate the html for site which can then be hosted separately:
|
||||
|
||||
Generate Command:
|
||||
```
|
||||
make html
|
||||
```
|
||||
|
||||
Hosting:
|
||||
```
|
||||
docker:
|
||||
img: nginx:latest
|
||||
```
|
||||
|
||||
#### Testing
|
||||
|
||||
```
|
||||
cd /opt/docker
|
||||
docker run -it --rm -v ./docs/build/html:/opt/sphinx/html/:ro -v ./nginx/etc/conf.d/:/etc/nginx/conf.d/:ro -p 9999:80 nginx:latest
|
||||
```
|
||||
21
docs/source/index.rst
Normal file
21
docs/source/index.rst
Normal file
@@ -0,0 +1,21 @@
|
||||
.. Rskio documentation master file, created by
|
||||
sphinx-quickstart on Wed May 29 05:30:27 2024.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Rskio
|
||||
=====
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Contents:
|
||||
|
||||
./docs/example.md
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
22
nginx/etc/conf.d/default.conf
Normal file
22
nginx/etc/conf.d/default.conf
Normal file
@@ -0,0 +1,22 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name localhost rskio.com;
|
||||
|
||||
# rskio logging is handled via traefik
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
location / {
|
||||
root /opt/sphinx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
# rskio auth is handled via traefik
|
||||
#error_page 404 /404.html;
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user