Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mylyn » [wikitext] How to use MarkupLanguageConfiguration?
[wikitext] How to use MarkupLanguageConfiguration? [message #772064] Wed, 28 December 2011 23:10 Go to next message
Edwin Park is currently offline Edwin ParkFriend
Messages: 124
Registered: July 2009
Senior Member
Hi,

I'm trying to use MarkupLanguageConfiguration to provide support for custom blocks. I'm trying to follow the instructions under Markup Language Customization here: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.mylyn.wikitext.help.ui%2Fhelp%2FMarkup-Conversion.html

I tried creating my own subclass of MarkupLanguageConfiguration as it says in the last example, but when I try to add a <languageConfiguration> block, Ant complains that wikitext-to-html does not allow a child element called languageConfiguration.

I'm also curious about the standard <markupLanguageConfiguration> tag - is it possible to use this to contribute block extensions? I noticed that MarkupLanguageConfiguration has an addBlockExtensions method.

Thanks,
Edwin
Re: [wikitext] How to use MarkupLanguageConfiguration? [message #772440 is a reply to message #772064] Thu, 29 December 2011 19:49 Go to previous messageGo to next message
David Green is currently offline David GreenFriend
Messages: 135
Registered: July 2009
Senior Member
Edwin,

On 12/28/2011 3:10 PM, Edwin Park wrote:
> Hi,
>
> I'm trying to use MarkupLanguageConfiguration to provide support for
> custom blocks. I'm trying to follow the instructions under Markup
> Language Customization here:
> http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.mylyn.wikitext.help.ui%2Fhelp%2FMarkup-Conversion.html
>
>
> I tried creating my own subclass of MarkupLanguageConfiguration as it
> says in the last example, but when I try to add a
> <languageConfiguration> block, Ant complains that wikitext-to-html does
> not allow a child element called languageConfiguration.

I see the same problem. Please file a bug and I'll look into it.

> I'm also curious about the standard <markupLanguageConfiguration> tag -
> is it possible to use this to contribute block extensions? I noticed
> that MarkupLanguageConfiguration has an addBlockExtensions method.

The addBlockExtensions method is not designed for use with Ant. You'll
need to subclass MarkupLanguageConfiguration and call that method in the
constructor.

David


> Thanks,
> Edwin
>
Re: [wikitext] How to use MarkupLanguageConfiguration? [message #772444 is a reply to message #772440] Thu, 29 December 2011 20:01 Go to previous messageGo to next message
David Green is currently offline David GreenFriend
Messages: 135
Registered: July 2009
Senior Member
I forgot to mention: as a workaround, blocks can easily be added by
subclassing the markup language of choice. To do this you would
reference the markup language class name directly in your Ant script
like this:

<wikitext-to-eclipse-help
markupLanguage="com.example.wikitext.ExtendedTextileLanguage" ...>

Your subclass can override addBlockExtensions as follows:

public class ExtendedTextileLanguage extends TextileLanguage {

@Override
protected void addBlockExtensions(List<Block> blocks, List<Block>
paragraphBreakingBlocks) {
blocks.add(new MySpecializedCustomBlock());
super.addBlockExtensions(blocks, paragraphBreakingBlocks);
}

}

I hope that helps,

David

On 12/29/2011 11:49 AM, David Green wrote:
> Edwin,
>
> On 12/28/2011 3:10 PM, Edwin Park wrote:
>> Hi,
>>
>> I'm trying to use MarkupLanguageConfiguration to provide support for
>> custom blocks. I'm trying to follow the instructions under Markup
>> Language Customization here:
>> http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.mylyn.wikitext.help.ui%2Fhelp%2FMarkup-Conversion.html
>>
>>
>>
>> I tried creating my own subclass of MarkupLanguageConfiguration as it
>> says in the last example, but when I try to add a
>> <languageConfiguration> block, Ant complains that wikitext-to-html does
>> not allow a child element called languageConfiguration.
>
> I see the same problem. Please file a bug and I'll look into it.
>
>> I'm also curious about the standard <markupLanguageConfiguration> tag -
>> is it possible to use this to contribute block extensions? I noticed
>> that MarkupLanguageConfiguration has an addBlockExtensions method.
>
> The addBlockExtensions method is not designed for use with Ant. You'll
> need to subclass MarkupLanguageConfiguration and call that method in the
> constructor.
>
> David
>
>
>> Thanks,
>> Edwin
>>
>
Re: [wikitext] How to use MarkupLanguageConfiguration? [message #772453 is a reply to message #772444] Thu, 29 December 2011 20:34 Go to previous message
Edwin Park is currently offline Edwin ParkFriend
Messages: 124
Registered: July 2009
Senior Member
Thanks David. I'm using the workaround you mentioned. I posted a bug for the MarkupLanguageConfiguration: https://bugs.eclipse.org/bugs/show_bug.cgi?id=367633

Edwin
Previous Topic:Integrating a plugin with Mylyn
Next Topic:Is the Mylyn "context" generic ?
Goto Forum:
  


Current Time: Fri Nov 28 13:26:49 GMT 2014

Powered by FUDForum. Page generated in 0.01676 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software