Skip to content

Commit

Permalink
Merge branch 'master' into s3-storage-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
superandrew committed Aug 29, 2018
2 parents 42d51e9 + 60c0589 commit e18ef7e
Show file tree
Hide file tree
Showing 87 changed files with 945 additions and 937 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ env:


matrix: matrix:
exclude: exclude:
- python: "3.4"
env: LINT="yes"
- python: "3.5" - python: "3.5"
env: LINT="yes" env: LINT="yes"
- python: "3.6" - python: "3.6"
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ coverage: ## Generate test coverage report
coverage run --source wiki setup.py test coverage run --source wiki setup.py test
coverage report -m coverage report -m


translation-push: ## Pushes translation sources translation-push: ## Updates and pushes
cd src/wiki && django-admin makemessages -l en
cd ..
tx push -s tx push -s


translation-pull: ## Pulls translation languages translation-pull: ## Pulls translation languages
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The below table explains which Django versions are supported.
+------------------+----------------+--------------+ +------------------+----------------+--------------+
| Release | Django | Upgrade from | | Release | Django | Upgrade from |
+==================+================+==============+ +==================+================+==============+
| 0.4a5 | 1.11, 2.0 | 0.3 | | 0.4b1 | 1.11, 2.0 | 0.3 |
+------------------+----------------+--------------+ +------------------+----------------+--------------+
| 0.3.x | 1.8, 1.9, | 0.2 | | 0.3.x | 1.8, 1.9, | 0.2 |
| | 1.10, 1.11 | | | | 1.10, 1.11 | |
Expand Down
1 change: 0 additions & 1 deletion docs/development/testing.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ fixtures for tests e.g. a root article.
Javascript, and can be tested using the fast WebTest method, rather than Javascript, and can be tested using the fast WebTest method, rather than
relying on the slow and fragile Selenium method. Selenium tests are not run by relying on the slow and fragile Selenium method. Selenium tests are not run by
default. default.

1 change: 0 additions & 1 deletion docs/development/testproject.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ an sqlite database. Login for django admin is ``admin:admin``. This
project should always be maintained, but please do not commit changes to project should always be maintained, but please do not commit changes to
the SQLite database as we only care about its contents in case data the SQLite database as we only care about its contents in case data
models are changed. models are changed.

1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ Indices and tables
* :ref:`genindex` * :ref:`genindex`
* :ref:`modindex` * :ref:`modindex`
* :ref:`search` * :ref:`search`

5 changes: 4 additions & 1 deletion docs/release_notes.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The next series **0.4** will support Django 1.11 and Django 2.x and be for
Python 3.4+. Python 3.4+.




django-wiki 0.4a5 django-wiki 0.4b1
----------------- -----------------


Added Added
Expand All @@ -21,6 +21,7 @@ Added
* Django 2 support :url-issue:`755` (Raffaele Salmaso & Mads Jensen) * Django 2 support :url-issue:`755` (Raffaele Salmaso & Mads Jensen)
* Added ``wiki.sites.WikiSite`` for easy customization :url-issue:`827` * Added ``wiki.sites.WikiSite`` for easy customization :url-issue:`827`
* Automatic link highlighting of URLs handles lots of new patterns :url-issue:`816` (Branko Majic) * Automatic link highlighting of URLs handles lots of new patterns :url-issue:`816` (Branko Majic)
* Red links: Internal links turn red and link to Create Page (Mathias Rav) :url-issue:`889`


Changed Changed
~~~~~~~ ~~~~~~~
Expand All @@ -35,6 +36,7 @@ Changed
* Big cleanup: Deprecating lots of Python 2.7 specific code (Mads Jensen & Raffaele Salmaso) `See: >30 PRs <https://github.com/django-wiki/django-wiki/pulls?q=is%3Apr+is%3Aclosed+label%3Aclean-up>`__ * Big cleanup: Deprecating lots of Python 2.7 specific code (Mads Jensen & Raffaele Salmaso) `See: >30 PRs <https://github.com/django-wiki/django-wiki/pulls?q=is%3Apr+is%3Aclosed+label%3Aclean-up>`__
* Languages: Merged ``pt`` and ``pt_PT``, then deleted ``pt`` and linked it to ``pt_PT`` :url-issue:`858` * Languages: Merged ``pt`` and ``pt_PT``, then deleted ``pt`` and linked it to ``pt_PT`` :url-issue:`858`
* Languages: Linked ``zh_Hans`` to ``zh_CN`` :url-issue:`711` * Languages: Linked ``zh_Hans`` to ``zh_CN`` :url-issue:`711`
* Languages: ``da`` translated 100%


Fixed Fixed
~~~~~ ~~~~~
Expand All @@ -43,6 +45,7 @@ Fixed
* Use ``simple_tag`` for assignment tag :url-issue:`791` (Raffaele Salmaso) * Use ``simple_tag`` for assignment tag :url-issue:`791` (Raffaele Salmaso)
* Direct invocation of ``pytest`` fixed (removing ``runtests.py``) :url-issue:`781` (Branko Majic) * Direct invocation of ``pytest`` fixed (removing ``runtests.py``) :url-issue:`781` (Branko Majic)
* Line breaks in help texts for macros :url-issue:`851` (Mathias Dannesbo) * Line breaks in help texts for macros :url-issue:`851` (Mathias Dannesbo)
* Table of contents now has a header by default, and several built-in django-wiki extensions can be configured using ``WIKI_MARKDOWN_KWARGS`` :url-issue:`881` (Mathias Rav)


Deprecated/Removed Deprecated/Removed
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 0 additions & 1 deletion docs/settings.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ Plugin macros


.. automodule:: wiki.plugins.macros.settings .. automodule:: wiki.plugins.macros.settings
:members: :members:

7 changes: 5 additions & 2 deletions setup.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_path(fname):
"Django>=1.11,<2.1", "Django>=1.11,<2.1",
"bleach>=2.1,<2.2", "bleach>=2.1,<2.2",
"Pillow", "Pillow",
"django-nyt>=1.1b1,<1.2", "django-nyt>=1.1.1,<1.2",
"django-mptt>=0.9,<0.10", "django-mptt>=0.9,<0.10",
"django-sekizai>=0.10", "django-sekizai>=0.10",
"sorl-thumbnail>=12,<13", "sorl-thumbnail>=12,<13",
Expand All @@ -44,13 +44,16 @@ def get_path(fname):


test_lint_requirements = [ test_lint_requirements = [
'flake8>=3.5,<3.6', 'flake8>=3.5,<3.6',
'flake8-isort',
] ]


setup_requirements = [ setup_requirements = [
'pytest-runner', 'pytest-runner',
] ]


development_requirements = test_requirements + test_lint_requirements development_requirements = test_requirements + test_lint_requirements + [
'pre-commit',
]


extras_requirements = { extras_requirements = {
'devel': development_requirements, 'devel': development_requirements,
Expand Down
3 changes: 1 addition & 2 deletions src/wiki/__init__.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@


from wiki.core.version import get_version from wiki.core.version import get_version



default_app_config = 'wiki.apps.WikiConfig' default_app_config = 'wiki.apps.WikiConfig'


VERSION = (0, 4, 0, 'alpha', 5) VERSION = (0, 4, 0, 'beta', 1)
__version__ = get_version(VERSION) __version__ = get_version(VERSION)
30 changes: 22 additions & 8 deletions src/wiki/conf/settings.py
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,4 @@
import bleach import bleach
from django.apps import apps
from django.conf import settings as django_settings from django.conf import settings as django_settings
from django.contrib.messages import constants as messages from django.contrib.messages import constants as messages
from django.core.files.storage import default_storage from django.core.files.storage import default_storage
Expand All @@ -26,13 +25,28 @@
'WIKI_MARKDOWN_SANITIZE_HTML', 'WIKI_MARKDOWN_SANITIZE_HTML',
True) True)


#: Arguments for the Markdown instance, for instance a list of extensions to #: Arguments for the Markdown instance, as a dictionary. The "extensions" key
#: use. #: should be a list of extra extensions to use besides the built-in django-wiki
#: See: https://pythonhosted.org/Markdown/extensions/index.html #: extensions, and the "extension_configs" should be a dictionary, specifying
#: the keyword-arguments to pass to each extension.
#: #:
#: To set a custom title for TOC's:: #: For a list of extensions officially supported by Python-Markdown, see:
#: https://python-markdown.github.io/extensions/
#: #:
#: WIKI_MARKDOWN_KWARGS = {'extension_configs': {'toc': _('Contents of this article')}} #: To set a custom title for table of contents, specify the following in your
#: Django project settings::
#:
#: WIKI_MARKDOWN_KWARGS = {
#: 'extension_configs': {
#: 'wiki.plugins.macros.mdx.toc': {'title': 'Contents of this article'},
#: },
#: }
#:
#: Besides the extensions enabled by the "extensions" key, the following
#: built-in django-wiki extensions can be configured with "extension_configs":
#: "wiki.core.markdown.mdx.codehilite", "wiki.core.markdown.mdx.previewlinks",
#: "wiki.core.markdown.mdx.responsivetable", "wiki.plugins.macros.mdx.macro",
#: "wiki.plugins.macros.mdx.toc", "wiki.plugins.macros.mdx.wikilinks".
MARKDOWN_KWARGS = { MARKDOWN_KWARGS = {
'extensions': [ 'extensions': [
'markdown.extensions.footnotes', 'markdown.extensions.footnotes',
Expand All @@ -46,8 +60,8 @@
'markdown.extensions.sane_lists', 'markdown.extensions.sane_lists',
], ],
'extension_configs': { 'extension_configs': {
'toc': { 'wiki.plugins.macros.mdx.toc': {'title': _('Contents')},
'title': _('Table of Contents')}}, },
} }
MARKDOWN_KWARGS.update(getattr(django_settings, 'WIKI_MARKDOWN_KWARGS', {})) MARKDOWN_KWARGS.update(getattr(django_settings, 'WIKI_MARKDOWN_KWARGS', {}))


Expand Down
9 changes: 3 additions & 6 deletions src/wiki/core/markdown/__init__.py
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,6 @@
import bleach import bleach
import markdown import markdown
from wiki.conf import settings from wiki.conf import settings
from wiki.core.markdown.mdx.codehilite import WikiCodeHiliteExtension
from wiki.core.markdown.mdx.previewlinks import PreviewLinksExtension
from wiki.core.markdown.mdx.responsivetable import ResponsiveTableExtension
from wiki.core.plugins import registry as plugin_registry from wiki.core.plugins import registry as plugin_registry




Expand All @@ -20,9 +17,9 @@ def __init__(self, article, preview=False, user=None, *args, **kwargs):
def core_extensions(self): def core_extensions(self):
"""List of core extensions found in the mdx folder""" """List of core extensions found in the mdx folder"""
return [ return [
PreviewLinksExtension(), 'wiki.core.markdown.mdx.codehilite',
ResponsiveTableExtension(), 'wiki.core.markdown.mdx.previewlinks',
WikiCodeHiliteExtension(), 'wiki.core.markdown.mdx.responsivetable',
] ]


def get_markdown_extensions(self): def get_markdown_extensions(self):
Expand Down
5 changes: 5 additions & 0 deletions src/wiki/core/markdown/mdx/codehilite.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -117,3 +117,8 @@ def extendMarkdown(self, md, md_globals):
">normalize_whitespace") ">normalize_whitespace")


md.registerExtension(self) md.registerExtension(self)


def makeExtension(*args, **kwargs):
"""Return an instance of the extension."""
return WikiCodeHiliteExtension(*args, **kwargs)
5 changes: 5 additions & 0 deletions src/wiki/core/markdown/mdx/previewlinks.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ def run(self, root):
if not a.get('href').startswith('#'): if not a.get('href').startswith('#'):
a.set('target', '_blank') a.set('target', '_blank')
return root return root


def makeExtension(*args, **kwargs):
"""Return an instance of the extension."""
return PreviewLinksExtension(*args, **kwargs)
5 changes: 5 additions & 0 deletions src/wiki/core/markdown/mdx/responsivetable.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ def move_children(self, element1, element2):
def convert_to_wrapper(self, element): def convert_to_wrapper(self, element):
element.tag = 'div' element.tag = 'div'
element.set('class', 'table-responsive') element.set('class', 'table-responsive')


def makeExtension(*args, **kwargs):
"""Return an instance of the extension."""
return ResponsiveTableExtension(*args, **kwargs)
Binary file modified src/wiki/locale/cs/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified src/wiki/locale/da/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified src/wiki/locale/de/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified src/wiki/locale/en/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit e18ef7e

Please sign in to comment.