Description
It doesn't seem possible to use more then one
attachment:file
when using
#format rst
from HelpOnParsers/ReStructuredText:
#format rst Here is a link to a page attachment__. __ attachment:Attachment.zip
but what if i need:
#format rst Here is a link to file 1__. Here is a link to file 2__. __ attachment:file1 __ attachment:file2
moin doesn't support it while rst does.
from anonymous-hyperlinks:
- The reference name of the reference is not used to match the reference to its target.
- The order of anonymous hyperlink references and targets within the document is significant:
- the first anonymous reference will link to the first anonymous target.
- The number of anonymous hyperlink references in a document must match the number of anonymous targets.
Steps to reproduce
paste the following text into a moin page and into a file, then save the moin page and convert (rst2html) the rst to html from the file:
attachment__ attachment__ attachment__ attachment__ attachment__ attachment__ attachment__ __ attachment:file1 __ attachment:file2 __ attachment:file3 __ attachment:file4 __ attachment:file5 __ attachment:file6 __ attachment:file7
Example
Expected body from moin:
<p><a href="/Page?action=AttachFile&rename=file1">Upload new attachment "file1"</a> </p> <p><a href="/Page?action=AttachFile&rename=file2">Upload new attachment "file2"</a> </p> <p><a href="/Page?action=AttachFile&rename=file3">Upload new attachment "file3"</a> </p> <p><a href="/Page?action=AttachFile&rename=file4">Upload new attachment "file4"</a> </p> <p><a href="/Page?action=AttachFile&rename=file5">Upload new attachment "file5"</a> </p> <p><a href="/Page?action=AttachFile&rename=file6">Upload new attachment "file6"</a> </p> <p><a href="/Page?action=AttachFile&rename=file7">Upload new attachment "file7"</a> </p>
Component selection
- attachment directive of rst pareser in moin (not distributed on typical docutils, moin specific)
Details
MoinMoin Version |
1.6 |
OS and Version |
Any |
Python Version |
Any |
Server Setup |
Any |
Server Details |
Any |
Language you are using the wiki in (set in the browser/UserPreferences) |
Any |
Workaround
Discussion
Ideally moin could use rst directive see rst-directives.
In MoinMoin/parser/text_rst.py:
1 import docutils
2 from docutils.core import publish_parts
3 from docutils.writers import html4css1
4 from docutils.nodes import reference
5 from docutils.parsers import rst
6 from docutils.parsers.rst import directives, roles
7
8 # here the directive: '.. attachment:: file'
9 directives.register_directive(directive_name, directive_class)
Plan
- Priority:
- Assigned to:
- Status: