Date: Mon, 27 Sep 2021 19:49:01 GMT From: Po-Chuan Hsieh <sunpoet@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 0a304e40cbe2 - main - textproc/py-marko: Add py-marko 1.1.0 Message-ID: <202109271949.18RJn10i042579@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=0a304e40cbe2b09d8d62d35c117523156b4bd7ae commit 0a304e40cbe2b09d8d62d35c117523156b4bd7ae Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2021-09-27 19:44:11 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2021-09-27 19:48:07 +0000 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 --- textproc/Makefile | 1 + textproc/py-marko/Makefile | 23 ++++++++++++++ textproc/py-marko/distinfo | 3 ++ textproc/py-marko/files/setup.py | 66 ++++++++++++++++++++++++++++++++++++++++ textproc/py-marko/pkg-descr | 17 +++++++++++ 5 files changed, 110 insertions(+) diff --git a/textproc/Makefile b/textproc/Makefile index 2fb979272429..f4ee5b8f68ce 100644 --- a/textproc/Makefile +++ b/textproc/Makefile @@ -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 diff --git a/textproc/py-marko/Makefile b/textproc/py-marko/Makefile new file mode 100644 index 000000000000..510781753dff --- /dev/null +++ b/textproc/py-marko/Makefile @@ -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> diff --git a/textproc/py-marko/distinfo b/textproc/py-marko/distinfo new file mode 100644 index 000000000000..77856078e1ee --- /dev/null +++ b/textproc/py-marko/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1632760430 +SHA256 (marko-1.1.0.tar.gz) = 764316137a2f1ada070958870208ea5b6e4eda879ee4b743552aaebf9d0397f7 +SIZE (marko-1.1.0.tar.gz) = 135642 diff --git a/textproc/py-marko/files/setup.py b/textproc/py-marko/files/setup.py new file mode 100644 index 000000000000..030fc4e7211e --- /dev/null +++ b/textproc/py-marko/files/setup.py @@ -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) diff --git a/textproc/py-marko/pkg-descr b/textproc/py-marko/pkg-descr new file mode 100644 index 000000000000..6a8d23447dcf --- /dev/null +++ b/textproc/py-marko/pkg-descr @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109271949.18RJn10i042579>