Skip to content

Commit be26d04

Browse files
committed
add documentation
1 parent 541e4b4 commit be26d04

File tree

8 files changed

+164
-84
lines changed

8 files changed

+164
-84
lines changed

.gitignore

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@ env
22
__pycache__
33
*.csv
44
*.env
5-
!.env
5+
!config/.env
66
.DS_Store
7-
*.json
7+
*.json
8+
9+
# Sphinx build directories
10+
_build/
11+
build/
12+
13+
# Sphinx cache
14+
*.doctree
15+
*.pickle
16+
17+
# Auto-generated API documentation (if using sphinx-apidoc)
18+
docs/source/modules.rst
19+
20+
# Temporary or log files
21+
*.log
22+
*.tmp
23+
*.bak
24+
*.swp
25+
26+
# Editor/IDE-specific files
27+
.vscode/
28+
.idea/
29+
__pycache__/
30+
*.py[cod]
31+
32+
# Virtual environment
33+
venv/
34+
.env/

docs/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Steps to build the documentation
2+
3+
```bash
4+
cd docs
5+
virtualenv .env
6+
source .env/bin/activate
7+
pip install -r requirements.txt
8+
cd source
9+
# Might need to open a new terminal (with same python environment as above) before you can execute the command below.
10+
sphinx-build -b html . build # or can use make html
11+
```

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sphinx
2+
sphinx-autoapi
3+
myst-parser

docs/source/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 = .
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)

docs/source/conf.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
project = 'BreakYourLLM'
10+
copyright = '2024, ModelPulse'
11+
author = 'ModelPulse'
12+
13+
# -- General configuration ---------------------------------------------------
14+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15+
16+
extensions = []
17+
18+
templates_path = ['_templates']
19+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
20+
extensions = [
21+
'sphinx.ext.autodoc', # Optional but not required with autoapi
22+
'sphinx.ext.napoleon', # For Google/NumPy-style docstrings
23+
'myst_parser', # For Markdown support
24+
'autoapi.extension', # Use autoapi
25+
]
26+
27+
28+
# -- Options for HTML output -------------------------------------------------
29+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
30+
31+
html_theme = 'alabaster'
32+
html_static_path = ['_static']
33+
34+
# myst_enable_extensions = [
35+
# "colon_fence", # Use ::: for block directives
36+
# "linkify", # Automatically detect links
37+
# "substitution", # Support text substitutions
38+
# ]
39+
40+
master_doc = 'index' # If still 'index.md', no changes needed
41+
42+
# Point to your Python source code
43+
autoapi_dirs = ['../../sources']
44+
45+
# Set the output format to MyST Markdown
46+
autoapi_keep_files = True # Keep generated Markdown files
47+
48+
myst_enable_extensions = ['amsmath', 'colon_fence']

docs/source/index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!-- .. BreakYourLLM documentation master file, created by
2+
sphinx-quickstart on Sat Dec 7 19:37:28 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive. -->
5+
6+
BreakYourLLM documentation
7+
==========================
8+
9+
<!-- Add your content using ``reStructuredText`` syntax. See the
10+
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
11+
documentation for details. -->
12+
13+
14+
```{toctree}
15+
:maxdepth: 2
16+
:caption: API Documentation:
17+
18+
autoapi/index

docs/source/make.bat

Lines changed: 35 additions & 0 deletions
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=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
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

readme_1.md

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)