Skip to content

Commit ad8fb91

Browse files
author
doyougnu
committed
rst init
1 parent 613ee95 commit ad8fb91

File tree

8 files changed

+189
-58
lines changed

8 files changed

+189
-58
lines changed

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)

book.toml

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

conf.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'Haskell Optimization Handbook'
21+
copyright = '2022, Jeffrey Young (doyugnu)'
22+
author = 'Jeffrey Young (doyugnu)'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '0.0.1'
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = [
34+
]
35+
36+
# Add any paths that contain templates here, relative to this directory.
37+
templates_path = ['_templates']
38+
39+
# List of patterns, relative to source directory, that match files and
40+
# directories to ignore when looking for source files.
41+
# This pattern also affects html_static_path and html_extra_path.
42+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
43+
44+
45+
# -- Options for HTML output -------------------------------------------------
46+
47+
# The theme to use for HTML and HTML Help pages. See the documentation for
48+
# a list of builtin themes.
49+
#
50+
html_theme = 'alabaster'
51+
52+
# Add any paths that contain custom static files (such as style sheets) here,
53+
# relative to this directory. They are copied after the builtin static files,
54+
# so a file named "default.css" will overwrite the builtin "default.css".
55+
html_static_path = ['_static']

index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. Haskell Optimization Handbook documentation master file, created by
2+
sphinx-quickstart on Sun Mar 6 16:21:18 2022.
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 Haskell Optimization Handbook's documentation!
7+
=========================================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
14+
15+
Indices and tables
16+
==================
17+
18+
* :ref:`genindex`
19+
* :ref:`modindex`
20+
* :ref:`search`

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

shell.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{ pkgs ? import <nixpkgs> {} }:
2+
3+
with pkgs;
4+
5+
mkShell {
6+
buildInputs = [
7+
sphinx
8+
];
9+
}

style-guide.md

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

style-guide.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
==================
2+
HOH Style Guide
3+
==================
4+
5+
Prose
6+
==================
7+
8+
- Prefer title case for chapter/section headings, ex: `Discovering a Memory
9+
Leak` rather than `Discovering a memory leak`.
10+
- Prefer italics over single quotes when calling out a term, ex: `is a
11+
*pure function*` rather than `is a ‘pure function’`.
12+
- Hard wrap at 80 chars
13+
- Prefer not mixing code and not-code in one word, ex: ``Remember when we
14+
`import Data.Map.Lazy`?`` rather than ``Remember when we `import`d
15+
`Data.Map.Lazy`?``
16+
17+
Code
18+
==================
19+
20+
- Add the file name before markdown blocks to make it clear which file we're
21+
talking about, when applicable.
22+
- When making changes to code, make it clear which parts of the code changed
23+
and which stayed the same. Point this out explicitly in the text::
24+
25+
Our original function call was:
26+
``map (\y -> let x = ...expensive... in y + x) xs`` Notice that we have a ``let-binding`` that will allocate a let *for each*
27+
element in ``xs``. We might considering floating out the let, yielding:: let x = ...expensive...
28+
in map (\y -> y + x) xs Now we see that we have only a _single_ let that is then reused *for each*
29+
element in ``xs`` because we have moved the let outside of the call to ``map``.
30+
31+
Split up long lines as appropriate to keep them under 80 chars if possible
32+
Use `bash` syntax highlighting for command line output code blocks
33+
34+
Links
35+
==================
36+
37+
Once all the scripts are done:
38+
39+
- If a link shouldn't be printed, mark it to be ignored.
40+
* This includes all "Chapter XX" intra-book links, which *should* be links for the HTML version
41+
- Make intra-book links and stdlib API doc links relative so they work whether
42+
the book is read offline or online.
43+
- Use links and keep in mind that they will be changed into ``text at \*url\*``
44+
in print, so word them in a way that it reads well in that format
45+
46+
47+
Reference
48+
==================
49+
This guide copied and modified with respect from
50+
[rust-lang/book](https://github.com/rust-lang/book). Thank you rust community!

0 commit comments

Comments
 (0)