Skip to content

Commit

Permalink
Merge pull request readthedocs#170 from readthedocs/release/0.6.0
Browse files Browse the repository at this point in the history
Setup release 0.6.0
  • Loading branch information
ericholscher authored Aug 9, 2019
2 parents c4d575b + cdd25e3 commit 48f9d1a
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
node_modules/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@

Version 0.6.0
-------------

Date: 2019-08-09

- [@RaptorCZ](http://github.com/RaptorCZ): Process linebreaks and
convert them to br element.
([\#162](https://github.com/readthedocs/recommonmark/pull/162))
- [@gibfahn](http://github.com/gibfahn): Remove URL quoting from refs
before passing to Sphinx
([\#158](https://github.com/readthedocs/recommonmark/pull/158))
- [@dandersson](http://github.com/dandersson): Use image description
text as \"alt\", drop title
([\#150](https://github.com/readthedocs/recommonmark/pull/150))
- [@annegentle](http://github.com/annegentle): Clarify the specifics
of Auto Toc Tree
([\#149](https://github.com/readthedocs/recommonmark/pull/149))
- [@loganrosen](http://github.com/loganrosen): Bump dependency on
commonmark to \>= 0.8.1
([\#147](https://github.com/readthedocs/recommonmark/pull/147))
- [@codejamninja](http://github.com/codejamninja): Use official
gitignore template
([\#140](https://github.com/readthedocs/recommonmark/pull/140))
- [@dotlambda](http://github.com/dotlambda): Include all test files in
PyPI tarball
([\#128](https://github.com/readthedocs/recommonmark/pull/128))
- [@tk0miya](http://github.com/tk0miya): Register a parser class using
new Sphinx API; add\_source\_suffix
([\#113](https://github.com/readthedocs/recommonmark/pull/113))

## Changelog

## 0.4.0 (in development)
Expand Down
14 changes: 13 additions & 1 deletion docs/auto_structify.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
AutoStructify Component
=======================

AutoStructify is a component in recommonmark that takes a parsed docutil AST by `CommonMarkParser`,
and transform it to another AST that introduces some of more. This enables additional features
of recommonmark syntax, to introduce more structure into the final generated document.


Configuring AutoStructify
-------------------------

The behavior of AutoStructify can be configured via a dict in document setting.
In sphinx, you can configure it by `conf.py`. The following snippet
is what is actually used to generate this document, see full code at [conf.py](conf.py).
Expand All @@ -21,9 +23,11 @@ def setup(app):
app.add_transform(AutoStructify)

```

All the features are by default enabled

***List of options***

* __enable_auto_toc_tree__: whether enable [Auto Toc Tree](#auto-toc-tree) feature.
* __auto_toc_tree_section__: when enabled, [Auto Toc Tree](#auto-toc-tree) will only be enabled on section that matches the title.
* __enable_auto_doc_ref__: whether enable [Auto Doc Ref](#auto-doc-ref) feature. **Deprecated**
Expand All @@ -34,6 +38,7 @@ All the features are by default enabled

Auto Toc Tree
-------------

One of important command in tools like sphinx is `toctree`. This is a command to generate table of contents and
tell sphinx about the structure of the documents. In markdown, usually we manually list of contents by a bullet list
of url reference to the other documents.
Expand All @@ -44,14 +49,17 @@ AutoStructify transforms bullet list of document URLs like this
* [Title1](doc1.md)
* [Title2](doc2.md)
```

to the AST of this following reStructuredText code

```rst
.. toctree::
:maxdepth: 1
doc1
doc2
```

You can also find the usage of this feature in `index.md` of this document.

Auto Doc Ref
Expand All @@ -66,17 +74,21 @@ Auto Doc Ref

It is common to refer to another document page in one document. We usually use reference to do that.
AutoStructify will translate these reference block into a structured document reference. For example

```
[API Reference](api_ref.md)
```

will be translated to the AST of following reStructuredText code

```
:doc:`API Reference </api_ref>`
```
And it will be rendered as [API Reference](api_ref)

URL Resolver
------------

Sometimes in a markdown, we want to refer to the code in the same repo.
This can usually be done by a reference by reference path. However, since the generated document is hosted elsewhere,
the relative path may not work in generated document site. URL resolver is introduced to solve this problem.
Expand All @@ -87,9 +99,9 @@ So `[parser code](../recommonmark/parser.py)` will be translated into [parser co

Note that the reference to the internal document will not be passed to url resolver, and will be linked to the internal document pages correctly, see [Auto Doc Ref](#auto-doc-ref).


Codeblock Extensions
--------------------

In markdown, you can write codeblocks fenced by (at least) three backticks
(```` ``` ````). The following is an example of codeblock.

Expand Down
5 changes: 1 addition & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
import recommonmark
from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify

source_parsers = {
'.md': CommonMarkParser
}

source_suffix = ['.rst', '.md']

Expand All @@ -42,6 +38,7 @@
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.mathjax',
'recommonmark',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
2 changes: 1 addition & 1 deletion recommonmark/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Docutils CommonMark parser"""

__version__ = '0.5.0'
__version__ = '0.6.0'


def setup(app):
Expand Down
11 changes: 10 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
[bdist_wheel]
universal=1
universal = 1

[metadata]
name = recommonmark
version = 0.6.0

[tool:release]
github_owner = readthedocs
github_repo = recommonmark

0 comments on commit 48f9d1a

Please sign in to comment.