Skip to content

Commit e668abb

Browse files
authored
adding documentation (#13)
1 parent 1a66f31 commit e668abb

File tree

8 files changed

+181
-55
lines changed

8 files changed

+181
-55
lines changed

.circleci/config.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: 2
2+
jobs:
3+
build_docs:
4+
docker:
5+
- image: circleci/python:3.6-stretch
6+
steps:
7+
# Get our data and merge with upstream
8+
- run: sudo apt-get update
9+
- checkout
10+
11+
- restore_cache:
12+
keys:
13+
- cache-pip
14+
15+
- run: |
16+
pip install --user .[rtd]
17+
- save_cache:
18+
key: cache-pip
19+
paths:
20+
- ~/.cache/pip
21+
22+
# Build the docs
23+
- run:
24+
name: Build docs to store
25+
command: |
26+
sphinx-build -b html docs/ docs/_build/html
27+
28+
- store_artifacts:
29+
path: docs/_build/html/
30+
destination: html
31+
32+
33+
workflows:
34+
version: 2
35+
default:
36+
jobs:
37+
- build_docs

docs/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/README.md

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

docs/conf.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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 = "markdown-it-py"
21+
copyright = "2020, executable book project"
22+
author = "executable book project"
23+
24+
25+
# -- General configuration ---------------------------------------------------
26+
27+
# Add any Sphinx extension module names here, as strings. They can be
28+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29+
# ones.
30+
extensions = ["myst_nb", "sphinx_copybutton"]
31+
32+
# Add any paths that contain templates here, relative to this directory.
33+
templates_path = ["_templates"]
34+
35+
# List of patterns, relative to source directory, that match files and
36+
# directories to ignore when looking for source files.
37+
# This pattern also affects html_static_path and html_extra_path.
38+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
39+
40+
41+
# -- Options for HTML output -------------------------------------------------
42+
43+
# The theme to use for HTML and HTML Help pages. See the documentation for
44+
# a list of builtin themes.
45+
#
46+
html_title = "markdown-it-py"
47+
html_theme = "sphinx_book_theme"
48+
html_theme_options = {
49+
"use_edit_page_button": True,
50+
"repository_url": "https://github.com/executablebooks/markdown-it-py",
51+
"repository_branch": "master",
52+
"path_to_docs": "docs",
53+
}
54+
55+
# Add any paths that contain custom static files (such as style sheets) here,
56+
# relative to this directory. They are copied after the builtin static files,
57+
# so a file named "default.css" will overwrite the builtin "default.css".
58+
html_static_path = ["_static"]

docs/development.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Before continuing, make sure you've read:
44

55
1. [README](https://github.com/markdown-it/markdown-it#markdown-it)
66
2. [API documentation](https://markdown-it.github.io/markdown-it/)
7-
3. [Architecture description](architecture.md)
7+
3. [Architecture description](architecture)
88

99

1010
## General considerations for plugins.
@@ -34,7 +34,7 @@ Before continuing, make sure you've read:
3434
## FAQ
3535

3636

37-
#### I need async rule, how to do it?
37+
### I need async rule, how to do it?
3838

3939
Sorry. You can't do it directly. All complex parsers are sync by nature. But you
4040
can use workarounds:
@@ -48,7 +48,7 @@ Alternatively, you can render HTML, then parse it to DOM, or
4848
in a more convenient way.
4949

5050

51-
#### How to replace part of text token with link?
51+
### How to replace part of text token with link?
5252

5353
The right sequence is to split text to several tokens and add link tokens in between.
5454
The result will be: `text` + `link_open` + `text` + `link_close` + `text`.
@@ -58,15 +58,15 @@ See implementations of [linkify](https://github.com/markdown-it/markdown-it/blob
5858
__Note.__ Don't try to replace text with HTML markup! That's not secure.
5959

6060

61-
#### Why my inline rule is not executed?
61+
### Why my inline rule is not executed?
6262

6363
The inline parser skips pieces of texts to optimize speed. It stops only on [a small set of chars](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_inline/text.js), which can be tokens. We did not made this list extensible for performance reasons too.
6464

6565
If you are absolutely sure that something important is missing there - create a
6666
ticket and we will consider adding it as a new charcode.
6767

6868

69-
#### Why do you reject some useful things?
69+
### Why do you reject some useful things?
7070

7171
We do a markdown parser. It should keep the "markdown spirit". Other things should
7272
be kept separate, in plugins, for example. We have no clear criteria, sorry.

docs/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```{include} ../README.md
2+
```
3+
4+
```{toctree}
5+
using
6+
architecture
7+
development
8+
security
9+
```

0 commit comments

Comments
 (0)