Details
- Applies to
- moin-1.5.5a
- Purpose
- Allow multiline macros in rst
- Description
A simple modification, such that not only the first line is used with the .. macro:: directive in rst. I needed this, because I wanted to copy an rst-file with long "latex/itex" calls into moinmoin
Patch
1 Index: rst.py
2 ===================================================================
3 RCS file: /cvs/TPS/moin/MoinMoin/parser/rst.py,v
4 retrieving revision 1.1.1.4
5 diff -u -r1.1.1.4 rst.py
6 --- rst.py 16 Sep 2006 20:31:36 -0000 1.1.1.4
7 +++ rst.py 16 Nov 2006 00:37:38 -0000
8 @@ -586,11 +586,10 @@
9 content_offset, block_text, state, state_machine):
10 # content contains macro to be called
11 if len(content):
12 + macro = " ".join( content )
13 # Allow either with or without brackets
14 - if content[0].startswith('[['):
15 - macro = content[0]
16 - else:
17 - macro = '[[%s]]' % content[0]
18 + if not content[0].startswith('[['):
19 + macro = '[[%s]]' % macro
20 ref = reference(macro, refuri = macro)
21 ref['name'] = macro
22 return [ref]
Discussion
A comment/question regarding this patch ... I had hoped that this was to allow markup like this
[[MyMacroName(arg_on_first_line, arg_on_second_line)]]
which is something I need to support.
It appears that this is something different. Is this patch just for multi-line macro names?
No, it´s for macros in the RST parser. -- TobiasPolzin 2006-12-20 21:12:12
Any suggestions for supporting this sort of multi-line macro would be appreciated.
That is the difference between macros and parsers. macros uses all parameters in one line only. parsers and macros will be unified on the way to 2.0. -- ReimarBauer 2006-12-21 07:14:14
I have no idea about rst and don't use it myself, so comments from other rst users about this patch are welcome. -- ThomasWaldmann 2006-12-23 16:55:51
Plan
- Priority:
- Assigned to:
- Status: