Skip to content

Commit 1da2b48

Browse files
authored
Add documentation module (#173)
* Create a documentation module * Add a small note about documentation being WIP
1 parent bafbfcf commit 1da2b48

15 files changed

+882
-19
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ release:
1111
@pipenv run twine upload dist/*
1212

1313

14+
.PHONY: docs
15+
docs:
16+
@pipenv run sphinx-build -M html "./docs" "./docs/_build"
17+
18+
1419
.PHONY: repl
1520
repl:
1621
@BASILISP_USE_DEV_LOGGER=true pipenv run basilisp repl

Pipfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ verify_ssl = true
44
name = "pypi"
55

66
[dev-packages]
7-
twine = "*"
7+
pytest-pycharm = "*"
8+
sphinx = "*"
9+
sphinx-rtd-theme = "*"
810
tox = "*"
911
tox-pyenv = "*"
10-
pytest-pycharm = "*"
12+
twine = "*"
1113

1214
[packages]
1315
astor = "*"

Pipfile.lock

Lines changed: 230 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A Lisp dialect inspired by Clojure targeting Python 3.
55
**Disclaimer:** _Basilisp is a project I created to learn about Python, Clojure,
66
and hosted languages generally. It should not be used in a production setting._
77

8-
![PyPI](https://img.shields.io/pypi/v/basilisp.svg?style=flat-square) ![python](https://img.shields.io/pypi/pyversions/basilisp.svg?style=flat-square) ![CircleCI](https://img.shields.io/travis/chrisrink10/basilisp.svg?style=flat-square) ![Coveralls github](https://img.shields.io/coveralls/github/chrisrink10/basilisp.svg?style=flat-square) ![license](https://img.shields.io/github/license/chrisrink10/basilisp.svg?style=flat-square)
8+
![PyPI](https://img.shields.io/pypi/v/basilisp.svg?style=flat-square) ![python](https://img.shields.io/pypi/pyversions/basilisp.svg?style=flat-square) ![readthedocs](https://img.shields.io/readthedocs/basilisp.svg?style=flat-square) ![TravisCI](https://img.shields.io/travis/chrisrink10/basilisp.svg?style=flat-square) ![Coveralls github](https://img.shields.io/coveralls/github/chrisrink10/basilisp.svg?style=flat-square) ![license](https://img.shields.io/github/license/chrisrink10/basilisp.svg?style=flat-square)
99

1010
## Getting Started
1111

@@ -23,9 +23,10 @@ Once Basilisp is installed, you can enter into the REPL using:
2323
basilisp repl
2424
```
2525

26-
Basilisp features many of the same functions and idioms as [Clojure](https://clojure.org/)
27-
so you may find guides and documentation there helpful for getting
28-
started.
26+
Basilisp [documentation](https://basilisp.readthedocs.io) can help guide your
27+
exploration at the REPL. Additionally, Basilisp features many of the same functions
28+
and idioms as [Clojure](https://clojure.org/) so you may find guides and
29+
documentation there helpful for getting started.
2930

3031
## Developing on Basilisp
3132

docs/cli.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _cli:
2+
3+
CLI
4+
===
5+
6+
TBD

docs/compiler.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _compiler:
2+
3+
Compiler
4+
========
5+
6+
TBD

docs/conf.py

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
15+
# import os
16+
# import sys
17+
# sys.path.insert(0, os.path.abspath('.'))
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
22+
project = 'Basilisp'
23+
copyright = '2018, Chris Rink'
24+
author = 'Chris Rink'
25+
26+
# The short X.Y version
27+
version = ''
28+
# The full version, including alpha/beta/rc tags
29+
release = ''
30+
31+
# -- General configuration ---------------------------------------------------
32+
33+
# If your documentation needs a minimal Sphinx version, state it here.
34+
#
35+
# needs_sphinx = '1.0'
36+
37+
# Add any Sphinx extension module names here, as strings. They can be
38+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39+
# ones.
40+
extensions = [
41+
'sphinx.ext.autodoc',
42+
]
43+
44+
# Add any paths that contain templates here, relative to this directory.
45+
templates_path = ['_templates']
46+
47+
# The suffix(es) of source filenames.
48+
# You can specify multiple suffix as a list of string:
49+
#
50+
# source_suffix = ['.rst', '.md']
51+
source_suffix = '.rst'
52+
53+
# The master toctree document.
54+
master_doc = 'index'
55+
56+
# The language for content autogenerated by Sphinx. Refer to documentation
57+
# for a list of supported languages.
58+
#
59+
# This is also used if you do content translation via gettext catalogs.
60+
# Usually you set "language" from the command line for these cases.
61+
language = None
62+
63+
# List of patterns, relative to source directory, that match files and
64+
# directories to ignore when looking for source files.
65+
# This pattern also affects html_static_path and html_extra_path.
66+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
67+
68+
# The name of the Pygments (syntax highlighting) style to use.
69+
pygments_style = None
70+
71+
# -- Options for HTML output -------------------------------------------------
72+
73+
# The theme to use for HTML and HTML Help pages. See the documentation for
74+
# a list of builtin themes.
75+
#
76+
html_theme = 'sphinx_rtd_theme'
77+
78+
# Theme options are theme-specific and customize the look and feel of a theme
79+
# further. For a list of options available for each theme, see the
80+
# documentation.
81+
#
82+
html_theme_options = {
83+
"collapse_navigation": False
84+
}
85+
86+
# Add any paths that contain custom static files (such as style sheets) here,
87+
# relative to this directory. They are copied after the builtin static files,
88+
# so a file named "default.css" will overwrite the builtin "default.css".
89+
html_static_path = ['_static']
90+
91+
# Custom sidebar templates, must be a dictionary that maps document names
92+
# to template names.
93+
#
94+
# The default sidebars (for documents that don't match any pattern) are
95+
# defined by theme itself. Builtin themes are using these templates by
96+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
97+
# 'searchbox.html']``.
98+
#
99+
# html_sidebars = {}
100+
101+
102+
# -- Options for HTMLHelp output ---------------------------------------------
103+
104+
# Output file base name for HTML help builder.
105+
htmlhelp_basename = 'Basilispdoc'
106+
107+
# -- Options for LaTeX output ------------------------------------------------
108+
109+
latex_elements = {
110+
# The paper size ('letterpaper' or 'a4paper').
111+
#
112+
# 'papersize': 'letterpaper',
113+
114+
# The font size ('10pt', '11pt' or '12pt').
115+
#
116+
# 'pointsize': '10pt',
117+
118+
# Additional stuff for the LaTeX preamble.
119+
#
120+
# 'preamble': '',
121+
122+
# Latex figure (float) alignment
123+
#
124+
# 'figure_align': 'htbp',
125+
}
126+
127+
# Grouping the document tree into LaTeX files. List of tuples
128+
# (source start file, target name, title,
129+
# author, documentclass [howto, manual, or own class]).
130+
latex_documents = [
131+
(master_doc, 'Basilisp.tex', 'Basilisp Documentation',
132+
'Chris Rink', 'manual'),
133+
]
134+
135+
# -- Options for manual page output ------------------------------------------
136+
137+
# One entry per manual page. List of tuples
138+
# (source start file, name, description, authors, manual section).
139+
man_pages = [
140+
(master_doc, 'basilisp', 'Basilisp Documentation',
141+
[author], 1)
142+
]
143+
144+
# -- Options for Texinfo output ----------------------------------------------
145+
146+
# Grouping the document tree into Texinfo files. List of tuples
147+
# (source start file, target name, title, author,
148+
# dir menu entry, description, category)
149+
texinfo_documents = [
150+
(master_doc, 'Basilisp', 'Basilisp Documentation',
151+
author, 'Basilisp', 'One line description of project.',
152+
'Miscellaneous'),
153+
]
154+
155+
# -- Options for Epub output -------------------------------------------------
156+
157+
# Bibliographic Dublin Core info.
158+
epub_title = project
159+
160+
# The unique identifier of the text. This can be a ISBN number
161+
# or the project homepage.
162+
#
163+
# epub_identifier = ''
164+
165+
# A unique identification for the text.
166+
#
167+
# epub_uid = ''
168+
169+
# A list of files that should not be packed into the epub file.
170+
epub_exclude_files = ['search.html']
171+
172+
# -- Extension configuration -------------------------------------------------

docs/features.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. _features:
2+
3+
Features
4+
========
5+
6+
Here are a few of Basilisp's great features:
7+
8+
* Immutable data structures, backed by `Pyrsistent <https://github.com/tobgu/pyrsistent>`_
9+
* Strong emphasis on functional programming concepts
10+
* Access to the vast array of existing Python libraries
11+
* Seamless :ref:`interoperability <python_interop>` between Python code and Basilisp code
12+
* Sophisticated :ref:`repl` for REPL-based development

docs/gettingstarted.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Getting Started
2+
===============
3+
4+
Basilisp is developed on `GitHub <https://github.com/chrisrink10/basilisp>`_ and hosted on `PyPI <https://pypi.python.org/pypi/basilisp>`_.
5+
You can fetch Basilisp using a simple::
6+
7+
pip install basilisp
8+
9+
Once Basilisp is installed, you can enter into the REPL using::
10+
11+
basilisp repl
12+
13+
In Basilisp's REPL, you now have the full power of Basilisp at your disposal.
14+
It is customary to write a ``Hello, World!`` when starting out in a new language, so we'll do that here::
15+
16+
user=> (print "Hello, World!")
17+
Hello, World!
18+
nil
19+
20+
Or perhaps you'd like to try something a little more exciting, like performing some arithmetic::
21+
22+
user=> (+ 1 2 3 4 5)
23+
15
24+
25+
Sequences are a little more fun than simple arithmetic::
26+
27+
user=> (filter odd? (map inc (range 1 10)))
28+
(3 5 7 9 11)
29+
30+
There is a ton of great functionality built in to Basilisp, so feel free to poke around.
31+
Many great features from Clojure are already baked right in, and `many more are planned <https://github.com/chrisrink10/basilisp/issues>`_, so I hope you enjoy.
32+
From here you might find the documentation for the :ref:`repl` helpful to learn about what else you can do in the REPL.
33+
34+
Good luck!

docs/index.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. Basilisp documentation master file, created by
2+
sphinx-quickstart on Fri Sep 14 08:39:59 2018.
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 Basilisp's documentation!
7+
====================================
8+
9+
.. note::
10+
11+
This documentation is incomplete and work is ongoing to improve it.
12+
13+
Basilisp is a Lisp dialect inspired by Clojure targeting Python 3.
14+
15+
Basilisp compiles down to raw Python 3 code and executes on the Python 3
16+
virtual machine, allowing natural interoperability between existing Python
17+
libraries and new Lisp code.
18+
19+
Use the links below to learn more about Basilisp and to find help if you
20+
run into trouble using Basilisp.
21+
22+
Contents
23+
--------
24+
25+
.. toctree::
26+
:maxdepth: 2
27+
28+
features
29+
gettingstarted
30+
reference

docs/pyinterop.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _python_interop:
2+
3+
Python Interop
4+
==============
5+
6+
TBD

0 commit comments

Comments
 (0)