Releases: vemel/handsdown
0.4.0
0.3.9 - Python 3.8 AST
Changed
- Python 3.8+ uses built-in
ast
module typed-ast
is not required forpy38
Fixed
__all__
directive parsing forpy38
0.3.8 - Stability Fixes
Fixed
- Error on python comment handled as Markdown header
- Incorrect
find to source code
link in automated GitHub actions
Dependencies
- Removed strict
typed-ast
version requirements - Updated dev dependencies
0.3.5 - New docs
Changes
- Updated documentation
- Updated dependencies
- Fixed
Read the Docs
deployment
0.3.3 - Asynchronous Coverage
Features
- Add
if
expressions support to expression analyzer - Add
await
support to expression analyzer - Add
yield
andyield from
support to expression analyzer - Add asynchronous functions and methods support
Bugfixes
- Cleanup orphaned directories after glob iteration to avoid
OSError
- Simplify main class name lookup
- Fix potential error in comment docstring discovery
- Fix force output path creation if file exists with expected directory name
0.3.2 - Calling __all__
Features
- Respect
__all__
directive - Add rendering support for f-strings
- Add rendering support for slices
- Add rendering support for
list
,set
anddict
comprehensions - Add rendering support for generator expressions
Bugfixes
- Split sphinx sections
- Skip private functions in modules
- Change
__main__.py
title toModule
- Fix default values for positional only arguments
- Ignore comment docstrings starting with
FIXME
orTODO
- Fix starargs rendering for AST2
- Fix comment-style type annotations ordering
- Add warning on unknown operator render
Changes
- Use ToC depth 1 for sub-modules
0.3.1 - Sphinx Unchained
Features
- Discover related object links inside a class
- Support Sphinx directives, e.g.
..seealso::
Bugfixes
- Fix related links discovery for attributes
- Remove
pathlib2
dependency - Fix default values representation for
py2x
- Set anchor links to module/class header for attributes
- Do not replace attribute names with links inside parent module doc
- Add type annotations placed on a different line
- Allow comment blocks inside each other (remember how the block started)
0.3.0 - From Scratch
Features
New Python code parsing approach
Now handsdown
uses Abstract Syntax Trees (AST) to parse a source code. Code was completely rewritted, but now it is better, faster, and does not require your project dependencies installed. py27
support is dropped, but you can use a new Docker image for Python 2.x projects.
Comment docstrings
# Name for main `logging.Logger`
PROJECT_NAME = 'my_project'
# Format for logs views.
DATE_FORMAT = '%Y-%m-%d'
Ever had something like this in your source code? Well, now it is added to docs and even is discoverable by referencing from other modules, like
from my_project.constants import DATE_FORMAT
def parse_date(date_str, format=DATE_FORMAT):
return datetime.strptime(date_str, format)
This will generate a nice See also
link to your constants.md
file.
Same result for all Python version
All py3x
produce exactly the same result.
New function signature generator
This comes together with AST introduction. Now signature is properly indented and slit to multiple lines if needed.
Bugfixes
- Fix wrong ToC indentation for
mkdocs
(use 4 spaces indent) - Fix wrong target file for
See also
links - Fix source code link for
py38
, so it include decorators - Fix source lookup for
pathlib2
fallback (it is very buggy) - Fix orphaned docs cleanup for
pathlib2
fallback - Speed up doc generation on big projects
Changes
- Add
--name
CLI parameter - Python 3.5.+ is now required
0.2.2 - Read the Docs
Features
Add Read the Docs support
Added a new CLI argument --external
- replacement for removed --gh-pages
argument, because now it handles both Read the Docs and GitHub Pages.
The output produced by handsdown
is now compatible with mkdocs
format. That means that you can generate HTML from handsdown
output:
# build documentation with absolute links to GitHub repo source files
# and generate config files for mkdocs, Read the Docs and GitHub Pages
handsdown --external `git config --get remote.origin.url`
# build HTML to `site` directory
mkdocs build
Signature builder improvements
- Now you can see decorators in a function signature
- Comment-style type annotation parsing now produces correct result for partially annotated functions
- Faster source code processing
Here is an example of a new annotation
@property
def title() -> Text:
@title.setter
def title(title: Text) -> None:
Bugfixes
- Only enable type checking for a primary imported module and disable for other
- Use full config for
GitHub Pages
- Make signature compatible with
GitHub
highlighter - Fix installation from
.tar.gz
Other changes
- Remove
--gh-pages
CLI argument - Modules list moved to
MODULES.md
- Add support for custom content in Modules list file
- Use project name as an index title in submodule ToC
- Add
--version
CLI argument - Add version info installed package
0.2.1 - Early Bugfixes
Bugfixes
- Fix crash on getting source code line from non-readable files
- Skip directories starting with
.
(Python eggs could be stored in a project root) - Fix circular imports by enabling
typing.TYPE_CHECKING
only for the first file - Support
HTTPS
protocol ingit config --get remote.origin.url