Commits

Julian Brost  committed cb16a89 Merge

merged

  • Participants
  • Parent commits 0089580, d068e34

Comments (0)

Files changed (16)

File MoinMoin/apps/feed/views.py

 from flask import request, Response
 from flask import current_app as app
 from flask import g as flaskg
+from flask import url_for
 
 from werkzeug.contrib.atom import AtomFeed
+from jinja2 import Markup
 
 from whoosh.query import Term, And
 
 from MoinMoin.config import (NAME, NAME_EXACT, WIKINAME, ACL, ACTION, ADDRESS,
                             HOSTNAME, USERID, COMMENT, MTIME, REVID, ALL_REVS,
                             PARENTID, LATEST_REVS)
-from MoinMoin.themes import get_editor_info
+from MoinMoin.themes import get_editor_info, render_template
 from MoinMoin.items import Item
 from MoinMoin.util.crypto import cache_key
 from MoinMoin.util.interwiki import url_for_item
 @feed.route('/atom/<itemname:item_name>')
 @feed.route('/atom', defaults=dict(item_name=''))
 def atom(item_name):
-    # maybe we need different modes:
-    # - diffs in html don't look great without stylesheet
-    # - full item in html is nice
-    # - diffs in textmode are OK, but look very simple
-    # - full-item content in textmode is OK, but looks very simple
+    # Currently atom feeds behave in the fol. way
+    # - Text diffs are shown in a side-by-side fashion
+    # - The current binary item is fully rendered in the feed
+    # - Image(binary)'s diff is shown using PIL
+    # - First item is always rendered fully
+    # - Revision meta(id, size and comment) is shown for parent and current revision
     query = Term(WIKINAME, app.cfg.interwikiname)
     if item_name:
         query = And([query, Term(NAME_EXACT, item_name), ])
         content = None
         cid = None
     if content is None:
-        title = app.cfg.sitename
+        if not item_name:
+            title = u"{0}".format(app.cfg.sitename)
+        else:
+            title = u"{0} - {1}".format(app.cfg.sitename, item_name)
         feed = AtomFeed(title=title, feed_url=request.url, url=request.host_url)
         query = Term(WIKINAME, app.cfg.interwikiname)
         if item_name:
             try:
                 hl_item = Item.create(name, rev_id=this_revid)
                 if previous_revid is not None:
-                    # simple text diff for changes
+                    # HTML diff for subsequent revisions
                     previous_rev = item[previous_revid]
-                    content = hl_item._render_data_diff_text(previous_rev.data, this_rev.data)
-                    content = '<div><pre>{0}</pre></div>'.format(content)
+                    content = hl_item._render_data_diff_atom(previous_rev, this_rev)
                 else:
                     # full html rendering for new items
-                    content = hl_item._render_data()
-                content_type = 'xhtml'
+                    content = render_template('atom.html', get='first_revision', rev=this_rev, content=Markup(hl_item._render_data()), revision=this_revid)
+                content_type = 'html'
             except Exception as e:
                 logging.exception("content rendering crashed")
                 content = _(u'MoinMoin feels unhappy.')
                 content_type = 'text'
-            feed.add(title=name, title_type='text',
-                     summary=rev.meta.get(COMMENT, ''), summary_type='text',
-                     content=content, content_type=content_type,
-                     author=get_editor_info(rev.meta, external=True),
+            author = get_editor_info(rev.meta, external=True)
+            rev_comment = rev.meta.get(COMMENT, '')
+            if rev_comment:
+                # Trim down extremely long revision comment
+                if len(rev_comment) > 80:
+                    content = render_template('atom.html', get='comment_cont_merge', comment=rev_comment[79:], content=Markup(content))
+                    rev_comment = u"{0}...".format(rev_comment[:79])
+                feed_title = u"{0} - {1}".format(author.get(NAME, ''), rev_comment)
+            else:
+                feed_title = u"{0}".format(author.get(NAME, ''))
+            if not item_name:
+                feed_title = u"{0} - {1}".format(name, feed_title)
+            feed.add(title=feed_title, title_type='text',
+                     summary=content, summary_type=content_type,
+                     author=author,
                      url=url_for_item(name, rev=this_revid, _external=True),
                      updated=datetime.fromtimestamp(rev.meta[MTIME]),
                     )
         content = feed.to_string()
+        # Hack to add XSLT stylesheet declaration since AtomFeed doesn't allow this
+        content = content.split("\n")
+        content.insert(1, render_template('atom.html', get='xml'))
+        content = "\n".join(content)
         if cid is not None:
             app.cache.set(cid, content)
     return Response(content, content_type='application/atom+xml')

File MoinMoin/apps/frontend/views.py

         TextCha(form).amend_form()
         if form.validate():
             comment = form['comment'].value
-            item.delete(comment)
+            try:
+                item.delete(comment)
+            except AccessDenied:
+                abort(403)
             return redirect(url_for_item(item_name))
     return render_template(item.delete_template,
                            item=item, item_name=item_name,
         TextCha(form).amend_form()
         if form.validate():
             comment = form['comment'].value
-            item.destroy(comment=comment, destroy_item=destroy_item)
+            try:
+                item.destroy(comment=comment, destroy_item=destroy_item)
+            except AccessDenied:
+                abort(403)
             return redirect(url_for_item(item_name))
     return render_template(item.destroy_template,
                            item=item, item_name=item_name,
     rev_ids = [CURRENT]  # XXX TODO we need a reverse sorted list
     return render_template(item.diff_template,
                            item=item, item_name=item.name,
+                           diff_html=Markup(item._render_data_diff(oldrev, newrev)),
                            rev=item.rev,
                            first_rev_id=rev_ids[0],
                            last_rev_id=rev_ids[-1],

File MoinMoin/items/__init__.py

     _render_data_diff_text = _render_data_diff
     _render_data_diff_raw = _render_data_diff
 
+    def _render_data_diff_atom(self, oldrev, newrev):
+        return render_template('atom.html',
+                               oldrev=oldrev, newrev=newrev, get='binary',
+                               content=Markup(self._render_data()))
+
     def _convert(self, doc):
         return _("Impossible to convert the data to the contenttype: %(contenttype)s",
                  contenttype=request.values.get('contenttype'))
         else:
             return self._do_get(hash, force_attachment=force_attachment, mimetype=mimetype)
 
+    def _render_data_diff_atom(self, oldrev, newrev):
+        if PIL is None:
+            # no PIL, we can't do anything, we just call the base class method
+            return super(TransformableBitmapImage, self)._render_data_diff_atom(oldrev, newrev)
+        url = url_for('frontend.diffraw', _external=True, item_name=self.name, rev1=oldrev.revid, rev2=newrev.revid)
+        return render_template('atom.html',
+                               oldrev=oldrev, newrev=newrev, get='binary',
+                               content=Markup('<img src="{0}" />'.format(escape(url))))
+
     def _render_data_diff(self, oldrev, newrev):
         if PIL is None:
             # no PIL, we can't do anything, we just call the base class method
         """ convert data from storage format to memory format """
         return data.decode(config.charset).replace(u'\r\n', u'\n')
 
-    def _render_data_diff(self, oldrev, newrev):
+    def _get_data_diff_html(self, oldrev, newrev, template):
         from MoinMoin.util.diff_html import diff
         old_text = self.data_storage_to_internal(oldrev.data.read())
         new_text = self.data_storage_to_internal(newrev.data.read())
         storage_item = flaskg.storage[self.name]
         diffs = [(d[0], Markup(d[1]), d[2], Markup(d[3])) for d in diff(old_text, new_text)]
-        return Markup(render_template('diff_text.html',
-                                      item_name=self.name,
-                                      oldrev=oldrev,
-                                      newrev=newrev,
-                                      diffs=diffs,
-                                     ))
+        return render_template(template,
+                               item_name=self.name,
+                               oldrev=oldrev,
+                               newrev=newrev,
+                               diffs=diffs,
+                               )
+
+    def _render_data_diff_atom(self, oldrev, newrev):
+        """ renders diff in HTML for atom feed """
+        return self._get_data_diff_html(oldrev, newrev, 'diff_text_atom.html')
+
+    def _render_data_diff(self, oldrev, newrev):
+        return self._get_data_diff_html(oldrev, newrev, 'diff_text.html')
 
     def _render_data_diff_text(self, oldrev, newrev):
         from MoinMoin.util import diff_text
         # TODO: this could be a converter -> dom, then transcluding this kind
         # of items and also rendering them with the code in base class could work
         item_name = self.name
-        drawing_url = url_for('frontend.get_item', item_name=item_name, member='drawing.draw')
-        png_url = url_for('frontend.get_item', item_name=item_name, member='drawing.png')
+        drawing_url = url_for('frontend.get_item', item_name=item_name, member='drawing.draw', rev=self.rev.revid)
+        png_url = url_for('frontend.get_item', item_name=item_name, member='drawing.png', rev=self.rev.revid)
         title = _('Edit drawing %(filename)s (opens in new window)', filename=item_name)
 
         mapfile = self.get_member('drawing.map')
         # TODO: this could be a converter -> dom, then transcluding this kind
         # of items and also rendering them with the code in base class could work
         item_name = self.name
-        drawing_url = url_for('frontend.get_item', item_name=item_name, member='drawing.svg')
-        png_url = url_for('frontend.get_item', item_name=item_name, member='drawing.png')
+        drawing_url = url_for('frontend.get_item', item_name=item_name, member='drawing.svg', rev=self.rev.revid)
+        png_url = url_for('frontend.get_item', item_name=item_name, member='drawing.png', rev=self.rev.revid)
         title = _('Edit drawing %(filename)s (opens in new window)', filename=self.name)
 
         mapfile = self.get_member('drawing.map')
         # TODO: this could be a converter -> dom, then transcluding this kind
         # of items and also rendering them with the code in base class could work
         item_name = self.name
-        drawing_url = url_for('frontend.get_item', item_name=item_name, member='drawing.svg')
-        png_url = url_for('frontend.get_item', item_name=item_name, member='drawing.png')
+        drawing_url = url_for('frontend.get_item', item_name=item_name, member='drawing.svg', rev=self.rev.revid)
+        png_url = url_for('frontend.get_item', item_name=item_name, member='drawing.png', rev=self.rev.revid)
         return Markup('<img src="{0}" alt="{1}" />'.format(png_url, drawing_url))
 
 item_registry.register(SvgDraw._factory, Type('application/x-svgdraw'))

File MoinMoin/items/_tests/test_Item.py

 
 from flask import g as flaskg
 
+from werkzeug import escape
+
+from MoinMoin.util import diff_html
+
 from MoinMoin._tests import become_trusted, update_item
 from MoinMoin.items import Item, ApplicationXTar, NonExistent, Binary, Text, Image, TransformableBitmapImage, MarkupItem
 from MoinMoin.config import CONTENTTYPE, ADDRESS, COMMENT, HOSTNAME, USERID, ACTION
         item1 = Binary.create(item_name)
         try:
             from PIL import Image as PILImage
-            result = TransformableBitmapImage._render_data_diff(item1, item.rev, item1.rev)
+            result = Markup(TransformableBitmapImage._render_data_diff(item1, item.rev, item1.rev))
             # On Werkzeug 0.8.2+, urls with '+' are automatically encoded to '%2B'
             # The assert statement works with both older and newer versions of Werkzeug
             # Probably not an intentional change on the werkzeug side, see issue:
         expected = test_text
         assert result == expected
 
+    def test__render_data_diff(self):
+        item_name = u'Html_Item'
+        empty_html = u'<span></span>'
+        html = u'<span>\ud55c</span>'
+        meta = {CONTENTTYPE: u'text/html;charset=utf-8'}
+        item = Text.create(item_name)
+        item._save(meta, empty_html)
+        item = Text.create(item_name)
+        # Unicode test, html escaping
+        rev1 = update_item(item_name, meta, html)
+        rev2 = update_item(item_name, {}, u'     ')
+        result = Text._render_data_diff(item, rev1, rev2)
+        assert escape(html) in result
+        # Unicode test, whitespace
+        rev1 = update_item(item_name, {}, u'\n\n')
+        rev2 = update_item(item_name, {}, u'\n     \n')
+        result = Text._render_data_diff(item, rev1, rev2)
+        assert '<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>' in result
+        # If fairly similar diffs are correctly spanned or not, also check indent
+        rev1 = update_item(item_name, {}, u'One Two Three Four\nSix\n\ud55c')
+        rev2 = update_item(item_name, {}, u'Two Three Seven Four\nSix\n\ud55c')
+        result = Text._render_data_diff(item, rev1, rev2)
+        assert '<span>One </span>Two Three Four' in result
+        assert 'Two Three <span>Seven </span>Four' in result
+        # Check for diff_html.diff return types
+        assert reduce(lambda x, y: x and y, [isinstance(i[1], unicode) and isinstance(i[3], unicode) for i in diff_html.diff(u'One Two Three Four\nSix\n', u'Two Three Seven Four\nSix Seven\n')], True)
+
     def test__render_data_diff_text(self):
         item_name = u'Text_Item'
         item = Text.create(item_name)

File MoinMoin/templates/atom.html

+{% import "utils.html" as utils %}
+{% macro show_meta(rev) %}
+    <div class="moin-diff-info moin-diff-info-rev-id">
+        <span class="moin-diff-info-caption">{{ _('Revision') }}:</span>
+        <span class="moin-diff-info-value">{{ rev.meta['revid'] | shorten_id }}</span>
+    </div>
+    <div class="moin-diff-info moin-diff-info-rev-size">
+        <span class="moin-diff-info-caption">{{ _('Size') }}:</span>
+        <span class="moin-diff-info-value">{{ rev.meta['size'] }}</span>
+    </div>
+    <div class="moin-diff-info moin-diff-info-rev-comment">
+        <span class="moin-diff-info-caption">{{ _('Comment') }}:</span>
+        <span class="moin-diff-info-value">{{ rev.meta['comment'] }}</span>
+    </div>
+{% endmacro %}
+
+{# A few style rules to ensure the content doesn't overflow #}
+{% macro atom_style() %}
+    <style type="text/css">
+        img {
+            max-width: 100%;
+        }
+        td {
+            padding-right: 10px;
+        }
+        table {
+            width: 100%;
+        }
+    </style>
+{% endmacro %}
+
+{%- if get == 'xml' -%}
+    <?xml-stylesheet type="text/xsl" href="{{ theme_static('atom.xslt') }}"?>
+{%- elif get == 'comment_cont_merge' -%}
+    <p style="font-size: 1.2em">…{{ comment }}</p> <br /> {{ content }}
+{%- elif get == 'first_revision' -%}
+    {{ content }}
+    <br />
+    <table class="moin-diff" cellpadding="10" width="100%">
+        <tr>
+            <td class="moin-diff-header" style="width: 100%;">
+                <strong>{{ show_meta(rev) }}</strong>
+            </td>
+        </tr>
+    </table>
+    {{ atom_style() }}
+{%- elif get == 'binary' -%}
+    {{ content }}
+    <br />
+    <table class="moin-diff" cellpadding="10" width="100%">
+        <tr>
+            <td class="moin-diff-header" style="width: 50%;">
+                <strong>{{ show_meta(oldrev) }}</strong>
+            </td>
+            <td class="moin-diff-header" style="width: 50%;">
+                <strong>{{ show_meta(newrev) }}</strong>
+            </td>
+        </tr>
+    </table>
+    {{ atom_style() }}
+{%- endif -%}
+

File MoinMoin/templates/diff.html

 <h1>{{ _("Diff for '%(item_name)s'", item_name=newrev.item.name) }}</h1>
 <br>
 {% endblock %}
-{{ item._render_data_diff(oldrev, newrev) }}
+{{ diff_html }}
 {% endblock %}

File MoinMoin/templates/diff_text_atom.html

+{% import "utils.html" as utils %}
+
+{% macro show_meta(rev) %}
+    <div class="moin-diff-info moin-diff-info-rev-id">
+        <span class="moin-diff-info-caption">{{ _('Revision') }}:</span>
+        <span class="moin-diff-info-value">{{ rev.meta['revid'] | shorten_id }}</span>
+    </div>
+    <div class="moin-diff-info moin-diff-info-rev-size">
+        <span class="moin-diff-info-caption">{{ _('Size') }}:</span>
+        <span class="moin-diff-info-value">{{ rev.meta['size'] }}</span>
+    </div>
+    <div class="moin-diff-info moin-diff-info-rev-comment">
+        <span class="moin-diff-info-caption">{{ _('Comment') }}:</span>
+        <span class="moin-diff-info-value">{{ rev.meta['comment'] }}</span>
+    </div>
+{% endmacro %}
+<table class="moin-diff" style="width: 100%;">
+    {% for llineno, lcontent, rlineno, rcontent in diffs %}
+        <tr>
+            <td style="vertical-align: top;">{{ llineno }}:</td>
+            <td class="moin-diff-removed" style="vertical-align: top; background-color:#ff9; word-wrap: break-word;"><blockquote>{{ lcontent }}</blockquote></td>
+            <td style="vertical-align: top;">{{ rlineno }}:</td>
+            <td class="moin-diff-added" style="vertical-align: top; background-color: #cfc; word-wrap: break-word;"><blockquote>{{ rcontent }}</blockquote></td>
+        </tr>
+    {% endfor %}
+    <tr>
+        <td class="moin-diff-header-line" style="width: 3%;">
+        </td>
+        <td class="moin-diff-header" style="width: 47%;">
+            <strong>{{ show_meta(oldrev) }}</strong>
+        </td>
+        <td class="moin-diff-header-line" style="width: 3%;">
+        </td>
+        <td class="moin-diff-header" style="width: 47%;">
+            <strong>{{ show_meta(newrev) }}</strong>
+        </td>    
+    </tr>
+</table>
+<style type="text/css">
+    .moin-diff-added span { background-color: #80FF80; }
+    .moin-diff-removed span { background-color: #FFFF80; }
+</style>
+

File MoinMoin/themes/modernized/static/atom.xslt

+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:atom="http://www.w3.org/2005/Atom"
+  xmlns:dc="http://purl.org/dc/elements/1.1/" >
+    <xsl:output method="html" />
+    <xsl:template match="/">
+        <html>
+            <head>
+                <title><xsl:value-of select="/atom:feed/atom:title" /></title>
+            </head>
+            <body>
+                <xsl:apply-templates select="atom:feed" />
+                <script type="text/javascript"><![CDATA[
+                    var entries = document.getElementsByTagName('div');
+
+                    var elements = [];
+                    for (i = 0; i < entries.length; i++)
+                    {
+                        if (entries[i].className != 'summary')
+                            continue;
+                            
+                        elements[elements.length] = entries[i];
+                    }
+                    
+                    for (i = 0; i < elements.length; i++)
+                        elements[i].innerHTML = elements[i].innerText;
+                ]]></script>
+            </body>
+        </html>
+    </xsl:template>
+    <xsl:template match="atom:feed">
+        <div style="color: red;">This is just a fallback version, please use a proper atom feed reader</div>
+        <div style="font-size: 2.4em; text-align: center;"><xsl:value-of select="atom:title" /></div>
+        <div id="entries">
+            <xsl:apply-templates select="atom:entry" />
+        </div>
+    </xsl:template>
+    <xsl:template match="atom:feed/atom:entry">
+        <div style="margin: 2em; border-top: solid 1px #ddd; padding: 1em 0;">
+            <div style="font-size: 1.4em;"><xsl:value-of select="atom:title" /></div>
+            <div style="font-size: 0.9em; color: #999;"><xsl:value-of select="atom:author/atom:name" />, <xsl:value-of select="atom:updated" /></div>
+            <div style="padding: 0px 30px 0px 30px;" class="summary"><xsl:value-of select="atom:summary" /></div>
+        </div>
+    </xsl:template>
+</xsl:stylesheet>
+

File MoinMoin/util/diff_html.py

         line = line[1:]
     stripped = line.lstrip()
     if len(line) - len(stripped):
-        line = "&nbsp;" * (len(line) - len(stripped)) + stripped
+        line = u"&nbsp;" * (len(line) - len(stripped)) + stripped
     #return "%d / %d / %s" % (len(line), len(stripped), line)
     return eol + line
 
             lastmatch = (match[0] + match[2], match[1] + match[2])
             continue
         llineno, rlineno = lastmatch[0]+1, lastmatch[1]+1
-        leftpane = ''
-        rightpane = ''
+        leftpane = u''
+        rightpane = u''
         linecount = max(match[0] - lastmatch[0], match[1] - lastmatch[1])
         for line in range(linecount):
             if line < match[0] - lastmatch[0]:
         if charobj.ratio() < 0.5:
             # Insufficient similarity.
             if leftpane:
-                leftresult = """<span>{0}</span>""".format(indent(escape(leftpane)))
+                leftresult = u"""<span>{0}</span>""".format(indent(escape(leftpane)))
             else:
-                leftresult = ''
+                leftresult = u''
 
             if rightpane:
-                rightresult = """<span>{0}</span>""".format(indent(escape(rightpane)))
+                rightresult = u"""<span>{0}</span>""".format(indent(escape(rightpane)))
             else:
-                rightresult = ''
+                rightresult = u''
         else:
             # Some similarities; markup changes.
             charlast = (0, 0)
-
-            leftresult = ''
-            rightresult = ''
+            leftresult = u''
+            rightresult = u''
             for thismatch in charmatch:
                 if thismatch[0] - charlast[0] != 0:
-                    leftresult += """<span>{0}</span>""".format(indent(
+                    leftresult += u"""<span>{0}</span>""".format(indent(
                         escape(leftpane[charlast[0]:thismatch[0]])))
                 if thismatch[1] - charlast[1] != 0:
-                    rightresult += """<span>{0}</span>""".format(indent(
+                    rightresult += u"""<span>{0}</span>""".format(indent(
                         escape(rightpane[charlast[1]:thismatch[1]])))
                 leftresult += escape(leftpane[thismatch[0]:thismatch[0] + thismatch[2]])
                 rightresult += escape(rightpane[thismatch[1]:thismatch[1] + thismatch[2]])
                 charlast = (thismatch[0] + thismatch[2], thismatch[1] + thismatch[2])
 
-        leftpane = '<br>'.join([indent(x) for x in leftresult.splitlines()])
-        rightpane = '<br>'.join([indent(x) for x in rightresult.splitlines()])
+        leftpane = u'<br>'.join([indent(x) for x in leftresult.splitlines()])
+        rightpane = u'<br>'.join([indent(x) for x in rightresult.splitlines()])
         result.append((llineno, leftpane, rlineno, rightpane))
 
         lastmatch = (match[0] + match[2], match[1] + match[2])

File docs/_static/custom.css

+/* Custom CSS for Sphinx */
+
+/* Import the default theme's CSS file */
+@import "default.css";
+
+.bolditalic {
+    font-weight: bold;
+    font-style: italic;
+}
+
+.sub {
+    vertical-align: sub;
+    font-size: 50%;
+}
+
+.sup {
+    vertical-align: super;
+    font-size: 50%;
+}
+
+.strikethrough {
+    text-decoration: line-through;
+}
+
+.underline {
+    text-decoration: underline;
+}
+
+/* We need borders around each cell to clearly demonstrate table boundaries
+ * in markup documentation */
+table.docutils th,
+table.docutils td {
+    border-style: solid;
+    border-width: 1px;
+    border-color: #AAAAAA;
+}

File docs/conf.py

 # a list of builtin themes.
 html_theme = 'default'
 
+# The style sheet to use for HTML pages. A file of that name must exist either
+# in Sphinx’ static/ path, or in one of the custom paths given in
+# html_static_path. Default is the stylesheet given by the selected theme.
+html_style = 'custom.css'
+
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
 # documentation.

File docs/user/creolewiki.rst

 
 Features currently not working with moin's rst parser are marked with **RSTTODO**.
 
-Features currently not working with moin's sphinx setup are marked with **SPHINXTODO**.
-
 Headings
 ========
 
 |                                     | | Second line                         | 
 +-------------------------------------+---------------------------------------+
 
-**SPHINXTODO** **RSTTODO**: Restructured Text cannot be both **bold** and *italic*. This is because bold and italic are simply
-treated as different levels of emphasis. It should be noted that this is a problem with the spec rather than Sphinx or Moin itself.
-
-It requires the following CSS to rectify: ::
-
-   .bolditalic{font-weight:bold;font-style:italic;}
-
 **RSTTODO**: Restructured Text line blocks are not working in Moin2
 
 Hyperlinks

File docs/user/mediawiki.rst

 
 Features currently not working with moin's rst parser are marked with **RSTTODO**.
 
-Features currently not working with moin's sphinx setup are marked with **SPHINXTODO**.
-
 Headings
 ========
 
 | | ``without '''markups'''</pre>``  | | ``without '''markups'''``        |
 +------------------------------------+------------------------------------+
 
-**SPHINXTODO**
-The following css is needed to display formatted text correctly: ::
-
- span.underline { text-decoration: underline; }
- span.strikethrough { text-decoration: line-through; }
- span.bolditalic { font-weight: bold; font-style: italic; }
-
 **RSTTODO**
 table headers are not formatted as headers
 (see "Tables" section for corresponding MWTODO)

File docs/user/moinwiki.rst

 
 Features currently not working with moin's Wiki parser are marked with **MOINTODO**.
 
-Features currently not working with moin's sphinx setup are marked with **SPHINXTODO**.
-
-
-**SPHINXTODO CSS**, the tables seem to have missing borders despite of the fact that the rst markup is correct.
-
 Table Of Contents
 =================
 
 | ``--(Stroke)--``                    | :strikethrough:`Stroke`               |
 +-------------------------------------+---------------------------------------+
 
-**Notes**:
- - **SPHINXTODO** Superscript, subscript and underline are not working in rst.
-
 Hyperlinks
 ==========
 
 Lists
 =====
 
+.. warning::
+   All Moin Wiki list syntax (including that for unordered lists, ordered lists and definition lists) requires a leading space before each item in the list.
+   Unfortunately, reStructuredText does not allow leading whitespace in code samples, so the example markup here will not work if copied verbatim, and requires
+   that each line of the list be indented by one space in order to be valid Moin Wiki markup.
+   This is also an **RSTTODO**
+
 Unordered Lists
 ---------------
 
    
  B. item 2
    
-**Notes**:
- - **SPHINXTODO** sphinx will remove the first space before every list item.
- - Moin increases the order number/roman/letter automaticaly. rst does not do any such thing, so i have to manually increase them here.
- - even the base level item has to have a space in the begining
-
 Definition Lists
 ================
 
  term
   definition
  object
-  description 1
-  description 2
+  | description 1
+  | description 2
+
+**Notes**:
+ - reStructuredText does not support multiple definitions for a single term, so a line break has been forced to illustrate the appearance of several definitions.
+   Using the prescribed Moin Wiki markup will, in fact, produce two separate definitions in MoinMoin (using separate ``<dd>`` tags).
   
 Tables
 ======
 
 **Notes**:
  - **MOINTODO:** the cell width does not work in moin 2.
- - **SPHINXTODO** rst does not support percentage cell width so cell has been made long manually
+ - reStructuredText does not support percentage cell width so cell has been made long manually. In MoinMoin the second cell will take up the maximum amount of horizontal space.
 
 Spanning Rows and Columns
 -------------------------
 +----------------+---------------------------------------+-------------------+
 
 **Notes**:
- - **SPHINXTODO** bottom align cannot be shown in rst.
+ - Text cannot be aligned in reStructuredText, but the text will appear as is described when used in MoinMoin.
 
 HTML-like Options for Tables
 ----------------------------
     print "Hello World!"
  }}}
  
-**Result**: ::
+**Result**:
 
- ---
- 
+.. code-block:: python
+
+    def hello():
+        print "Hello, world!"
+
 **Notes**:
  - The syntax crashes moin2.
- - **SPHINXTODO** The html required for the syntax box cannot be shown in rst.
 
 Using the wiki parser with css classes
 --------------------------------------
 +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 
 **Notes**:
- - **SPHINXTODO** The div cannot be shown in rst, so a table cell has been made to imitate it.
+ - The div cannot be shown in reStructuredText, so a table cell has been made to demonstrate the border produced. In MoinMoin, this border will appear red.
 
 Admonitions
 -----------
  
 **Result**:
 
----
+.. warning::
+    **Don't overuse admonitions**
 
-**Notes**:
- - **SPHINXTODO** The Admonition cannot be shown in rst.
+    Admonitions should be used with care. A page riddled with admonitions will look restless and will be harder to follow than a page where admonitions are used sparingly.
 
 Comments
 --------
  
 **Result**:
 
----
++--------------------------------------------------------------------------------+
+| This is a wiki parser section with class "comment dotted" (see HelpOnParsers). |
+|                                                                                |
+| Its visibility gets toggled the same way.                                      |
++--------------------------------------------------------------------------------+
 
 **Notes**:
- - **SPHINXTODO** The wiki parser section with class "comment dotted" cannot be shown in rst.
+ - reStructuredText has no support for dotted borders, so a table cell is used to illustrate the border which will be produced. This markup will actually produce a dotted border in MoinMoin.
  - The toggle display feature does not work yet

File docs/user/rest.rst

 
 Features currently not working with moin's Wiki parser are marked with **RSTTODO**.
 
-Features currently not working with moin's sphinx setup are marked with **SPHINXTODO**.
-
-
-**SPHINXTODO CSS**, The tables are missing borders despite the fact that the rst markup is correct.
-
 Headings
 ========
 
 
  1. item 1
  
-   1. item 1.1
+    1. item 1.1
+    #. item 1.2
    
-   2. item 1.2
-   
- 2. item 2
+ #. item 2
 
 **Result**:
 
  1. item 1
  
-   1. item 1.1
+    1. item 1.1
+    #. item 1.2
    
-   2. item 1.2
-   
- 2. item 2
+ #. item 2
    
 **Notes**:
- - The order and the numbering agent have to be maintained by the user. Any character can be used to number the items (e.g. a/A or i/I).
- - **SPHINXTODO** sphinx will remove the first space before every list item.
- - even the base level item has to have a space in the beginning
+ - Ordered lists can be automatically enumerated using the ``#`` character as demonstrated above. Note that the first item of an ordered list
+   auto-enumerated in this fashion must use explicit numbering notation (e.g. ``1.``) in order to select the enumeration sequence type
+   (e.g. Roman numerals, Arabic numerals, etc.), initial number (for lists which do not start at "1") and formatting type (e.g. ``1.`` or ``(1)`` or ``1)``). More information on
+   enumerated lists can be found in the `reStructuredText documentation <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#enumerated-lists>`_.
+ - One or more blank lines are required before and after reStructuredText lists.
 
 Definition Lists
 ================

File quickinstall

 #!/bin/bash
 # create a virtual environment in directory $DIR/
+#
 # set PYTHON environment variable to change the python version
+# set DIR environment variable to change the virtual env directory
 # set VIRTUALENV environment variable to change the virtualenv command
-# for example: PYTHON=/usr/bin/pypy ./quickinstall
+# for example: PYTHON=/usr/bin/pypy DIR=env-pypy ./quickinstall
+#
 # needs: virtualenv, pip
 
-DIR=env
 DLC=dlc
 
+# if DIR is not given, use ./env
+if [ -z "$DIR" ]; then
+    DIR=env
+fi
+
 # find the right python version
 if [ -z "$PYTHON" ]; then
     for PYTHON in python{2.7,2.6,2,}; do