Skip to content

Commit

Permalink
Merge branch 'release/1.0.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Jul 29, 2024
2 parents e8b5854 + 75a8708 commit 1feb30e
Show file tree
Hide file tree
Showing 11 changed files with 802 additions and 637 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
poetry-version: [1.7.1]
pandoc-version: [3.1.11.1]
python-version: ['3.10', '3.11', '3.12']
poetry-version: [1.8.3]
pandoc-version: ['3.3']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -41,8 +41,8 @@ jobs:
strategy:
matrix:
python-version: ['3.12']
poetry-version: [1.2.2, 1.3.2, 1.4.2, 1.5.1, 1.6.1, 1.7.1]
pandoc-version: [3.1.11.1]
poetry-version: [1.2.2, 1.3.2, 1.4.2, 1.5.1, 1.6.1, 1.7.1, 1.8.3]
pandoc-version: ['3.3']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -67,8 +67,8 @@ jobs:
strategy:
matrix:
python-version: ['3.12']
poetry-version: [1.7.1]
pandoc-version: [2.11.4, '2.12', '2.13', 2.14.2, '2.15', 2.16.2, 2.17.1.1, '2.18', 2.19.2, 3.0.1, 3.1.11.1]
poetry-version: [1.8.3]
pandoc-version: [2.11.4, '2.12', '2.13', 2.14.2, '2.15', 2.16.2, 2.17.1.1, '2.18', 2.19.2, 3.0.1, 3.1.13, 3.2.1, '3.3']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.1
poetry-version: 1.8.3
- name: Install dependencies
run: |
poetry install
Expand All @@ -119,11 +119,11 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.1
poetry-version: 1.8.3
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/3.1.11.1/pandoc-3.1.11.1-1-amd64.deb
sudo dpkg -i ./pandoc-3.1.11.1-1-amd64.deb
wget https://github.com/jgm/pandoc/releases/download/3.3/pandoc-3.3-1-amd64.deb
sudo dpkg -i ./pandoc-3.3-1-amd64.deb
poetry install
- name: Test
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.1
poetry-version: 1.8.3
- name: Set up poetry-dynamic-versioning
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
Expand Down
36 changes: 22 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-toml
- id: check-yaml
Expand All @@ -11,7 +11,7 @@ repos:
- id: check-poetry

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.10.0
rev: v2.14.0
hooks:
- id: pretty-format-toml
exclude: ^poetry.lock$
Expand All @@ -25,14 +25,14 @@ repos:
- id: tox-ini-fmt

- repo: https://github.com/ariebovenberg/slotscheck
rev: v0.17.0
rev: v0.19.0
hooks:
- id: slotscheck
language: system
exclude: ^(?!pandoc_beamer_block.py)
exclude: ^(?!pandoc_beamer_block/)

- repo: https://github.com/dosisod/refurb
rev: v1.20.0
rev: v2.0.0
hooks:
- id: refurb

Expand All @@ -42,17 +42,17 @@ repos:
- id: teyit

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.287
rev: v0.5.5
hooks:
- id: ruff
language: system
exclude: ^(?!pandoc_beamer_block.py)
exclude: ^(?!pandoc_beamer_block/)

- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.4.2
hooks:
- id: black-jupyter
args: [--config=pyproject.toml, pandoc_beamer_block.py, tests]
args: [--config=pyproject.toml, pandoc_beamer_block/, tests]

- repo: https://github.com/PyCQA/doc8/
rev: v1.1.1
Expand All @@ -61,22 +61,30 @@ repos:
args: [docs]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.11.0
hooks:
- id: mypy
language: system
exclude: ^(?!pandoc_beamer_block.py)
exclude: ^(?!pandoc_beamer_block/)

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.1.0
hooks:
- id: flake8
language: system
exclude: ^(?!pandoc_beamer_block.py)
exclude: ^(?!pandoc_beamer_block/)

- repo: https://github.com/pre-commit/mirrors-pylint
rev: v3.0.0a5
hooks:
- id: pylint
language: system
exclude: ^(?!pandoc_beamer_block.py)
exclude: ^(?!pandoc_beamer_block/)

- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
language: system
args: [--py310-plus]

4 changes: 3 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ build:
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- poetry install --with docs
# VIRTUAL_ENV needs to be set manually for now.
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs

# Build documentation in the "docs/" directory with Sphinx
sphinx:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Installation
[![Last commit](https://img.shields.io/github/last-commit/chdemko/pandoc-beamer-block/develop?logo=github)](https://github.com/chdemko/pandoc-beamer-block/commit/develop/)
[![License](https://img.shields.io/pypi/l/pandoc-beamer-block.svg?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLT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bDUyLjY0MywxNDkuMjc1SDM3MC43NTh6IgogICBpZD0icGF0aDMzNzkiCiAgIHN0eWxlPSJmaWxsOiNmZmZmZmYiIC8+CjwvZz4KPC9zdmc+Cg==)](https://raw.githubusercontent.com/chdemko/pandoc-beamer-block/develop/LICENSE)
[![Python version](https://img.shields.io/pypi/pyversions/pandoc-beamer-block.svg?logo=Python&logoColor=white)](https://pypi.org/project/pandoc-beamer-block/)
[![Poetry version](https://img.shields.io/badge/poetry-1.2%20|%201.3%20|%201.4%20|%201.5%20|%201.6%20|%201.7-blue.svg?logo=poetry)](https://python-poetry.org/)
[![Pandoc version](https://img.shields.io/badge/pandoc-2.11%20|%202.12%20|%202.13%20|%202.14%20|%202.15%20|%202.16%20|%202.17%20|%202.18%20|%202.19%20|%203.0%20|%203.1-blue.svg?logo=markdown)](https://pandoc.org/)
[![Poetry version](https://img.shields.io/badge/poetry-1.2%20|%201.3%20|%201.4%20|%201.5%20|%201.6%20|%201.7%20|%201.8-blue.svg?logo=poetry)](https://python-poetry.org/)
[![Pandoc version](https://img.shields.io/badge/pandoc-2.11%20|%202.12%20|%202.13%20|%202.14%20|%202.15%20|%202.16%20|%202.17%20|%202.18%20|%202.19%20|%203.0%20|%203.10%20|%203.2%20|%203.3-blue.svg?logo=markdown)](https://pandoc.org/)
[![Downloads](https://img.shields.io/pypi/dm/pandoc-beamer-block?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIEdlbmVyYXRvcjogU1ZHIFJlcG8gTWl4ZXIgVG9vbHMgLS0+Cgo8c3ZnCiAgIHdpZHRoPSI4MDBweCIKICAgaGVpZ2h0PSI4MDBweCIKICAgdmlld0JveD0iMCAwIDI0IDI0IgogICBmaWxsPSJub25lIgogICB2ZXJzaW9uPSIxLjEiCiAgI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IzNyAxNS42ODM0IDcuOTAyMzcgMTYuMzE2NiA4LjI5Mjg5IDE2LjcwNzFMMTEuMjkyOSAxOS43MDcxQzExLjY4MzQgMjAuMDk3NiAxMi4zMTY2IDIwLjA5NzYgMTIuNzA3MSAxOS43MDcxTDE1LjcwNzEgMTYuNzA3MUMxNi4wOTc2IDE2LjMxNjYgMTYuMDk3NiAxNS42ODM0IDE1LjcwNzEgMTUuMjkyOUMxNS4zMTY2IDE0LjkwMjQgMTQuNjgzNCAxNC45MDI0IDE0LjI5MjkgMTUuMjkyOUwxMyAxNi41ODU4VjExWiIKICAgICBmaWxsPSIjMDAwMDAwIgogICAgIGlkPSJwYXRoMiIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmIiAvPgo8L3N2Zz4K)](https://pepy.tech/project/pandoc-beamer-block)
[![Development Status](https://img.shields.io/pypi/status/pandoc-beamer-block.svg?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgdmlld0JveD0iMCAwIDMyIDMyIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmcxMDY0IgogICBzb2RpcG9kaTpkb2NuYW1lPSIyNjcyNzY4X2FwcF9iYXR0ZXJ5X3N0YXR1c19vYmplY3RfZXNzZW50aWFsX2ljb24uc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIxLjEuMiAoMGEwMGNmNTMzOSwgMjAyMi0wMi0wNCkiCiAgIHhtbG5zOmlua3NjYXBlPSJodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy9uYW1lc3BhY2VzL2lua3NjYXBlIgogICB4bWxuczpzb2RpcG9kaT0iaHR0cDovL3NvZGlwb2RpLnNvdXJjZWZvcmdlLm5ldC9EVEQvc29kaXBvZGktMC5kdGQiCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c3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wyLDJIMjZhMiwyLDAsMCwwLDItMlYyMWgxYTEsMSwwLDAsMCwxLTFWMTloMWExLDEsMCwwLDAsMS0xVjE0QTEsMSwwLDAsMCwzMSwxM1ptLTUtMVYyMkgxOFYxMGg4WiIKICAgICAgIGlkPSJwYXRoMTA2MSIKICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmYiIC8+CiAgPC9nPgo8L3N2Zz4K)](https://pypi.org/project/pandoc-beamer-block/)
[![Docs](https://img.shields.io/readthedocs/pandoc-beamer-block.svg?logo=read-the-docs&logoColor=white)](http://pandoc-beamer-block.readthedocs.io/en/latest/)
Expand Down
10 changes: 10 additions & 0 deletions pandoc_beamer_block/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
pandoc_beamer_block package.
"""

from ._main import main

__all__ = ("main",)

if __name__ == "__main__":
main()
15 changes: 10 additions & 5 deletions pandoc_beamer_block.py → pandoc_beamer_block/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
Pandoc filter for adding beamer block on specific div.
"""

from panflute import Div, RawBlock, convert_text, run_filter
from panflute import Div, Doc, Element, RawBlock, convert_text, run_filter


def prepare(doc):
def prepare(doc: Doc):
"""
Prepare the document.
Expand Down Expand Up @@ -36,7 +36,9 @@ def prepare(doc):
doc.defined.append(definition)


def latex(elem, environment, title, optional=False):
def latex(
elem: Element, environment: str, title: str, optional: bool = False
) -> list[Element]:
"""
Generate the LaTeX code.
Expand All @@ -56,6 +58,7 @@ def latex(elem, environment, title, optional=False):
Returns
-------
list[Element]
A list of pandoc elements.
"""
if optional:
Expand All @@ -78,7 +81,7 @@ def latex(elem, environment, title, optional=False):


# pylint: disable=too-many-return-statements
def block(elem, doc):
def block(elem: Element, doc: Doc) -> list[Element] | None:
"""
Transform div element.
Expand All @@ -91,6 +94,7 @@ def block(elem, doc):
Returns
-------
list[Element] | None
A list of pandoc elements or None.
"""
if doc.format == "beamer" and isinstance(elem, Div):
Expand Down Expand Up @@ -125,7 +129,7 @@ def block(elem, doc):
return None


def main(doc=None):
def main(doc: Doc | None = None) -> Doc:
"""
Convert the pandoc document.
Expand All @@ -136,6 +140,7 @@ def main(doc=None):
Returns
-------
Doc
The modified pandoc document.
"""
return run_filter(block, doc=doc, prepare=prepare)
Expand Down
Loading

0 comments on commit 1feb30e

Please sign in to comment.