commit 98deeccb7564b644f97376ff62ab7ac03201090518636c93054df48e2341657e Author: Todd R Date: Thu Apr 6 17:27:54 2017 +0000 Accepting request 486212 from home:TheBlackCat:branches:devel:languages:python Needed by recent versions of the jupyter suite. OBS-URL: https://build.opensuse.org/request/show/486212 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-recommonmark?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/README.md b/README.md new file mode 100644 index 0000000..7503d28 --- /dev/null +++ b/README.md @@ -0,0 +1,107 @@ +# recommonmark + +A `docutils`-compatibility bridge to [CommonMark][cm]. + +This allows you to write CommonMark inside of Docutils & Sphinx projects. + +Documentation is available on Read the Docs: + +Contents +-------- +* [API Reference](api_ref.md) +* [AutoStructify Component](auto_structify.md) + +## Getting Started + +To use `recommonmark` inside of Sphinx only takes 2 steps. +First you install it: + +``` +pip install recommonmark +``` + +Then add this to your Sphinx conf.py: + +``` +from recommonmark.parser import CommonMarkParser + +source_parsers = { + '.md': CommonMarkParser, +} + +source_suffix = ['.rst', '.md'] +``` + +This allows you to write both `.md` and `.rst` files inside of the same project. + +### AutoStructify + +To use the advanced markdown to rst transformations you must add `AutoStructify` to your Sphinx conf.py. + +```python +# At top on conf.py (with other import statements) +import recommonmark +from recommonmark.transform import AutoStructify + +# At the bottom of conf.py +def setup(app): + app.add_config_value('recommonmark_config', { + 'url_resolver': lambda url: github_doc_root + url, + 'auto_toc_tree_section': 'Contents', + }, True) + app.add_transform(AutoStructify) +``` + +See https://github.com/rtfd/recommonmark/blob/master/docs/conf.py for a full example. + +AutoStructify comes with the following options. See http://recommonmark.readthedocs.org/en/latest/auto_structify.html for more information about the specific features. + +* __enable_auto_toc_tree__: enable the Auto Toc Tree feature. +* __auto_toc_tree_section__: when True, Auto Toc Tree will only be enabled on section that matches the title. +* __enable_auto_doc_ref__: enable the Auto Doc Ref feature. +* __enable_math__: enable the Math Formula feature. +* __enable_inline_math__: enable the Inline Math feature. +* __enable_eval_rst__: enable the evaluate embedded reStructuredText feature. +* __url_resolver__: a function that maps a existing relative position in the document to a http link + +## Development + +You can run the tests by running `tox` in the top-level of the project. + +We are working to expand test coverage, +but this will at least test basic Python 2 and 3 compatability. + +## Why a bridge? + +Many python tools (mostly for documentation creation) rely on `docutils`. +But [docutils][dc] only supports a ReStructuredText syntax. + +For instance [this issue][sphinx-issue] and [this StackOverflow +question][so-question] show that there is an interest in allowing `docutils` +to use markdown as an alternative syntax. + +## Why another bridge to docutils? + +recommonmark uses the [python implementation][pcm] of [CommonMark][cm] while +[remarkdown][rmd] implements a stand-alone parser leveraging [parsley][prs]. + +Both output a [`docutils` document tree][dc] and provide scripts +that leverage `docutils` for generation of different types of documents. + +## Acknowledgement + +recommonmark is mainly derived from [remarkdown][rmd] by Steve Genoud and +leverages the python CommonMark implementation. + +It was originally created by [Luca Barbato][lu-zero], +and is now maintained in the Read the Docs (rtfd) GitHub organization. + +[cm]: http://commonmark.org +[pcm]: https://github.com/rtfd/CommonMark-py +[rmd]: https://github.com/sgenoud/remarkdown +[prs]: https://github.com/python-parsley/parsley +[lu-zero]: https://github.com/lu-zero + +[dc]: http://docutils.sourceforge.net/docs/ref/doctree.html +[sphinx-issue]: https://bitbucket.org/birkenfeld/sphinx/issue/825/markdown-capable-sphinx +[so-question]: http://stackoverflow.com/questions/2471804/using-sphinx-with-markdown-instead-of-rst diff --git a/license.md b/license.md new file mode 100644 index 0000000..0d4c44d --- /dev/null +++ b/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Steve Genoud + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/python-recommonmark.changes b/python-recommonmark.changes new file mode 100644 index 0000000..d567ddc --- /dev/null +++ b/python-recommonmark.changes @@ -0,0 +1,23 @@ +------------------------------------------------------------------- +Mon Apr 3 14:53:38 UTC 2017 - toddrme2178@gmail.com + +- Initial python singlepsec version. + +------------------------------------------------------------------- +Thu May 19 15:16:07 UTC 2016 - toddrme2178@gmail.com + +- Update to version 0.4.0 + * No upstream changelog + +------------------------------------------------------------------- +Sun May 8 07:15:20 UTC 2016 - arun@gmx.de + +- specfile: + * updated source url to files.pythonhosted.org + + +------------------------------------------------------------------- +Thu Dec 10 13:07:36 UTC 2015 - bruno@ioda-net.ch + +- Initial packaging on obs + diff --git a/python-recommonmark.spec b/python-recommonmark.spec new file mode 100644 index 0000000..e10fafb --- /dev/null +++ b/python-recommonmark.spec @@ -0,0 +1,102 @@ +# +# spec file for package python-recommonmark +# +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-recommonmark +Version: 0.4.0 +Release: 0 +Summary: Python docutils-compatibility bridge to CommonMark +License: MIT +Group: Development/Languages/Python +Url: https://github.com/rtfd/recommonmark +Source0: https://files.pythonhosted.org/packages/source/r/recommonmark/recommonmark-%{version}.tar.gz +Source1: https://raw.githubusercontent.com/rtfd/recommonmark/master/license.md +Source2: https://raw.githubusercontent.com/rtfd/recommonmark/master/README.md +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module docutils} +BuildRequires: %{python_module CommonMark} +Requires: python-docutils +Requires: python-CommonMark +Provides: python-reCommonMark = %{version} +Obsoletes: python-reCommonMark < %{version} +Requires(post): update-alternatives +Requires(preun): update-alternatives +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch + +%python_subpackages + +%description +A python docutils-compatibility bridge to CommonMark. + +This allows you to write CommonMark inside of Docutils & Sphinx projects. + +Documentation is available on Read the Docs: +http://recommonmark.readthedocs.org + + +%prep +%setup -q -n recommonmark-%{version} +# Remove upstream's egg-info +rm -rf %{pypi_name}.egg-info +#Add missing license and readme +cp -a %{SOURCE1} . +cp -a %{SOURCE2} . +# find and remove unneeded shebangs +find recommonmark -name "*.py" | xargs sed -i '1 {/^#!/ d}' + + +%build +%python_build + + +%install +%python_install +%fdupes %{buildroot}%{_prefix} + +%python_clone -a %{buildroot}%{_bindir}/cm2html +%python_clone -a %{buildroot}%{_bindir}/cm2latex +%python_clone -a %{buildroot}%{_bindir}/cm2man +%python_clone -a %{buildroot}%{_bindir}/cm2pseudoxml +%python_clone -a %{buildroot}%{_bindir}/cm2xetex +%python_clone -a %{buildroot}%{_bindir}/cm2xml + + +%post +%{python_install_alternative cm2man cm2latex cm2xetex cm2pseudoxml cm2html cm2xml} + +%preun +%python_uninstall_alternative cm2man + + +%files %{python_files} +%defattr(-,root,root,-) +%doc README.md license.md +%python_alternative %{_bindir}/cm2html +%python_alternative %{_bindir}/cm2latex +%python_alternative %{_bindir}/cm2man +%python_alternative %{_bindir}/cm2pseudoxml +%python_alternative %{_bindir}/cm2xetex +%python_alternative %{_bindir}/cm2xml +%{python_sitelib}/recommonmark/ +%{python_sitelib}/recommonmark-%{version}-py*.egg-info + +%changelog diff --git a/recommonmark-0.4.0.tar.gz b/recommonmark-0.4.0.tar.gz new file mode 100644 index 0000000..55345fa --- /dev/null +++ b/recommonmark-0.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e29c723abcf5533842376d87c4589e62923ecb6002a8e059eb608345ddaff9d +size 7112