Skip to content

Commit

Permalink
Version 2: Python & Markdown compatibility changes (#5)
Browse files Browse the repository at this point in the history
Core functionality remains the same. Python and Python Markdown versions
are changed. Repository infrastructure changed.

    - Add test/support for Python-Markdown 2.6
    - Drop Support For:
        - Python 2.6 (EOL 2013)
        - Python 3.2 (EOL 2016)
        - Python-Markdown 2.4 (Superceded in 2014)
    - Fix Issue #2 - Setup.py errors; Description.rst missing
    - Replace coveralls with codecov
    - Add repository information such as AUTHORS and HISTORY
    - Update Makefile dist and release for PyPI changes
  • Loading branch information
jambonrose committed Apr 17, 2017
1 parent 0f0d061 commit 933e500
Show file tree
Hide file tree
Showing 18 changed files with 235 additions and 156 deletions.
9 changes: 9 additions & 0 deletions .bumpversion.cfg
@@ -0,0 +1,9 @@
[bumpversion]
current_version = 2.0.0
commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

35 changes: 18 additions & 17 deletions .travis.yml
@@ -1,23 +1,24 @@
branches:
only:
- development
language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "pypy"
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- pypy
cache:
pip: true
env:
- "MD_VERSION=2.4.1"
- "MD_VERSION=2.5.1"
- MD_VERSION=2.5 MD_NEXT=2.6
- MD_VERSION=2.6 MD_NEXT=2.7
install:
- "pip install -q Markdown==$MD_VERSION"
- "pip install ."
- "pip install -r requirements/test_requirements.txt"
- pip install -q "Markdown>=$MD_VERSION,<$MD_NEXT"
- pip install .
- pip install -r requirements/test_requirements.txt
script:
- "nosetests --with-coverage --cover-package=mdx_subscript"
- nosetests --with-coverage --cover-branches --cover-package=mdx_subscript
after_success:
- "coveralls"
matrix:
exclude:
- python: "2.6"
env: "MD_VERSION=2.5.1"
- codecov
13 changes: 13 additions & 0 deletions AUTHORS.rst
@@ -0,0 +1,13 @@
=======
Credits
=======

Development Lead
----------------

* Andrew Pinkham <http://AndrewsForge.com>

Contributors
------------

* Adrian <https://github.com/adi->
40 changes: 0 additions & 40 deletions DESCRIPTION.rst

This file was deleted.

20 changes: 20 additions & 0 deletions HISTORY.rst
@@ -0,0 +1,20 @@
2.0.0 (2017-04-17)
=====
- Add test/support for Python-Markdown 2.6
- Drop Support For:
- Python 2.6 (EOL 2013)
- Python 3.2 (EOL 2016)
- Python-Markdown 2.4 (Superceded in 2014)
- Fix Issue #2 - Setup.py errors; Description.rst missing

1.0.1 (2014-10-17)
=====
- Update for Python-Markdown 2.5

1.0.0 (2014-07-29)
======
- Initial Release of Markdown Subscript Extension
- Compatible with:
- Python-Markdown 2.4
- Python 2.6, 2.7
- Python 3.2, 3.3, 3.4
3 changes: 1 addition & 2 deletions LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2014, Andrew Pinkham
Copyright (c) 2014-2017, Andrew Pinkham
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -21,4 +21,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

6 changes: 6 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,6 @@
include AUTHORS.rst
include README.rst

include LICENSE

recursive-include requirements *.txt
15 changes: 10 additions & 5 deletions Makefile
Expand Up @@ -3,23 +3,28 @@
test:
nosetests --with-coverage --cover-package=mdx_subscript

tox:
tox

description:
rst2html.py DESCRIPTION.rst > description.html
rst2html.py README.rst > readme.html

check:
python setup.py check

dist:
python setup.py sdist --formats=gztar,zip bdist_wheel
python setup.py sdist --formats=gztar bdist_wheel
gpg --armor --detach-sign -u 5878672C -a dist/MarkdownSubscript*.whl
gpg --armor --detach-sign -u 5878672C -a dist/MarkdownSubscript*.tar.gz
gpg --armor --detach-sign -u 5878672C -a dist/MarkdownSubscript*.zip

release:
twine upload dist/*

clean:
rm -rf __pycache__
find . -name "*.pyc" -delete
find . -name "__pycache__" -delete
rm -rf *.egg-info
rm -rf .coverage
rm -rf .tox
rm -rf build
rm -rf dist
rm -rf *.egg-info
69 changes: 0 additions & 69 deletions README.md

This file was deleted.

101 changes: 101 additions & 0 deletions README.rst
@@ -0,0 +1,101 @@
Latest Release: |Version|

Compatibility: |Implementation| |Python| |License|

Tests: |Build| |Coverage| |Requirements|

.. |Version| image:: http://img.shields.io/pypi/v/MarkdownSubscript.svg
:target: https://pypi.python.org/pypi/MarkdownSubscript/
:alt: PyPI Version

.. |Implementation| image:: https://img.shields.io/pypi/implementation/MarkdownSubscript.svg
:target: https://pypi.python.org/pypi/MarkdownSubscript/
:alt: Python Implementation Support

.. |Python| image:: https://img.shields.io/pypi/pyversions/MarkdownSubscript.svg
:target: https://pypi.python.org/pypi/MarkdownSubscript/
:alt: Python Support

.. |License| image:: http://img.shields.io/pypi/l/MarkdownSubscript.svg
:target: http://opensource.org/licenses/BSD-2-Clause
:alt: License

.. |Build| image:: https://travis-ci.org/jambonrose/markdown_subscript_extension.svg?branch=development
:target: https://travis-ci.org/jambonrose/markdown_subscript_extension
:alt: Build Status

.. |Coverage| image:: https://img.shields.io/coveralls/jambonrose/markdown_subscript_extension.svg
:target: https://coveralls.io/r/jambonrose/markdown_subscript_extension
:alt: Coverage Status

.. |Requirements| image:: https://requires.io/github/jambonrose/markdown_subscript_extension/requirements.svg?branch=development
:target: https://requires.io/github/jambonrose/markdown_subscript_extension/requirements/?branch=development
:alt: Requirements Status

=======
Read Me
=======

An extension to the `Python Markdown`_ project which adds the ability to
subscript text. To do so, the character :code:`~` becomes a Markdown tag
for text meant to be subscripted, and is replaced with the HTML
:code:`sub` tag.

For example, given the text: ::

The molecular composition of water is H~2~O.

… using Markdown with this extension will output:

.. code :: html
<p>The molecular composition of water is H<sub>2</sub>O.</p>
This project is provided under the `Simplified (2 Clause) BSD license`_,
provided in full in the LICENSE file.

.. _`Python Markdown`: https://pypi.python.org/pypi/Markdown
.. _`Simplified (2 Clause) BSD license`: http://choosealicense.com/licenses/bsd-2-clause/

Installation
------------

Dependencies:

- Python 2.7, 3.3+

- Markdown 2.5+
(Tested against latest patch version of Markdown 2.5 and 2.6)

To install the latest stable release (recommended):

.. code :: bash
pip install MarkdownSubscript
To install the development version:

.. code :: bash
pip install git+git://github.com/jambonrose/markdown_subscript_extension.git
Basic Usage
-----------

Python
^^^^^^

.. code :: pycon
>>> from markdown import markdown
>>> text = "The molecular composition of water is H~2~O."
>>> markdown(text, ['subscript'])
'<p>The molecular composition of water is H<sub>2</sub>O.</p>'
Command Line
^^^^^^^^^^^^

.. code :: bash
$ echo 'The molecular composition of water is H~2~O.' > text.md
$ python -m markdown -o html5 -x 'subscript' -f text.html text.md
2 changes: 1 addition & 1 deletion mdx_subscript.py
Expand Up @@ -12,7 +12,7 @@
<p>The molecular composition of water is H<sub>2</sub>O.</p>
:website: https://github.com/jambonrose/markdown_subscript_extension
:copyright: Copyright 2014 Andrew Pinkham
:copyright: Copyright 2014-2017 Andrew Pinkham
:license: Simplified BSD, see LICENSE for details.
"""

Expand Down
11 changes: 6 additions & 5 deletions requirements/dev_requirements.txt
@@ -1,5 +1,6 @@
docutils
flake8
pylint
wheel
twine
bumpversion==0.5.3
docutils==0.13.1
flake8==3.3.0
tox==2.7.0
twine==1.8.1
wheel==0.29.0
2 changes: 1 addition & 1 deletion requirements/run_requirements.txt
@@ -1 +1 @@
Markdown>=2.0
Markdown>=2.5,<2.7
6 changes: 3 additions & 3 deletions requirements/test_requirements.txt
@@ -1,3 +1,3 @@
nose
coverage
coveralls
codecov==2.0.5
coverage==4.3.4
nose==1.3.7
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,2 +1,2 @@
[bdist_wheel]
universal=1
universal = 1

0 comments on commit 933e500

Please sign in to comment.