Extension to the Include macro: option INLINE
When using <<Include( ... )>>> the macro does always create a line break before and after the included page or partial content of page. If one just wants to extract one word or sentence from another page and include it inline into the text flow of the current page this is not possible right now.
I propose a new optional keyword inline which prevents the creation of a line break before and after the content to be included.
So <<Include( Release/.*, , from="^##version-string: ", to="$", sort=descending, inline )>>> would just insert the text between "##version-string:" and line end ("$") from a page below path "Release/" without any line break before or after.
Unfortunately I cannot present any patch to Include.py myself. But for a skilled programmer with some knowledge of MoinMoin this should not be a problem to implement this feature.
-- Junyx 2008-02-26 21:22:27
Okay, I provide a patch here - append it to MoinMoin/macro/Include.py (version 1.6.1):
35c35,36 < _args_re_pattern = r'^(?P<name>[^,]+)(%s(%s)?%s%s%s%s%s%s%s)?$' % ( --- > _arg_inline = r'(,\s*(?P<inline>inline))?' > _args_re_pattern = r'^(?P<name>[^,]+)(%s(%s)?%s%s%s%s%s%s%s%s)?$' % ( 37c38 < _arg_skipitems, _arg_titlesonly, _arg_editlink) --- > _arg_skipitems, _arg_titlesonly, _arg_editlink, _arg_inline) 97a99 > inline = args.group('inline') 175a178,185 > if inline: > # keyword 'inline' will include text into the page > # without surrounding it with paragraphs or linebreaks. > # currently only text_moin_wiki markup is supported > from MoinMoin.parser.text_moin_wiki import Parser as WikiParser > result.append(wikiutil.renderText(request, WikiParser, inc_page.get_body())) > continue >
Could some1 from the MoinTeam look over it and possibly include it into the next release!?
There's still one minor glitch: When using keyword inline in preview mode of Moin there is a linebreak after the included word(s). But this linebreak is gone when exiting preview mode. I don't have a clue why this happens.
-- Junyx 2008-03-24 20:36:25