summaryrefslogtreecommitdiff
path: root/dev-python/m2r
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-python/m2r
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-python/m2r')
-rw-r--r--dev-python/m2r/Manifest10
-rw-r--r--dev-python/m2r/files/m2r.1515
-rw-r--r--dev-python/m2r/files/test.md5
-rw-r--r--dev-python/m2r/files/test.rst8
-rw-r--r--dev-python/m2r/m2r-0.1.12.ebuild47
-rw-r--r--dev-python/m2r/m2r-0.1.5.ebuild49
-rw-r--r--dev-python/m2r/m2r-0.1.6.ebuild49
-rw-r--r--dev-python/m2r/metadata.xml19
8 files changed, 702 insertions, 0 deletions
diff --git a/dev-python/m2r/Manifest b/dev-python/m2r/Manifest
new file mode 100644
index 000000000000..fee3d5591841
--- /dev/null
+++ b/dev-python/m2r/Manifest
@@ -0,0 +1,10 @@
+AUX m2r.1 9244 SHA256 514e684cf89b345f1db6cfcc6d62e4b1cbf1bea9534be1bab29a061cb4eaccfe SHA512 bb085477c363a0384a5aea0f5cac3e64ece957048f5a610b3063a5d96a31e8b78167dd847bd42d0f267b506595b55cffdf7647a5c819c9755b054e34d2ee3a99 WHIRLPOOL 54a87c5fd246a488f69d771fdb90a9b9537e6ea3ed01c17cc9912a467528b625e2eef38cb170069cb3f8e9f6baf202f46d7f2b3a40e6bc0ed89ae21d061d2763
+AUX test.md 34 SHA256 4de52ecd38fcfb8eb76e4aa773ef53daf8f42d06e3307a0a35380698bc9a9845 SHA512 c4b98b3256e14d46187d4c5cf5d3b26e4e4e0b1c6f2f61618987c234f49ea5a9bf31a94b9d2c4907bbd0685fb30138a5916b5dd3c8f92cd80bf0c7c2e657ae26 WHIRLPOOL fb01c2430fe9c210561ec4d0a55ffd1a157cd051b754ef9e093d5f48e5f8b69c62d52bcc33162173ce46a42423e515eea14252765a0e3781688eacd06a2b3dc1
+AUX test.rst 45 SHA256 4b2c59ad09b719e6a1d7d10d0692b2adcdea7f8fbae226a10ca49213cd0218a1 SHA512 a2d44de89e17b5a023928fa695c8dd61163a2b59968a514b9a976f92923881ce53625930f0e05f7f257250e46f25747928f71e8f25fcb9c05445b221688077d7 WHIRLPOOL e802dd8282e4bf7038629d9ebb7282d9daf47b4bb23c95f14388b8607e687ed98287b6e28e501168504a03f9d5380a19e994356b1d4ff57b3057ff721bfbefd0
+DIST m2r-0.1.12.tar.gz 15358 SHA256 adfb86ebb7ff3fcd3ebb27ce8cd6f795c409a13f0c03363e265f17419ce5b9ab SHA512 5579f993c9a8aa72195e97ba6ea2a317f97587f2f8fdab6d7cc16ced6ccc169960a99c712b9ab1251cd021b03f1c5566139bfe6c314bdad43b9bf138a921f0f1 WHIRLPOOL fa78d5ad192bf4e29740cdb6964647a47cf8e3b9b087a07ecb33d23cebd4a05fb8ade0fd4fcdd74bce6540a91b02903f27d224bbff4d8df6ac30636d84593546
+DIST m2r-0.1.5.tar.gz 13202 SHA256 3448f770aed05ca10390d0917cd51836cbf82a2f095bc91507e6291cfab03223 SHA512 78e9e8daa293b2466c95f0adad937fa0bbefaf0dd9663695bb916be13182633e0d462afa5331a595db424420485ef54bbfd4e0625962026fab4ce0c63104bc84 WHIRLPOOL c701aa0a735eda9b7eaab7ff6f384bad7535337f6a7adcfce2d729f33b01aed9213d04fcfe1dc3521b2df0687f2b849a3eb5df628a87ea3ea2697ae389ad8438
+DIST m2r-0.1.6.tar.gz 13615 SHA256 a26bc2e25e0ad3f8650385aea25cf734ac4fcd30e54faec92fd39675da75e527 SHA512 3641cf4013f71fbd43d6cdad530cfd3e909c93709edfbd79d6a51e7121de68e279d3ec4eb7eed391a35902ffa467310bd6b020139b2024c3e80fa44e5f6cc4a7 WHIRLPOOL 4bc6ed787069483f4f4c5bcbb4c9cc448dd2d2edc0a7845e2ca74189a0a8b25040c1fed293e4c4aebf6ea1640f69cb777c4621db79a6008b887b8199247712a9
+EBUILD m2r-0.1.12.ebuild 1195 SHA256 5cdb6442f68c0d8995e209ac65d8e1b18daae9107fac68c9ea731bda193fe021 SHA512 fd0521031bbf700f364ee5aef0c8dfaedaf1659adc415933f8d439d91f0f3d84b5e09eda5ed9e23cc5689624d9edf7e8ee038b503a6fed264461d72aa132e600 WHIRLPOOL eeb5c0c3ac1bfaaa65b84b072056d813706f6da25b6b6e5365a5624beb907932a259cef6ea41c55035a3d447439bef10844106b6f4e754c6b33c3e4dc6f0a66f
+EBUILD m2r-0.1.5.ebuild 1266 SHA256 2c1ba30993dba67f983468f9707e321923a48a205d045cad582da46fba4e60fd SHA512 8bf1727b92b641a3367fa261c6a7ecfedcfbdee62cedcd4a241eb130a72523556f5da86ddb8623822e20a50fb0c721291f3c75b077013951b0bcfc51e0a1357d WHIRLPOOL 66cc798e86d8c89f16c99f79ffb3e2a8511322f1aad67000cbd443cc805314e0b2e426d7bbac73e6cdadfa0b17890915a8288fb39febb4da9cb9177d08a26c71
+EBUILD m2r-0.1.6.ebuild 1266 SHA256 2c1ba30993dba67f983468f9707e321923a48a205d045cad582da46fba4e60fd SHA512 8bf1727b92b641a3367fa261c6a7ecfedcfbdee62cedcd4a241eb130a72523556f5da86ddb8623822e20a50fb0c721291f3c75b077013951b0bcfc51e0a1357d WHIRLPOOL 66cc798e86d8c89f16c99f79ffb3e2a8511322f1aad67000cbd443cc805314e0b2e426d7bbac73e6cdadfa0b17890915a8288fb39febb4da9cb9177d08a26c71
+MISC metadata.xml 602 SHA256 93d5c02e43c22ef342cfdd698b03a2f334b96df777b29ba081cb93b64a235e9f SHA512 82a101c9a126a8e8d7b1ebf0786370856fc16aa7cf0941f13b6ce8fcb994beaa189163a17e0c7d9eb1d0cb4c1bbb01bb15d02a310cf563e71b05a8e7bef75c15 WHIRLPOOL 73401efa086a08b67eeeb875b500ce825e5d17d1419e3af7c5a0c56164397657756a41980c3c9f9a7127d078fc400cdae2ae9ef69f0877b75b0308321597a063
diff --git a/dev-python/m2r/files/m2r.1 b/dev-python/m2r/files/m2r.1
new file mode 100644
index 000000000000..1a6c10b48a90
--- /dev/null
+++ b/dev-python/m2r/files/m2r.1
@@ -0,0 +1,515 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "M2R" "1" "Mar 30, 2017" "0.1.5" "M2R"
+.SH NAME
+m2r \- M2R Documentation
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+\fI\%PyPI\fP\fI\%PyPI version\fP\fI\%Build Status\fP\fI\%codecov\fP
+.sp
+.ce
+----
+
+.ce 0
+.sp
+.sp
+M2R converts a markdown file including reST markups to a valid reST format.
+.SH WHY ANOTHER CONVERTER?
+.sp
+I wanted to write sphinx document in markdown, since it\(aqs widely used now and
+easy to write code blocks and lists. However, converters using pandoc or
+recommonmark do not support many reST markups and sphinx extensions. For
+example, reST\(aqs reference link like \fBsee \(garef\(ga_\fP (this is very convenient in
+long document in which same link appears multiple times) will be converted to
+a code block in HTML like \fBsee <code>ref</code>_\fP, which is not expected.
+.SH FEATURES
+.INDENT 0.0
+.IP \(bu 2
+Basic markdown and some extensions (see below)
+.INDENT 2.0
+.IP \(bu 2
+inline/block\-level raw html
+.IP \(bu 2
+fenced\-code block
+.IP \(bu 2
+tables
+.IP \(bu 2
+footnotes (\fB[^1]\fP)
+.UNINDENT
+.IP \(bu 2
+Inline\- and Block\-level reST markups
+.INDENT 2.0
+.IP \(bu 2
+single\- and multi\-line directives (\fB\&.. directive::\fP)
+.IP \(bu 2
+inline\-roles (\fB:code:\(gaprint(1)\(ga ...\fP)
+.IP \(bu 2
+ref\-link (\fBsee \(garef\(ga_\fP)
+.IP \(bu 2
+footnotes (\fB[#fn]_\fP)
+.IP \(bu 2
+math extension inspired by \fI\%recommonmark\fP
+.UNINDENT
+.IP \(bu 2
+Sphinx extension
+.INDENT 2.0
+.IP \(bu 2
+add markdown support for sphinx
+.IP \(bu 2
+\fBmdinclude\fP directive to include markdown from md or reST files
+.UNINDENT
+.UNINDENT
+.SH INSTALLATION
+.sp
+Python 2.7 or Python 3.3+ is required.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+pip install m2r
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH USAGE
+.SS Command Line
+.sp
+\fBm2r\fP command converts markdown file to reST format.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+m2r your_document.md [your_document2.md ...]
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Then you will find \fByour_document.rst\fP in the same directory.
+.SS Programmatic Use
+.sp
+Instantiate \fBM2R\fP class and call with markdown text. Then it will return converted text.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+from m2r import M2R
+m2r = M2R()
+rest = m2r(\(aq# Title\en\enSentence.\(aq)
+print(rest)
+# Title
+# =====
+#
+# Sentence.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Or, use \fBparse_from_file\fP function to load markdown file and obtain converted text.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+from m2r import parse_from_file
+output = parse_from_file(\(aqmarkdown_file.md\(aq)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+This is an example of setup.py to write README in markdown, and publish it to PyPI as reST format.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+readme_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), \(aqREADME.md\(aq)
+try:
+ from m2r import parse_from_file
+ readme = parse_from_file(readme_file)
+except ImportError:
+ # m2r may not be installed in user environment
+ with open(readme_file) as f:
+ readme = f.read()
+setup(
+ ...,
+ long_description=readme,
+ ...,
+)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Sphinx Integration
+.sp
+In your conf.py, add the following lines.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+extensions = [
+ ...,
+ \(aqm2r\(aq,
+]
+
+# source_suffix = \(aq.rst\(aq
+source_suffix = [\(aq.rst\(aq, \(aq.md\(aq]
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Write index.md and run \fBmake html\fP\&.
+.sp
+When \fBm2r\fP extension is enabled on sphinx and \fB\&.md\fP file is loaded, m2r
+converts to reST and pass to sphinx, not making new \fB\&.rst\fP file.
+.SS mdinclude directive
+.sp
+Like \fB\&.. include:: file\fP directive, \fB\&.. mdinclude:: file\fP directive inserts
+markdown file at the line.
+.sp
+Note: do not use \fB\&.. include:: file\fP directive to include markdown file even if
+in the markdown file, please use \fB\&.. mdinclude:: file\fP instead.
+.SH RESTRICTIONS
+.INDENT 0.0
+.IP \(bu 2
+In the reST\(aqs directives, markdown is not available. Please write in reST.
+.IP \(bu 2
+Column alignment of tables is not supported. (reST does not support this feature)
+.IP \(bu 2
+Heading with overline\-and\-underline is not supported.
+.INDENT 2.0
+.IP \(bu 2
+Heading with underline is OK
+.UNINDENT
+.UNINDENT
+.sp
+If you find any bug or unexpected behaviour, please report it to
+\fI\%Issues\fP\&.
+.SH EXAMPLE
+.sp
+See \fI\%example document\fP and \fI\%its
+source code\fP\&.
+.sp
+I\(aqm using m2r for writing user guide of \fI\%WDOM\fP\&.
+So you can see it as another example. Its \fI\%HTML is
+here\fP, and \fI\%its
+source code is here\fP\&.
+.SH ACKNOWLEDGEMENT
+.sp
+m2r is written as an extension of
+\fI\%mistune\fP, which is highly extensible
+pure\-python markdown parser.
+Without the mistune, I couldn\(aqt write this. Thank you!
+.SH LICENCE
+.sp
+\fI\%MIT\fP
+.SH CONTENTS
+.SS Example
+.sp
+This page is written in mixed markdown and reST.
+Source code is \fI\%here\fP\&.
+.SS Basic Markups (inline)
+.sp
+A \fBstrong\fP, \fIemphasis\fP, , \fBcode with single\-backtick\fP,
+\fBcode with two\-backticks\fP, ,
+\fBreST\(aqs code role\fP, and delete.
+.SS Link
+.sp
+Auto link to \fI\%http://example.com/\fP\&.
+.sp
+Link to \fI\%example.com\fP in markdown.
+.sp
+Link to \fI\%example.com\fP in reST.
+.sp
+Link to \fI\%example\fP in reST_ref.
+.SS Basic Markups (block)
+.sp
+This is a simple sentence.
+.nf
+sentence with
+newlines
+(reST)
+.fi
+.sp
+.sp
+Sentence with
+hard\-wrap (markdown, trailing two spaces)
+.INDENT 0.0
+.INDENT 3.5
+block quote
+second line
+.INDENT 0.0
+.INDENT 3.5
+nested quote
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.UNINDENT
+
+.sp
+.ce
+----
+
+.ce 0
+.sp
+.INDENT 0.0
+.INDENT 3.5
+Block quote after raw\-html directive
+.UNINDENT
+.UNINDENT
+.SS List
+.SS Unordered list
+.INDENT 0.0
+.IP \(bu 2
+unordered list
+new line
+.IP \(bu 2
+next item
+.INDENT 2.0
+.IP \(bu 2
+nested list
+with new line
+.IP \(bu 2
+nested list item 2
+.UNINDENT
+.IP \(bu 2
+original depth
+.INDENT 2.0
+.IP 1. 3
+ordered list item
+.IP 2. 3
+second
+with new line
+.UNINDENT
+.IP \(bu 2
+original depth again
+.UNINDENT
+.SS Ordered list
+.INDENT 0.0
+.IP 1. 3
+ordered list
+in new line
+.IP 2. 3
+second item
+.INDENT 3.0
+.IP \(bu 2
+nested unordered list
+.IP \(bu 2
+second item
+with new line
+.UNINDENT
+.IP 3. 3
+original depth
+.INDENT 3.0
+.IP 1. 3
+nested ordered list
+with new line
+.IP 2. 3
+again
+.UNINDENT
+.IP 4. 3
+original depth again
+.UNINDENT
+.SS Code Block
+.sp
+Simple, indented code block
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+pip install sphinx
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Code block with triple backticks and language.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+def a(n: int) \-> None:
+ for i in range(n):
+ print(i)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Triple\-tildes (\fB~~~\fP) are also available.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+def a(n: int) \-> None:
+ for i in range(n):
+ print(i)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Here is reST style code block.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+if True:
+ print(\(aq\en\(aq)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Extensions
+.SS Table (Markdown\-Style)
+.sp
+(cell\-alignment is not supported currently)
+.TS
+center;
+|l|l|l|.
+_
+T{
+Table Header 1
+T} T{
+Table Header 2
+T} T{
+Table Header 3
+T}
+_
+T{
+normal
+T} T{
+\fIitalic\fP
+T} T{
+\fBbold\fP
+T}
+_
+T{
+\fBcode\fP
+T} T{
+T} T{
+T}
+_
+.TE
+.SS Math
+.sp
+This is E = mc^2 inline math.
+.sp
+The below is math\-block (markdown\-style).
+.sp
+.ce
+
+.ce 0
+.sp
+The below is reST\-style math\-block.
+.sp
+.ce
+
+.ce 0
+.SS Footnote
+.sp
+Footnote[2] and footnote[3] with markdown.
+.sp
+Footnote with reST[1]\&.
+.sp
+
+.IP [1] 5
+reST footnote
+.IP [2] 5
+footnote 1
+.IP [3] 5
+footnote key
+.SS Change Log
+.SS Version 0.2
+.sp
+(next version)
+.SS Version 0.1.5 (2016\-06\-21)
+.INDENT 0.0
+.IP \(bu 2
+Support multiple backticks in inline code, like:
+.UNINDENT
+.SS Version 0.1.4 (2016\-06\-08)
+.INDENT 0.0
+.IP \(bu 2
+Support indented directives/reST\-comments
+.IP \(bu 2
+Support role\-name after backticks (\fB\(gatext\(ga:role: style\fP)
+.UNINDENT
+.SS Version 0.1.3 (2016\-06\-02)
+.INDENT 0.0
+.IP \(bu 2
+Remove extra escaped\-spaces (\(aq\(aq)
+.INDENT 2.0
+.IP \(bu 2
+before and after normal spaces
+.IP \(bu 2
+at the beginning of lines
+.IP \(bu 2
+before dots
+.UNINDENT
+.UNINDENT
+.SS Version 0.1.2 (2016\-06\-01)
+.INDENT 0.0
+.IP \(bu 2
+Add reST\(aqs \fB::\fP marker support
+.IP \(bu 2
+Add options to disable emphasis by underscore (\fB_\fP or \fB__\fP)
+.UNINDENT
+.SS Version 0.1.1 (2016\-05\-30)
+.INDENT 0.0
+.IP \(bu 2
+Fix Bug: when code or link is placed at the end of line, spaces to the next word is disappeared
+.UNINDENT
+.SS Version 0.1 (2016\-05\-30)
+.sp
+First public release.
+.INDENT 0.0
+.IP \(bu 2
+genindex
+.IP \(bu 2
+modindex
+.IP \(bu 2
+search
+.UNINDENT
+.SH AUTHOR
+Hiroyuki Takagi
+.SH COPYRIGHT
+2016, Hiroyuki Takagi
+.\" Generated by docutils manpage writer.
+.
diff --git a/dev-python/m2r/files/test.md b/dev-python/m2r/files/test.md
new file mode 100644
index 000000000000..e54ac950e527
--- /dev/null
+++ b/dev-python/m2r/files/test.md
@@ -0,0 +1,5 @@
+# Title
+
+## SubTitle
+
+__content__
diff --git a/dev-python/m2r/files/test.rst b/dev-python/m2r/files/test.rst
new file mode 100644
index 000000000000..f45558879567
--- /dev/null
+++ b/dev-python/m2r/files/test.rst
@@ -0,0 +1,8 @@
+
+Title
+=====
+
+SubTitle
+--------
+
+**content**
diff --git a/dev-python/m2r/m2r-0.1.12.ebuild b/dev-python/m2r/m2r-0.1.12.ebuild
new file mode 100644
index 000000000000..b5cb99779fb4
--- /dev/null
+++ b/dev-python/m2r/m2r-0.1.12.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy)
+
+inherit distutils-r1
+
+DESCRIPTION="Markdown to reStructuredText converter"
+HOMEPAGE="https://github.com/miyakogi/m2r https://pypi.python.org/pypi/m2r"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~x86"
+IUSE="test"
+
+RDEPEND="
+ dev-python/mistune[${PYTHON_USEDEP}]
+ dev-python/docutils[${PYTHON_USEDEP}]
+"
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? ( $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7) )
+ ${RDEPEND}
+"
+
+#S=${WORKDIR}/${P}
+
+python_prepare_all() {
+ # fix a Q/A violation, trying to install the tests as an independant package
+ sed -e "s/packages=\['tests'\],/packages=[],/" -i setup.py
+ # add missing test files
+ cp "${FILESDIR}/"test.md tests/ || die
+ cp "${FILESDIR}/"test.rst tests/ || die
+ cp "${FILESDIR}/"m2r.1 ./ || die
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ py.test -v || die "Tests failed with ${EPYTHON}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ doman m2r.1
+}
diff --git a/dev-python/m2r/m2r-0.1.5.ebuild b/dev-python/m2r/m2r-0.1.5.ebuild
new file mode 100644
index 000000000000..d6d2a181ec75
--- /dev/null
+++ b/dev-python/m2r/m2r-0.1.5.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy)
+
+inherit distutils-r1
+
+DESCRIPTION="Markdown to reStructuredText converter"
+HOMEPAGE="https://github.com/miyakogi/m2r https://pypi.python.org/pypi/m2r"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~x86"
+IUSE="test"
+
+RDEPEND="
+ dev-python/mistune[${PYTHON_USEDEP}]
+ dev-python/docutils[${PYTHON_USEDEP}]
+"
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? ( $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7) )
+ ${RDEPEND}
+"
+
+#S=${WORKDIR}/${P}
+
+python_prepare_all() {
+ # fix a Q/A violation, trying to install the tests as an independant package
+ sed -e "s/packages=\['tests'\],/packages=[],/" -i setup.py
+ # remove duped old file in the tarball
+ rm "tests/test_r s.py" || die
+ # add missing test files
+ cp "${FILESDIR}/"test.md tests/ || die
+ cp "${FILESDIR}/"test.rst tests/ || die
+ cp "${FILESDIR}/"m2r.1 ./ || die
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ py.test -v || die "Tests failed with ${EPYTHON}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ doman m2r.1
+}
diff --git a/dev-python/m2r/m2r-0.1.6.ebuild b/dev-python/m2r/m2r-0.1.6.ebuild
new file mode 100644
index 000000000000..d6d2a181ec75
--- /dev/null
+++ b/dev-python/m2r/m2r-0.1.6.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy)
+
+inherit distutils-r1
+
+DESCRIPTION="Markdown to reStructuredText converter"
+HOMEPAGE="https://github.com/miyakogi/m2r https://pypi.python.org/pypi/m2r"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~x86"
+IUSE="test"
+
+RDEPEND="
+ dev-python/mistune[${PYTHON_USEDEP}]
+ dev-python/docutils[${PYTHON_USEDEP}]
+"
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? ( $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7) )
+ ${RDEPEND}
+"
+
+#S=${WORKDIR}/${P}
+
+python_prepare_all() {
+ # fix a Q/A violation, trying to install the tests as an independant package
+ sed -e "s/packages=\['tests'\],/packages=[],/" -i setup.py
+ # remove duped old file in the tarball
+ rm "tests/test_r s.py" || die
+ # add missing test files
+ cp "${FILESDIR}/"test.md tests/ || die
+ cp "${FILESDIR}/"test.rst tests/ || die
+ cp "${FILESDIR}/"m2r.1 ./ || die
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ py.test -v || die "Tests failed with ${EPYTHON}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ doman m2r.1
+}
diff --git a/dev-python/m2r/metadata.xml b/dev-python/m2r/metadata.xml
new file mode 100644
index 000000000000..c560383e607f
--- /dev/null
+++ b/dev-python/m2r/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>dolsen@gentoo.org</email>
+ <description>Primary maintainer</description>
+ </maintainer>
+ <upstream>
+ <maintainer>
+ <email>miyako.dev@gmail.com</email>
+ <name>Hiroyuki Takagi</name>
+ </maintainer>
+ <remote-id type="pypi">m2r</remote-id>
+ <remote-id type="github">miyakogi/m2r</remote-id>
+ </upstream>
+ <longdescription>
+ M2R converts a markdown file including reST markups to a valid reST format.
+ </longdescription>
+</pkgmetadata>