Skip to content

Instantly share code, notes, and snippets.

@Fusselwurm
Created May 16, 2013 08:32
Show Gist options
  • Save Fusselwurm/5590268 to your computer and use it in GitHub Desktop.
Save Fusselwurm/5590268 to your computer and use it in GitHub Desktop.
gherkin syntax highlighting for kde/katepart. not of my making, but copied from http://paste.kde.org/184712/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--
Gherkin (English) syntax highlighting definition for Kate.
Copyright (C) 2011 by Torbjörn Klatt ([email protected])
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
-->
<!--
TODO:
- fix: support for multiline strings (https://github.com/cucumber/cucumber/wiki/Multiline-Step-Arguments)
- fix: get the 'words' in the 'Feature' decleration blue
- fix: get the text after the 'words' in the 'Feature' decleration green
-->
<language name="Gherkin (en)"
section="Scripts"
version="1.00"
kateversion="2.4"
extensions="*.feature"
author="Torbjörn Klatt ([email protected])"
license="LGPL">
<highlighting>
<list name="keywords">
<item> Feature </item>
<item> Background </item>
<item> Scenario Outline </item>
<item> Scenario Template </item>
<item> Scenario </item>
<item> Examples </item>
<item> Scenarios </item>
</list>
<list name="words">
<item> In order </item>
<item> As a </item>
<item> I want </item>
</list>
<list name="steps">
<item> Given </item>
<item> When </item>
<item> Then </item>
<item> And </item>
<item> But </item>
</list>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="normal">
<DetectChar attribute="Comment" context="comment" char="#" />
<keyword attribute="Keyword" context="keyword" String="keywords" />
<keyword attribute="Feature" context="feature" String="words" />
<keyword attribute="Step" context="#stay" String="steps" />
<DetectChar attribute="String" context="string" char="&quot;" />
<StringDetect String="&quot;&quot;&quot;" attribute="String" lineEndContext="#stay" beginRegion="String" />
<RangeDetect char="&lt;" char1="&gt;" attribute="Placeholder" context="#pop" />
</context>
<context attribute="Keyword" lineEndContext="#pop" name="keyword">
<DetectChar attribute="Keyword" context="feature" char=":" />
</context>
<context attribute="Feature" lineEndContext="#pop" name="feature">
<keyword attribute="Step" context="#stay" String="words" />
</context>
<context attribute="String" lineEndContext="#pop" name="string">
<DetectChar attribute="String" context="#pop" char="&quot;" />
</context>
<context attribute="String" lineEndContext="#stay" name="multilinestring">
<DetectString String="&quot;&quot;&quot;" attribute="String" context="#pop" endRegion="String" />
</context>
<context attribute="Comment" lineEndContext="#pop" name="comment">
<DetectChar attribute="Comment" char="#" />
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" bold="false" color="#000000" spellChecking="true" />
<itemData name="Keyword" bold="true" color="#0000FF" spellChecking="false" />
<itemData name="Feature" bold="false" color="#00AA00" spellChecking="true" />
<itemData name="Step" bold="false" color="#0000FF" spellChecking="false" />
<itemData name="String" bold="false" color="#AA0000" spellChecking="true" />
<itemData name="Placeholder" bold="false" color="#FF9966" spellChecking="false" />
<itemData name="Comment" bold="false" italic="true" color="#AAAAAA" spellChecking="true" />
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="#" />
</comments>
<keywords casesensitive="1" />
</general>
</language>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment