Dashboard > BobsGear Main Space > Home > Project Planning > Content refactoring
Content refactoring
Added by Garnet R. Chaney, last edited by Garnet R. Chaney on May 27, 2007  (view change)
Labels: 


See Content Refactoring Plugin...

http://www.chat11.com supports a FACTOR / ENDFACTOR mechanism that helps with refactoring large wiki pages. It does this as a "Post-Edit" command, that is, a command that is executed after edit, before saving the page. It looks like this:

Here is an example of how it can work:
Editing a page, surround a block of content with FACTOR name of new page / ENDFACTOR, like this:

Lots of page content

FACTOR Subpage Of Content:
some more page content
some more content
ENDFACTOR

the rest of the page content

When the page is saved, a new page called "Subpage Of Content" is saved with the given content, along with a link back to the page it came from. And on the page being refactored, it contains a link at that spot pointing to the new page. These forward and backward links make it easy to find the refactored content.

A page can contain more than one FACTOR / ENDFACTOR block. Using this mechanism, a script can write a single file that contains a large number of wiki pages that can be created by simply pasting the output into a single wiki page, and then saving.

The Confluence version would include these enhancements and changes:

  • It would be done as a factor "pseudo" macro with content, to match the style of other Confluence macros.
    • However the macro would not exist in the global macro list, since it would never be rendered.
  • Parameters would be used, such as "Title=Some Title|[ChildOf]=Some Page Name"
    • [ChildOf] would default to the current page.
  • Embedding the factor macro within a noformat macro block would disable the refactor operation.

Implementation Details

Would need to be written as an event listener looking for page edited events. It would get the edited page, scan for the factor blocks, and process them.

Work is beginning at Content Refactoring Plugin.

Pages with related information:

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.3 Build:#705 Mar 21, 2007) - Bug/feature request - Contact Administrators
Complete Wiki Notation Guide