Skip to content

Commit

Permalink
python-recommonmark: initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
noptrix committed Nov 19, 2024
1 parent cbf5782 commit 06579f6
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
42 changes: 42 additions & 0 deletions packages/python-recommonmark/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-recommonmark
_pkgname=recommonmark
pkgver=0.7.1
pkgrel=8
pkgdesc='A docutils-compatibility bridge to CommonMark, enabling you to write CommonMark inside of Docutils & Sphinx projects.'
arch=('any')
url='https://pypi.org/project/recommonmark/'
license=('MIT')
depends=('python' 'python-commonmark' 'python-docutils' 'python-sphinx')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/r/$_pkgname/$_pkgname-$pkgver.tar.gz"
'autostructify-tab_width-fallback.patch')
sha512sums=('3d8068b36c02be5977c123675cf4bb387b3155f2fcf111ee02792b655f9d9efb6e35a9e127baef01f32f0ddbe58554b47dd26053edf8833add57ac0ef2184694'
'78cdce36054551bc1169a8869ab13380dc8be11bd3583785a2ea3240f0c49069fb6ceb5026910a329c7b6301a7cc0d661b6547709f4283d54d08192cbb8e362c')

prepare() {
cd $_pkgname-$pkgver

patch -Np1 -i ../autostructify-tab_width-fallback.patch
}

build() {
cd $_pkgname-$pkgver

python setup.py build

make -C docs text man
}


package() {
cd $_pkgname-$pkgver

python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" README.md CHANGELOG.md \
docs/_build/text/*.txt
install -Dm 644 -t "$pkgdir/usr/share/man/man1" "docs/_build/man/$_pkgname.1"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff -upr recommonmark-0.7.1.orig/recommonmark/transform.py recommonmark-0.7.1/recommonmark/transform.py
--- recommonmark-0.7.1.orig/recommonmark/transform.py 2019-08-09 21:38:35.000000000 +0300
+++ recommonmark-0.7.1/recommonmark/transform.py 2022-05-31 13:35:09.247049278 +0300
@@ -28,6 +28,8 @@ class AutoStructify(transforms.Transform
self.config.update(new_cfg)
except AttributeError:
pass
+ # provide fallback like https://repo.or.cz/docutils.git/commit/e3bd0958bac8
+ self.document.settings.setdefault('tab_width', 8)

# Deprecation notices
# TODO move this check to an extension pattern, and only call once

0 comments on commit 06579f6

Please sign in to comment.