= Details = Applies to:: MoinMoin/macro/Include.py Purpose:: make the Include macro easier to modify Description:: my intention is to refactor MoinMoin/macro/Include.py, i.e. make no changes to its behaviour; this will take a couple of patches = Patches = The patches are published here: http://vc.gerg.ca/hg/moin-1.9-refactor-include-patches . That is an MQ repository, i.e. a repository of `.hg/patches` from a clone of the canonical moin/1.9 repository. In order, the patches are: 1. Add tests for Include macro. 1. Factor out several functions that setup the list of pages to include. 1. Factor out functions that work on including a single page. 1. Factor out the body of the main loop of execute() to include_page(). 1. Factor out parse_args() and IncludeArgs class for parsing/storing args passed to the macro. 1. Check for macroInclude_pagelist[inc_name] > 1 is bogus: add comment and assertion. You can review the patches by cloning my MQ repository into a clean clone of moin/1.9: {{{ http://hg.moinmo.in/moin/1.9 moin-1.9 cd moin-1.9 hg clone http://vc.gerg.ca/hg/moin-1.9-refactor-include-patches .hg/patches hg qpush/qpop/etc at will... }}} = Discussion = * Patches are relative to the tip of moin/1.9 as of 2009-01-29 * The tests make fairly stringent assumptions about the formatted HTML output of the macro. That's good for me right now, because I want to ensure I am making no changes to behaviour. But it could make life harder for anyone changing formatting behaviour in future. * ThomasWaldmann said: The formatter defaults to be a html formatter. if that ever changes, we'll have to fix the tests. = Plan = ## This part is for Moin``Moin developers: * Priority: * Assigned to: * Status: /!\ be aware that Include is already refactored by the domtree refactoring from Bastian Blank ([[http://hg.moinmo.in/moin/1.8-dom-bblank/file/tip/MoinMoin/converter2/_wiki_macro.py|Include]]). This domtree refactoring work will be merged after 2.0. If you like to contribute/help please use the version from there. You may want to join us on #moin/#moin-dev on chat.freenode.net -- ReimarBauer <> ---- CategoryMoinMoinPatch