diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6ccb4e8..425eeff 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,9 +12,6 @@ jobs: matrix: os: [ubuntu-latest] python-version: [3.7, 3.8, 3.9, '3.10', '3.11'] - include: - - os: ubuntu-20.04 - python-version: 3.6 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 6cea177..7d7f45f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ On the fly conversion of Python docstrings to markdown -- Python 3.6+ +- Python 3.6+ (tested on 3.7 up to 3.11) - can recognise reStructuredText and convert multiple of its features to Markdown - since v0.13 includes initial support for Google-formatted docstrings diff --git a/docstring_to_markdown/__init__.py b/docstring_to_markdown/__init__.py index 317c724..62fa804 100644 --- a/docstring_to_markdown/__init__.py +++ b/docstring_to_markdown/__init__.py @@ -3,7 +3,7 @@ from .plain import looks_like_plain_text, plain_text_to_markdown from .rst import looks_like_rst, rst_to_markdown -__version__ = "0.14" +__version__ = "0.15" class UnknownFormatError(Exception): diff --git a/docstring_to_markdown/rst.py b/docstring_to_markdown/rst.py index 174f9de..ba50d91 100644 --- a/docstring_to_markdown/rst.py +++ b/docstring_to_markdown/rst.py @@ -1,13 +1,13 @@ from abc import ABC, abstractmethod from enum import IntEnum, auto from types import SimpleNamespace -from typing import Union, List, Dict +from typing import Callable, Match, Union, List, Dict import re class Directive: def __init__( - self, pattern: str, replacement: str, + self, pattern: str, replacement: Union[str, Callable[[Match], str]], name: Union[str, None] = None, flags: int = 0 ): @@ -249,7 +249,7 @@ def inline_markdown(self): ), Directive( pattern=r'`(?P