Maven Doxia

Allow snippet macro contents to be output as-is, instead of verbatim

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-alpha-8
  • Fix Version/s: 1.1
  • Component/s: Core
  • Labels:
    None
  • Number of attachments :
    1

Description

It would be extremely useful to be able to use the snippet macro to "include" ready made content. That is not possible because the SnippetMacro class outputs the content as verbatim escaped text. This could be allowed by adding a new parameter "verbatim" to the snippet macro that defaults to "true" to preserve the current behavior.

Consider this code example

<macro name="snippet" id="mytable" file="src/site/snippets/snippets.xml" verbatim="false"/>

It would take the snippet "mytable" from the specified file and insert it "as-is".

If you like this idea I will apply the patch and add examples to the documentation as well.

Activity

Hide
Lukas Theussl added a comment -

I like it...

However, shouldn't the non-verbatim text be output as text as well instead of rawText?

Show
Lukas Theussl added a comment - I like it... However, shouldn't the non-verbatim text be output as text as well instead of rawText?
Hide
Dennis Lundberg added a comment -

The non-verbatim text should be output as-is (rawText), without XML-escaping the characters. That way you can put an html-snippet in a file and reuse in it in multiple places, like a kind of include.

Show
Dennis Lundberg added a comment - The non-verbatim text should be output as-is (rawText), without XML-escaping the characters. That way you can put an html-snippet in a file and reuse in it in multiple places, like a kind of include.
Hide
Dennis Lundberg added a comment -

Fixed in r607880.

Show
Dennis Lundberg added a comment - Fixed in r607880.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: