1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-06 01:57:40 +00:00

textproc/py-marko: Add py-marko 1.1.0

Marko is a markdown parser written in pure Python that complies with
CommonMark's spec v0.30. It is designed to be highly extensible.

Among all implementations of Python's markdown parser, it is a common issue that
user can't easily extend it to add his own features. Furthermore,
Python-Markdown and mistune don't comply with CommonMark's spec. It is a good
reason for me to develop a new markdown parser.

Respecting that Marko complies with CommonMark's spec at the same time, which is
a super complicated spec, Marko's performance will be affected. However, using a
parser which doesn't comply with the CommonMark spec may give you unexpected
rendered results from time to time. A benchmark result shows that Marko is 3
times slower than Python-Markdown, but a bit faster than Commonmark-py, much
slower than mistune. If performance is a bigger concern to you than spec
compliance, you'd better choose another parser.

WWW: https://github.com/frostming/marko
This commit is contained in:
Po-Chuan Hsieh 2021-09-28 03:44:11 +08:00
parent d08cccaa48
commit 0a304e40cb
No known key found for this signature in database
GPG Key ID: 9A4BD10F002DD04B
5 changed files with 110 additions and 0 deletions

View File

@ -1337,6 +1337,7 @@
SUBDIR += py-markdown-it-py
SUBDIR += py-markdown-math
SUBDIR += py-markdown2
SUBDIR += py-marko
SUBDIR += py-markuppy
SUBDIR += py-markups
SUBDIR += py-markupsafe

View File

@ -0,0 +1,23 @@
# Created by: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
PORTNAME= marko
PORTVERSION= 1.1.0
CATEGORIES= textproc python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Markdown parser with high extensibility
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= python:3.6+
USE_PYTHON= autoplist concurrent distutils
NO_ARCH= yes
post-patch:
@${CP} ${FILESDIR}/setup.py ${WRKSRC}/
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1632760430
SHA256 (marko-1.1.0.tar.gz) = 764316137a2f1ada070958870208ea5b6e4eda879ee4b743552aaebf9d0397f7
SIZE (marko-1.1.0.tar.gz) = 135642

View File

@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
from setuptools import setup
import codecs
with codecs.open('README.md', encoding="utf-8") as fp:
long_description = fp.read()
EXTRAS_REQUIRE = {
'toc': [
'python-slugify',
],
'codehilite': [
'pygments',
],
'benchmark': [
'commonmark~=0.9',
'markdown~=3.3',
'markdown-it-py~=0.6',
'mistune~=0.8',
'mistletoe~=0.7',
],
}
ENTRY_POINTS = {
'console_scripts': [
'marko = marko.cli:main',
],
}
setup_kwargs = {
'name': 'marko',
'version': '1.1.0',
'description': 'A markdown parser with high extensibility.',
'long_description': long_description,
'license': 'MIT',
'author': '',
'author_email': 'Frost Ming <mianghong@gmail.com>',
'maintainer': None,
'maintainer_email': None,
'url': 'https://github.com/frostming/marko',
'packages': [
'marko',
'marko.ext',
'marko.ext.gfm',
],
'package_data': {'': ['*']},
'long_description_content_type': 'text/markdown',
'classifiers': [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
'extras_require': EXTRAS_REQUIRE,
'python_requires': '>=3.6',
'entry_points': ENTRY_POINTS,
}
setup(**setup_kwargs)

View File

@ -0,0 +1,17 @@
Marko is a markdown parser written in pure Python that complies with
CommonMark's spec v0.30. It is designed to be highly extensible.
Among all implementations of Python's markdown parser, it is a common issue that
user can't easily extend it to add his own features. Furthermore,
Python-Markdown and mistune don't comply with CommonMark's spec. It is a good
reason for me to develop a new markdown parser.
Respecting that Marko complies with CommonMark's spec at the same time, which is
a super complicated spec, Marko's performance will be affected. However, using a
parser which doesn't comply with the CommonMark spec may give you unexpected
rendered results from time to time. A benchmark result shows that Marko is 3
times slower than Python-Markdown, but a bit faster than Commonmark-py, much
slower than mistune. If performance is a bigger concern to you than spec
compliance, you'd better choose another parser.
WWW: https://github.com/frostming/marko