Skip to content

Commit d71f886

Browse files
authored
Merge pull request #28 from cgay/dev
Copy docs from OD, update package file
2 parents a888954 + 2a74bcc commit d71f886

File tree

9 files changed

+867
-8
lines changed

9 files changed

+867
-8
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "ext/strings"]
55
path = ext/strings
66
url = https://github.com/dylan-lang/strings
7+
[submodule "documentation/sphinx-extensions"]
8+
path = documentation/sphinx-extensions
9+
url = https://github.com/dylan-lang/sphinx-extensions

documentation/Makefile

+20
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 = 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)

documentation/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+
%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

documentation/source/conf.py

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
16+
sys.path.insert(0, os.path.abspath('../sphinx-extensions/sphinxcontrib'))
17+
18+
import dylan.domain
19+
import dylan.themes as dylan_themes
20+
21+
22+
23+
# -- Project information -----------------------------------------------------
24+
25+
project = 'command-line-parser'
26+
copyright = '2022, Dylan Hackers'
27+
author = 'Dylan Hackers'
28+
29+
# The full version, including alpha/beta/rc tags
30+
release = 'v3.2.0'
31+
32+
33+
# -- General configuration ---------------------------------------------------
34+
35+
# Add any Sphinx extension module names here, as strings. They can be
36+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
37+
# ones.
38+
extensions = [
39+
'dylan.domain',
40+
'sphinx.ext.intersphinx'
41+
]
42+
43+
# Add any paths that contain templates here, relative to this directory.
44+
templates_path = ['_templates']
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 = ['_build']
50+
51+
# This makes it so that each document doesn't have to use
52+
# .. default-domain:: dylan
53+
# but they probably should anyway, so that they can be built separately
54+
# without depending on this top-level config file.
55+
primary_domain = 'dylan'
56+
57+
# -- Options for HTML output -------------------------------------------------
58+
59+
# The theme to use for HTML and HTML Help pages. See the documentation for
60+
# a list of builtin themes.
61+
html_theme = dylan_themes.get_html_theme_default()
62+
63+
# Theme options are theme-specific and customize the look and feel of a theme
64+
# further. For a list of options available for each theme, see the
65+
# documentation.
66+
html_theme_options = dylan_themes.get_html_theme_options_default()
67+
68+
# Add any paths that contain custom themes here, relative to this directory.
69+
html_theme_path = [dylan_themes.get_html_theme_path()]
70+
71+
# The name for this set of Sphinx documents. If None, it defaults to
72+
# "<project> v<release> documentation".
73+
html_title = "Dylan Library Reference"
74+
75+
# Add any paths that contain custom static files (such as style sheets) here,
76+
# relative to this directory. They are copied after the builtin static files,
77+
# so a file named "default.css" will overwrite the builtin "default.css".
78+
html_static_path = ['_static']

0 commit comments

Comments
 (0)