Compare commits

..

No commits in common. "master" and "0.83" have entirely different histories.
master ... 0.83

8 changed files with 31 additions and 67 deletions

View File

@ -9,30 +9,30 @@ steps:
# Auto build to pypi test
- name: deploy-test
image: registry.gitlab.com/olymk2/drone-pypi
pull: true
image: olymk2/drone-pypi
settings:
PYPI_USERNAME:
from_secret: PYPI_TEST_USERNAME
PYPI_PASSWORD:
from_secret: PYPI_TEST_PASSWORD
PYPI_REPOSITORY:
from_secret: PYPI_TEST_REPOSITORY
commands:
- env
- echo "__version__=$(date +'%y%m%d.%H%M')" > ./eorg/version.py
- python3 /bin/upload
environment:
PYPI_USERNAME:
from_secret: PYPI_TEST_USERNAME
PYPI_PASSWORD:
from_secret: PYPI_TEST_PASSWORD
PYPI_REPOSITORY:
from_secret: PYPI_TEST_REPOSITORY
commands:
- env
- echo "__version__=$(date +'%y%m%d.%H%M')" > elcato/version.py
- name: deploy
image: registry.gitlab.com/olymk2/drone-pypi
pull: true
image: olymk2/drone-pypi
settings:
PYPI_USERNAME:
from_secret: PYPI_LIVE_USERNAME
PYPI_PASSWORD:
from_secret: PYPI_LIVE_PASSWORD
PYPI_REPOSITORY:
from_secret: PYPI_LIVE_REPOSITORY
environment:
PYPI_USERNAME:
from_secret: PYPI_LIVE_USERNAME
PYPI_PASSWORD:
from_secret: PYPI_LIVE_PASSWORD
PYPI_REPOSITORY:
from_secret: PYPI_LIVE_REPOSITORY
commands:
- env
- echo "__version__=${DRONE_TAG}"

View File

@ -40,10 +40,10 @@ t_NAME = r"^\#\+NAME:"
# t_IMG = r"^\[\[(\w|\.|-|_|/)+\]\]$"
t_IMG = r"^\[\["
t_IMG_END = r"\]\]"
t_RESULTS_END = r"^\s*$"
t_RESULTS_END = r"^\:..*"
t_END_LABELS = r"^(?!\[|\#).*"
t_BULLET_START = r"^\s*[\+|\-|0-9\.]"
t_BULLET_END = r"^(?!\s*[\+|\-|0-9\.]).*$"
t_BULLET_END = r"^\s*(?![\+|\-|0-9]).*$"
t_HEADER = r"^\*+"
t_META_OTHER = r"^[#]\+[A-Z\_]+\:"

View File

@ -156,9 +156,7 @@ def handle_token(doc, item, root=False):
def html(doc):
response = StringIO()
response.write('<div class="org-body">')
for item in doc:
response.write(handle_token(doc, item, True))
response.write('</div>')
response.seek(0)
return response

View File

@ -1 +1 @@
__version__=0.85
__version__=0.83

View File

@ -32,17 +32,3 @@ def test_block_settings():
assert result[1].value == expected[1].value
assert result[1].attrs == expected[1].attrs
#assert result == expected
def test_export_settings():
document = StringIO("""
#+TITLE: Tests
#+BEGIN_SRC shell :exports results
elcato create --path=/tmp/myblog
#+END_SRC
#+RESULTS:
result block here
""")
result = parse(document).doc
assert result[2].attrs.get('exports') == ['results']

View File

@ -201,28 +201,10 @@ def test_bullet_block():
assert result[1].token == tokens.BULLET
assert result[1].value == expected[1].value
text = StringIO(
"""
- Bullet 1
- Bullet 2
-Bullet 3"""
)
expected = [
Token(tokens.BLANK, ""),
Token(tokens.BULLET, """- Bullet 1\n- Bullet 2\n -Bullet 3\n"""),
]
result = parse(text).doc
assert result[0].token == tokens.BLANK
assert result[0].value == expected[0].value
assert result[1].token == tokens.BULLET
assert result[1].value == expected[1].value
@pytest.mark.skip
def test_src_block_images():
text = StringIO(
"""
text = StringIO("""
#+BEGIN_SRC latex :exports results :file test.png :results raw file
\begin{equation}
x=\sqrt{b}
@ -231,14 +213,12 @@ x=\sqrt{b}
#+RESULTS:
[[file:test.png]]
"""
)
""")
expected = [
Token(tokens.BLANK, ""),
Token(
tokens.SOURCE, """\begin{equation}\nx=\sqrt{b}\n\end{equation}"""
),
Token(tokens.SOURCE, """\begin{equation}\nx=\sqrt{b}\n\end{equation}"""),
Token(tokens.BLANK, ""),
]
result = parse(text).doc
assert result[0].token == tokens.BLANK

View File

@ -24,7 +24,7 @@ def test_html_output():
print(htmlbody)
assert (
htmlbody
== """<div class="org-body"><h2> Header 1</h2>
== """<h2> Header 1</h2>
<h3> Sub Header 1</h3>
<p class="flow-text">body <code>text</code>
over multiple <b>lines</b>
@ -34,5 +34,5 @@ def test_html_output():
</pre></div>
</td></tr></table><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="p">(</span><span class="nv">test</span> <span class="nv">code</span><span class="p">)</span>
</pre></div>
</td></tr></table></div>"""
</td></tr></table>"""
)

View File

@ -7,7 +7,7 @@ from eorg.generate import html
def test_bullet_block():
expected = """<div class="org-body"><ul class="browser-default"><li class="collection-item">Bullet 1</li><li class="collection-item">Bullet 2</li></ul></div>"""
expected = """<ul class="browser-default"><li class="collection-item">Bullet 1</li><li class="collection-item">Bullet 2</li></ul>"""
result = html(parse(snippets.bullet_plus_snippet).doc)
assert result.read() == expected
@ -33,4 +33,4 @@ def test_render_results():
assert tags[1].value[1].value == expected[1].value
htmlbody = html(tags).read()
assert htmlbody == '<div class="org-body"><img style="margin:auto;" src="test.png" alt="" /></div>'
assert htmlbody == '<img style="margin:auto;" src="test.png" alt="" />'