initial import

This commit is contained in:
2025-06-22 20:39:04 -05:00
commit f8a70886f0
3428 changed files with 302546 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
# Maintainer: Jesus E. <heckyel@riseup.net>
pkgname=python-recommonmark
pkgver=0.6.0
_debver=0.6.0+ds
_debrel=1
pkgrel=0
pkgdesc='Markdown parser for docutils'
url='https://recommonmark.readthedocs.io/'
arch=('any')
license=('Expat')
depends=('python-docutils' 'python-commonmark' 'python-setuptools' 'python-sphinx')
makedepends=('quilt')
#checkdepends=('python-pytest')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/readthedocs/recommonmark/archive/${pkgver}.tar.gz
https://deb.debian.org/debian/pool/main/r/recommonmark/recommonmark_$_debver-$_debrel.debian.tar.xz
recommonmark-disable-math-on-builds.patch
recommonmark-sphinx-2.patch)
sha512sums=('44005b3fd0052cd8d4fce8a64f9d66a1ac75dc3041a28c115e922254956b2143296cbfbc0a2396b9f95691145645c4242e3be68e695b2c62ae37964014511679'
'59fd43653e2ccacac53b36571a6ff1e1b68862e0d024b543038ac39cfd0273c33ef501492efc849d985085a153f07256f32fddb736408a9e701c7fdbf3a5d2a0'
'66ef07ac21643b913c8ee551c7c71753fcb6442712e4fb11b84ea5f34265715471759b2c5a1badc1e299ca6aa831713b12284144801616349b2db61738607e8a'
'317b7139819bb183184e0a5abf4f74b955746779c841cf3b9e7e8032cc23ac3ce5f54a1ebd2d4c012038041c58ab849a09271d806f9fc3c5c0dadd1ad92eddae')
prepare() {
cd recommonmark-${pkgver}
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
mv "$srcdir"/debian .
quilt push -av
else
patch -p1 -i "${srcdir}/recommonmark-sphinx-2.patch" # Fix tests with Sphinx 2
fi
patch -p1 -i "${srcdir}/recommonmark-disable-math-on-builds.patch"
}
build() {
cd recommonmark-${pkgver}
python setup.py build
make -j1 -C docs text man SPHINXBUILD=sphinx-build
}
#check() {
# cd recommonmark-${pkgver}
# py.test
#}
package() {
cd recommonmark-${pkgver}
python setup.py install --root="${pkgdir}" --skip-build -O1
install -Dm 644 license.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
install -Dm 644 README.md CHANGELOG.md -t "${pkgdir}/usr/share/doc/${pkgname}"
install -Dm 644 docs/_build/text/*.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
install -Dm 644 docs/_build/man/recommonmark.1 "${pkgdir}/usr/share/man/man1/recommonmark.1"
}
# vim: ts=2 sw=2 et:

View File

@@ -0,0 +1,59 @@
From 5a14811519a219b88c96b5b9bc3103ce5d758dc4 Mon Sep 17 00:00:00 2001
From: Eric Holscher <eric@ericholscher.com>
Date: Fri, 9 Aug 2019 11:37:09 -0700
Subject: [PATCH] Disable math on builds to fix doc building
---
docs/auto_structify.md | 6 ++++++
docs/conf.py | 2 ++
2 files changed, 8 insertions(+)
diff --git a/docs/auto_structify.md b/docs/auto_structify.md
index 52eba2e..c4d58e5 100644
--- a/docs/auto_structify.md
+++ b/docs/auto_structify.md
@@ -134,6 +134,8 @@ def function():
### Math Formula
You can normally write latex math formula with `math` codeblock. See also [Inline Math](#inline-math).
+**Warning**: Math is currently broken on some Sphinx builds
+
Example
````
@@ -149,6 +151,7 @@ E = m c^2
```
### Embed reStructuredText
+
Recommonmark also allows embedding reStructuredText syntax in the codeblocks.
There are two styles for embedding reStructuredText. The first is enabled by `eval_rst` codeblock. The content of codeblock will be parsed as reStructuredText and insert into the document. This can be used to quickly introduce some of reStructuredText command that not yet available in markdown. For example,
@@ -243,11 +246,14 @@ The `<div style="clear: right;"></div>` line clears the sidebar for the next tit
Inline Math
-----------
+
Besides the [Math Formula](#math-formula), you can also write latex math in inline codeblock text. You can do so by inserting `$`
in the beginning and end of inline codeblock.
Example
+**Warning**: Math is currently broken on some Sphinx builds
+
```
This formula `$ y=\sum_{i=1}^n g(x_i) $`
```
diff --git a/docs/conf.py b/docs/conf.py
index 5c2f8c1..a67cc99 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -295,6 +295,8 @@ def setup(app):
app.add_config_value('recommonmark_config', {
#'url_resolver': lambda url: github_doc_root + url,
'auto_toc_tree_section': 'Contents',
+ 'enable_math': False,
+ 'enable_inline_math': False,
'enable_eval_rst': True,
'enable_auto_doc_ref': True,
}, True)

View File

@@ -0,0 +1,49 @@
diff --git a/tests/test_sphinx.py b/tests/test_sphinx.py
index 06078b1..201f27b 100644
--- a/tests/test_sphinx.py
+++ b/tests/test_sphinx.py
@@ -142,17 +142,17 @@ class GenericTests(SphinxIntegrationTests):
output = self.read_file('index.html')
self.assertIn(
('<ul class="simple">\n'
- '<li>Item A</li>\n'
- '<li>Item B</li>\n'
- '<li>Item C</li>\n'
+ '<li><p>Item A</p></li>\n'
+ '<li><p>Item B</p></li>\n'
+ '<li><p>Item C</p></li>\n'
'</ul>'),
output
)
self.assertIn(
('<ol class="simple">\n'
- '<li>Item 1</li>\n'
- '<li>Item 2</li>\n'
- '<li>Item 3</li>\n'
+ '<li><p>Item 1</p></li>\n'
+ '<li><p>Item 2</p></li>\n'
+ '<li><p>Item 3</p></li>\n'
'</ol>'),
output
)
@@ -207,16 +207,16 @@ class CustomExtensionTests(SphinxIntegrationTests):
def test_integration(self):
output = self.read_file('index.html')
self.assertIn('<table ', output)
- self.assertIn('<th class="head">abc</th>', output)
- self.assertIn('<th class="head">data</th>', output)
+ self.assertIn('<th class="head"><p>abc</p></th>', output)
+ self.assertIn('<th class="head"><p>data</p></th>', output)
self.assertIn('</table>', output)
self.assertIn(
('<div class="contents topic" id="contents">\n'
'<p class="topic-title first">Contents</p>\n'
'<ul class="simple">\n'
- '<li><a class="reference internal" href="#header" id="id1">Header</a><ul>\n'
- '<li><a class="reference internal" href="#header-2" id="id2">Header 2</a></li>\n'
+ '<li><p><a class="reference internal" href="#header" id="id1">Header</a></p>\n<ul>\n'
+ '<li><p><a class="reference internal" href="#header-2" id="id2">Header 2</a></p></li>\n'
'</ul>\n</li>\n</ul>'),
output
)