-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
861 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
update: all | ||
branch: develop | ||
schedule: "every day" | ||
label_prs: update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.. _orderedlist: | ||
|
||
Ordered List (OListProcessor) | ||
####################################### | ||
|
||
**Processor name:** ``olist`` | ||
|
||
This processor overwrites functionality provided by the Python `Markdown <https://pypi.python.org/pypi/Markdown>`_ package allowing for the use of container tags such as :doc:`panel` and :doc:`boxed-text` tags within an ordered list while also providing the same features of the sane lists extension. | ||
|
||
Indentation is important when creating ordered lists and is expected to be by default ``4`` spaces for inner content and ``2`` spaces after the number. Authors should follow the following example where indentation spaces are replaced with the ``•`` character. | ||
|
||
.. code-block:: none | ||
1.••Text here. | ||
••••More text here. | ||
2.••Text here. | ||
••••1.••List within a list. | ||
••••••••More text here. | ||
Sane Lists | ||
******************************* | ||
|
||
The Sane Lists extension alters the markdown lists such that types are not allowed to mix. This extension is implemented in Verto by default and therefore does not need to be added as an extension. This means the following markdown: | ||
|
||
.. code-block:: none | ||
1. Ordered list item. | ||
* Not a separate item. | ||
produces the output: | ||
|
||
.. code-block:: html | ||
|
||
<ol> | ||
<li> | ||
Ordered list item. | ||
* Not a separate item. | ||
</li> | ||
</ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.. _unorderedlist: | ||
|
||
Unordered List (UListProcessor) | ||
####################################### | ||
|
||
**Processor name:** ``ulist`` | ||
|
||
This processor overwrites functionality provided by the Python `Markdown <https://pypi.python.org/pypi/Markdown>`_ package allowing for the use of container tags such as :doc:`panel` and :doc:`boxed-text` tags within an unordered list while also providing the same features of the sane lists extension. | ||
|
||
Indentation is important when creating unordered lists and is expected to be ``4`` spaces by default for inner content and ``3`` spaces after the bullet. Authors should follow the following example where indentation spaces are replaced with the ``•`` character. | ||
|
||
.. code-block:: none | ||
*•••Text here. | ||
••••More text here. | ||
*•••Text here. | ||
••••*•••List within a list. | ||
••••••••More text here. | ||
See :doc:`orderedlist` for details on Sane Lists. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# flake8: noqa | ||
from .Verto import Verto | ||
|
||
__version__ = '0.5.1' | ||
__version__ = '0.5.2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import markdown | ||
from verto.tests.BaseTest import BaseTest | ||
from verto.VertoExtension import VertoExtension | ||
|
||
class MarkdownOverrideTest(BaseTest): | ||
'''Tests that the overrides for built-in markdown packages | ||
continue to work as normal markdown. | ||
''' | ||
|
||
def __init__(self, *args, **kwargs): | ||
'''Setup asset file directory. | ||
''' | ||
super().__init__(*args, **kwargs) | ||
self.test_type = "markdown-override" | ||
|
||
def read_test_file(self, filename): | ||
'''Returns a string for a given file. | ||
Args: | ||
filename: The filename of the file found in the asset | ||
directory. | ||
Returns: | ||
A string of the given file. | ||
''' | ||
return super().read_test_file(self.test_type, filename, True) | ||
|
||
def setUp(self): | ||
'''Runs before each testcase, creates a verto extensions | ||
and a markdown instance for running tests. | ||
''' | ||
self.verto_extension = VertoExtension([], {}) | ||
|
||
def test_unordered_list_asterisk_tight(self): | ||
'''Check that tight unordered list with asterisks produces expected output. | ||
''' | ||
test_string = self.read_test_file('unordered_list_asterisk_tight.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('unordered_list_asterisk_tight_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) | ||
|
||
def test_unordered_list_asterisk_loose(self): | ||
'''Check that loose unordered list with asterisks produces expected output. | ||
''' | ||
test_string = self.read_test_file('unordered_list_asterisk_loose.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('unordered_list_asterisk_loose_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) | ||
|
||
def test_unordered_list_tight_nested(self): | ||
'''Check that tight unordered list with asterisks produces expected output. | ||
''' | ||
test_string = self.read_test_file('unordered_list_tight_nested.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('unordered_list_tight_nested_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) | ||
|
||
def test_unordered_list_loose_nested(self): | ||
'''Check that loose unordered list with asterisks produces expected output. | ||
''' | ||
test_string = self.read_test_file('unordered_list_loose_nested.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('unordered_list_loose_nested_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) | ||
|
||
def test_unordered_list_mixed_nested(self): | ||
'''Check that loose unordered list with asterisks produces expected output. | ||
''' | ||
test_string = self.read_test_file('unordered_list_mixed_nested.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('unordered_list_mixed_nested_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) | ||
|
||
def test_ordered_list_tight(self): | ||
'''Check that tight ordered list with numbers produces expected output. | ||
''' | ||
test_string = self.read_test_file('ordered_list_tight.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('ordered_list_tight_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) | ||
|
||
def test_ordered_list_loose(self): | ||
'''Check that loose ordered list with numbers produces expected output. | ||
''' | ||
test_string = self.read_test_file('ordered_list_loose.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('ordered_list_loose_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) | ||
|
||
def test_ordered_list_multiple_paragraphs(self): | ||
'''Check that an ordered list with multiple paragraphs produces expected output. | ||
''' | ||
test_string = self.read_test_file('ordered_list_multiple_paragraphs.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('ordered_list_multiple_paragraphs_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) | ||
|
||
def test_ordered_list_tight_nested(self): | ||
'''Check that nested tight ordered list with numbers produces expected output. | ||
''' | ||
test_string = self.read_test_file('ordered_list_tight_nested.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('ordered_list_tight_nested_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) | ||
|
||
def test_sane_list(self): | ||
'''Check that nested tight ordered list with numbers produces expected output. | ||
''' | ||
test_string = self.read_test_file('sane_list.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('sane_list_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) | ||
|
||
def test_sane_list_python_markdown(self): | ||
'''Check that nested tight ordered list with numbers produces expected output. | ||
''' | ||
test_string = self.read_test_file('sane_list_python_markdown.md') | ||
converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension]) | ||
expected_string = self.read_test_file('sane_list_python_markdown_expected.html') | ||
self.assertEqual(expected_string, converted_test_string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Numbered loose: | ||
|
||
1. Lipsum | ||
|
||
2. Lorem | ||
|
||
3. Ipsem |
20 changes: 20 additions & 0 deletions
20
verto/tests/assets/markdown-override/ordered_list_loose_expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<p> | ||
Numbered loose: | ||
</p> | ||
<ol> | ||
<li> | ||
<p> | ||
Lipsum | ||
</p> | ||
</li> | ||
<li> | ||
<p> | ||
Lorem | ||
</p> | ||
</li> | ||
<li> | ||
<p> | ||
Ipsem | ||
</p> | ||
</li> | ||
</ol> |
14 changes: 14 additions & 0 deletions
14
verto/tests/assets/markdown-override/ordered_list_multiple_paragraphs.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus augue non nisi commodo volutpat. | ||
Aliquam erat volutpat. Class aptent. | ||
|
||
2. Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
|
||
Aenean et ligula gravida, tempor massa et, pulvinar tortor. | ||
|
||
3. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vestibulum sollicitudin purus nec auctor. | ||
|
||
Sed sed tortor tempus, ullamcorper lorem in, elementum nisl. Phasellus non nibh ligula. | ||
|
||
Phasellus vestibulum turpis vel tortor semper egestas. Cras eu maximus lorem. | ||
|
||
Curabitur ultrices egestas libero, ut dictum enim porta in. Pellentesque habitant morbi. |
30 changes: 30 additions & 0 deletions
30
verto/tests/assets/markdown-override/ordered_list_multiple_paragraphs_expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<ol> | ||
<li> | ||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus augue non nisi commodo volutpat. | ||
Aliquam erat volutpat. Class aptent. | ||
</p> | ||
</li> | ||
<li> | ||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
<p> | ||
Aenean et ligula gravida, tempor massa et, pulvinar tortor. | ||
</p> | ||
</li> | ||
<li> | ||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vestibulum sollicitudin purus nec auctor. | ||
</p> | ||
<p> | ||
Sed sed tortor tempus, ullamcorper lorem in, elementum nisl. Phasellus non nibh ligula. | ||
</p> | ||
<p> | ||
Phasellus vestibulum turpis vel tortor semper egestas. Cras eu maximus lorem. | ||
</p> | ||
<p> | ||
Curabitur ultrices egestas libero, ut dictum enim porta in. Pellentesque habitant morbi. | ||
</p> | ||
</li> | ||
</ol> |
Oops, something went wrong.