I've just discovered the Plain Text Wiki bundle [1], and I'd like to improve the grammar by including the markdown language, so that the pagename scopes are just added on to markdown. Currently, the language grammar looks like this:
{ scopeName = 'text.html.markdown.wiki'; comment = 'TODO: Get nesting to work correctly. Currently, the links are only picked up outside of paragraphs.'; fileTypes = ( 'txt', 'markdown', 'mdown', 'markdn', 'md' ); patterns = ( { include = '#delimited'; }, { include = '#camelcase'; }, { include = 'text.html.markdown'; }, ); repository = { camelcase = { name = 'markup.other.pagename.camelcase'; match = '[A-Z][a-z]+([A-Z][a-z]*)+'; }; delimited = { contentName = 'markup.other.pagename.delimited'; begin = '[['; end = ']]'; }; }; }
This includes the markdown grammar, but breaks everything else that is in a paragraph.
I'm fairly sure I'm missing something simple, but can anyone help me out?
Cheers,
Matt
[1]: http://interconnected.org/home/more/2007/05/textmate-wiki/
PS. I've made a fork at: http://github.com/mattfoster/plaintextwiki-tmbundle/ if anyone's interested.
On 24 Nov 2008, at 10:37, Matt Foster wrote:
[...] This includes the markdown grammar, but breaks everything else that is in a paragraph.
That’s because Markdown has begin/end rules for paragraphs, so that grammar “takes over” the paragraphs.
There is no straightforward way to inherit yet augment Markdown as things are now.
On Mon, Nov 24, 2008 at 11:26 PM, Allan Odgaard mailinglist@textmate.org wrote:
On 24 Nov 2008, at 10:37, Matt Foster wrote:
[...] This includes the markdown grammar, but breaks everything else that is in a paragraph.
That's because Markdown has begin/end rules for paragraphs, so that grammar "takes over" the paragraphs.
There is no straightforward way to inherit yet augment Markdown as things are now.
Ahh, I see. I'd need the wiki rules to be included in meta.paragraph.markdown.
For now then, I just clone markdown's grammar and add the wiki scopes to it.
Cheers,
Matt