Skip to content
This repository has been archived by the owner on May 10, 2020. It is now read-only.

Commit

Permalink
Rename package to zmarkdown (#132)
Browse files Browse the repository at this point in the history
* Rename package to zmarkdown

* Fix flake8
  • Loading branch information
cgabard authored Mar 4, 2017
1 parent 05996db commit a1481fb
Show file tree
Hide file tree
Showing 48 changed files with 340 additions and 386 deletions.
5 changes: 2 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Installing Python-Markdown
Installing ZMArkdown
==========================

As an Admin/Root user on your system do:

pip install markdown
pip install zmarkdown

Or for more specific instructions, view the documentation in `docs/install.txt`
or on the website at <https://pythonhosted.org/Markdown/install.html>.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
recursive-include bin *
recursive-include markdown *.py
recursive-include zmarkdown *.py
recursive-include docs *
recursive-include tests *.txt *.html *.cfg *.py
include setup.py
Expand Down
12 changes: 6 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ clean:
rm -f MANIFEST
rm -f test-output.html
rm -f *.pyc
rm -f markdown/*.pyc
rm -f markdown/extensions/*.pyc
rm -f zmarkdown/*.pyc
rm -f zmarkdown/extensions/*.pyc
rm -f *.bak
rm -f markdown/*.bak
rm -f markdown/extensions/*.bak
rm -f zmarkdown/*.bak
rm -f zmarkdown/extensions/*.bak
rm -f *.swp
rm -f markdown/*.swp
rm -f markdown/extensions/*.swp
rm -f zmarkdown/*.swp
rm -f zmarkdown/extensions/*.swp
rm -rf build
rm -rf dist
rm -rf tmp
Expand Down
35 changes: 8 additions & 27 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def get_version():
" Get version & version_info without importing markdown.__init__ "
path = os.path.join(os.path.dirname(__file__), 'markdown')
path = os.path.join(os.path.dirname(__file__), 'zmarkdown')
fp, pathname, desc = imp.find_module('__version__', [path])
try:
v = imp.load_module('__version__', fp, pathname, desc)
Expand All @@ -25,7 +25,6 @@ def get_version():
'beta': '4 - Beta',
'rc': '4 - Beta',
'final': '5 - Production/Stable',
'zds': '5 - Production/Stable'
}

if version_info[3] == 'alpha' and version_info[4] == 0:
Expand All @@ -34,38 +33,20 @@ def get_version():
DEVSTATUS = dev_status_map[version_info[3]]

long_description = '''
This is a Python implementation of John Gruber's Markdown_.
It is almost completely compliant with the reference implementation,
though there are a few known issues. See Features_ for information
on what exactly is supported and what is not. Additional features are
supported by the `Available Extensions`_.
.. _Markdown: http://daringfireball.net/projects/markdown/
.. _Features: https://pythonhosted.org/Markdown/index.html#Features
.. _`Available Extensions`: https://pythonhosted.org/Markdown/extensions/index.html
Support
=======
You may ask for help and discuss various other issues on the
`mailing list`_ and report bugs on the `bug tracker`_.
.. _`mailing list`: http://lists.sourceforge.net/lists/listinfo/python-markdown-discuss
.. _`bug tracker`: http://github.com/waylan/Python-Markdown/issues
Small fork of Python-Markdown suitable for zestedesavoir.com needs
'''

setup(name='Markdown',
version=version,
url='https://pythonhosted.org/Markdown/',
download_url='http://pypi.python.org/packages/source/M/Markdown/Markdown-%s.tar.gz' % version,
url='https://github.com/zestedesavoir/Python-ZMarkdown',
description='Python implementation of Markdown.',
long_description=long_description,
author='Manfred Stienstra, Yuri takhteyev and Waylan limberg',
author_email='waylan.limberg [at] icloud.com',
maintainer='Waylan Limberg',
maintainer_email='waylan.limberg [at] icloud.com',
author='Manfred Stienstra, Yuri takhteyev, Waylan limberg and zeste de savoir members',
author_email='christophe.gabard [at] gmail.com',
maintainer='Christophe Gabard',
maintainer_email='christophe.gabard [at] gmail.com',
license='BSD License',
packages=['markdown', 'markdown.extensions'],
packages=['zmarkdown', 'zmarkdown.extensions'],
classifiers=['Development Status :: %s' % DEVSTATUS,
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
Expand Down
14 changes: 7 additions & 7 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import markdown
import zmarkdown
import codecs
import difflib
try:
Expand All @@ -11,7 +11,7 @@
e.args = (msg,) + e.args[1:]
raise

from .plugins import Markdown, MarkdownSyntaxError
from .plugins import ZMarkdown, ZMarkdownSyntaxError
try:
import tidylib
except ImportError:
Expand Down Expand Up @@ -112,7 +112,7 @@ def __call__(self, file, config):
# Normalize line endings
# (on windows, git may have altered line endings).
expected_output = f.read().replace("\r\n", "\n")
output = markdown.markdown(input, **config.get_args(file))
output = zmarkdown.zmarkdown(input, **config.get_args(file))
expected_output = expected_output.strip()
output = output.strip()
if tidylib and config.get(cfg_section, 'normalize'):
Expand All @@ -133,7 +133,7 @@ def __call__(self, file, config):
lineterm="\n"
)]
if diff:
raise MarkdownSyntaxError(
raise ZMarkdownSyntaxError(
'Output from "%s" failed to match expected '
'output.\n\n%s' % (input_file, ''.join(diff))
)
Expand Down Expand Up @@ -165,8 +165,8 @@ def generate(file, config):
if not os.path.isfile(output_file) or \
os.path.getmtime(output_file) < os.path.getmtime(input_file):
print('Generating:', file)
markdown.markdownFromFile(input=input_file, output=output_file,
encoding='utf-8', **config.get_args(file))
zmarkdown.zmarkdownFromFile(input=input_file, output=output_file,
encoding='utf-8', **config.get_args(file))
else:
print('Already up-to-date:', file)

Expand All @@ -184,4 +184,4 @@ def generate_all():


def run():
nose.main(addplugins=[Markdown()])
nose.main(addplugins=[ZMarkdown()])
12 changes: 6 additions & 6 deletions tests/extensions/extra/test.cfg
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
DEFAULT:
extensions:
- markdown.extensions.footnotes
- zmarkdown.extensions.footnotes

abbr:
extensions:
- markdown.extensions.abbr
- zmarkdown.extensions.abbr

footnotes:
extensions:
- markdown.extensions.footnotes
- zmarkdown.extensions.footnotes

tables:
extensions:
- markdown.extensions.tables
- zmarkdown.extensions.tables

extra_config:
extensions:
- markdown.extensions.footnotes
- zmarkdown.extensions.footnotes
extension_configs:
markdown.extensions.footnotes:
zmarkdown.extensions.footnotes:
PLACE_MARKER: ~~~placemarker~~~
unique_prefix: zds
6 changes: 3 additions & 3 deletions tests/extensions/test.cfg
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
codehilite:
extensions:
- markdown.extensions.codehilite
- zmarkdown.extensions.codehilite
# This passes or not based on version of pygments.
skip: True

fenced_code:
extensions:
- markdown.extensions.fenced_code
- zmarkdown.extensions.fenced_code

github_flavored:
extensions:
- markdown.extensions.fenced_code
- zmarkdown.extensions.fenced_code
8 changes: 4 additions & 4 deletions tests/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
import six


class MarkdownSyntaxError(Exception):
class ZMarkdownSyntaxError(Exception):
pass


class Markdown(ErrorClassPlugin):
class ZMarkdown(ErrorClassPlugin):
""" Add MarkdownSyntaxError and ensure proper formatting. """
mdsyntax = ErrorClass(
MarkdownSyntaxError,
label='MarkdownSyntaxError',
ZMarkdownSyntaxError,
label='ZMarkdownSyntaxError',
isfailure=True
)
enabled = True
Expand Down
Loading

0 comments on commit a1481fb

Please sign in to comment.