diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 0000000..04506b1 --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,27 @@ +name: documentation + +on: [push, workflow_dispatch] + +permissions: + contents: write + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install dependencies + run: | + pip install sphinx sphinx_rtd_theme myst_parser + - name: Sphinx build + run: | + sphinx-build doc _build + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/doc' }} + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: _build/ + force_orphan: true diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/doc/Makefile @@ -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 = . +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) diff --git a/doc/conf.py b/doc/conf.py new file mode 100644 index 0000000..7bf72f5 --- /dev/null +++ b/doc/conf.py @@ -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 = 'Example' +copyright = 'workshop participant' +author = 'workshop participant' +release = '0.1' + + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ['myst_parser'] + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'sphinx_rtd_theme' +html_static_path = ['_static'] diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 0000000..4d1a742 --- /dev/null +++ b/doc/index.rst @@ -0,0 +1,14 @@ +.. Example documentation master file, created by + sphinx-quickstart on Sat Sep 23 20:35:12 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Example's documentation! +=================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + markdown/some-feature.md + markdown/another-feature.md diff --git a/doc/make.bat b/doc/make.bat new file mode 100644 index 0000000..32bb245 --- /dev/null +++ b/doc/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/doc/markdown/another-feature.md b/doc/markdown/another-feature.md new file mode 100644 index 0000000..542c742 --- /dev/null +++ b/doc/markdown/another-feature.md @@ -0,0 +1,57 @@ +# More features here + + +## Some text + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod +tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, +quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo +consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non +proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + + +## Table + +| No. | Prime | +| ---- | ------ | +| 1 | No | +| 2 | Yes | +| 3 | Yes | +| 4 | No | + + + +## Code blocks + +The following is a Python code block: +```python + def hello(): + print("Hello world") +``` + +And this is a C code block: +```c +#include +int main() +{ + printf("Hello, World!"); + return 0; +} +``` + + +## Math + +This creates an equation: +```{math} +a^2 + b^2 = c^2 +``` + +This is an in-line equation, {math}`a^2 + b^2 = c^2`, embedded in text. + + +```{image} https://github.com/1yefuwang1/vectorlite/blob/main/media/vector_insertion_3000_vectors.png +:alt: Select Parameters +:align: center +``` \ No newline at end of file diff --git a/doc/markdown/some-feature.md b/doc/markdown/some-feature.md new file mode 100644 index 0000000..4e016e1 --- /dev/null +++ b/doc/markdown/some-feature.md @@ -0,0 +1,17 @@ +# Some feature + +## Subsection + +Exciting documentation in here. +Let's make a list (empty surrounding lines required): + +- item 1 + + - nested item 1 + - nested item 2 + +- item 2 +- item 3 + +![vecter insertion](https://github.com/1yefuwang1/vectorlite/blob/main/media/vector_insertion_3000_vectors.png) +![vector query](https://github.com/1yefuwang1/vectorlite/blob/main/media/vector_query_3000_vectors.png) \ No newline at end of file