Permalink
Browse files

Initial commit for the very basics around a YAML.mode for SubEthaEdit…

… & Coda
  • Loading branch information...
0 parents commit 9fd8edd26819d289666a2c76e1a2091d682be878 @stuffmc committed Jun 12, 2010
@@ -0,0 +1 @@
+.DS_Store
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleIdentifier</key>
+ <string>SEEMode.Example Syntax</string> <!-- Change bundle identifier. Must start with "SEEMode." -->
+ <key>CFBundleName</key>
+ <string>YAML</string> <!-- Change bundle name. -->
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>CFBundleGetInfoString</key>
+ <string>1.0, Copyright Manuel "StuFF mc" CARRASCO MOLINA 2010</string> <!-- Change author. -->
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+</dict>
+</plist>
@@ -0,0 +1,2 @@
+de_DE
+en_GB
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings>
+ <template>mytemplate.txt</template> <!-- Provide a template for File->new -->
+ <recognition>
+ <extension>yml</extension> <!-- Add file extensions -->
+ <extension casesensitive="yes">C</extension> <!-- Add case sensitive file extensions -->
+ </recognition>
+</settings>
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<symbols>
+
+ <!--
+ The <symbol> tag specifies what is being shown in the fuction popup.
+ It features the following attributes, all optional if not noted otherwise:
+ id
+ Has to be a unique string. Has to be specified.
+ image
+ Specify an image includes in the application (no extension) or
+ specify an image in this modes Resources directory (with extension)
+ SubEthaEdit comes with the following images:
+ Symbol#, SymbolC, SymbolE, SymbolF, SymbolF(), SymbolG, SymbolK,
+ SymbolL, SymbolM, SymbolP, SymbolS, SymbolT, SymbolV, SymbolWarn
+ indentation
+ 0-15 The level of indentation
+ font-weight
+ normal Normal font-weight (default)
+ bold Bold text in popup
+ font-style
+ normal Normal font-weight (default)
+ italic Bold text in popup
+
+ The example shows an symbol name "First example" with the image SymbolM
+ and an indentation of 1.
+ -->
+ <symbol id="First Example" image="SymbolM" indentation="1">
+
+ <!--
+ The regex tag specifies the regular expression that is search for this
+ symbol. It contains a Ruby-flavored regular expression. If groups is
+ specified in the regular expression the first group is used for the
+ find string. Escape unwanted groups with (?:).
+ This tag has to be specified.
+ Tip: Test your expressions with SubEthaEdits "Find All" command.
+ Tip: Case sensitivity can be set to ignore by including (?i) in your
+ expression.
+ -->
+
+ <regex>(function[^\n\r]*)</regex>
+
+ <!--
+ The postprocess tag specifies the find and replaces that should
+ be executed on the found string. You can use groups like \1 and the
+ like. It contains a Ruby-flavored regular expression.
+ This tag is optional.
+
+ The example search all strings enclosed by parens and replace them
+ with a empty string. Then it searches all occurances of "foo" and
+ replaces them with "bar".
+ -->
+
+ <postprocess>
+ <find>\([^\)]*\)</find>
+ <replace></replace>
+ <find>foo</find>
+ <replace>bar</replace>
+ </postprocess>
+ </symbol>
+
+ <symbol id="Second Example" font-weight="bold" image="SymbolF" indentation="0">
+ <regex>foobar</regex>
+ </symbol>
+
+</symbols>
Binary file not shown.
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<syntax>
+
+
+ <!--
+ The <head> tag encloses some global information about the mode.
+ This tag is required.
+ -->
+
+ <head>
+
+ <!--
+ The <name> specifies the modes name.
+ This tag is required and must match with the name in the plist after the SEEMode..
+ -->
+
+ <name>YAML</name>
+
+ <!-- optional to add spelling-dictionary autocomplete words -->
+ <autocompleteoptions use-spelling-dictionary="yes" />
+
+ <!--
+ The <charsintokens> and the <charsdelimitingtokens> instruct the syntax highlighter
+ where to tokenize the text for fast finding of plain strings.
+ The <charsintokens> tag specifies the characters that can occur in strings,
+ the <charsdelimitingtokens> tag specifies the tags that cannot occur in strings.
+ One of these tags has to be specified.
+ Tip: Use CDATA here.
+ -->
+
+ <charsintokens><![CDATA[_0987654321abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@]]></charsintokens>
+ <!-- <charsdelimitingtokens><![CDATA[ -]]></charsdelimitingtokens> -->
+
+
+ <!--
+ the <charsincompletion> defines characters used for autocompletion. e.g. in perl
+ you want this to include the $ sign to autocomplete variables.
+ If left out the regular expression word boundaries are used.
+ -->
+ <!-- <charsincompletion><![CDATA[_0987654321abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-@$</=>!]]></charsincompletion> -->
+ </head>
+
+
+ <!--
+ The <states> tag encloses all syntax states.
+ States are areas of the test that begin and end with an regex like comments or strings,
+ with exception of the default state, that exists anywhere where no other state exists.
+ This tag is required.
+ -->
+
+ <states>
+
+ <!--
+ The <default> tag specifies what is colored within the default state (see above).
+ It features the following attributes, all optional if not noted otherwise:
+ id
+ Has to be a unique string. Has to be specified.
+ color
+ a html comptible color in three or six letter hexadecimal format.
+ Used for text on bright document background colors.
+ inverted-color
+ a html comptible color in three or six letter hexadecimal format.
+ Used for text if a dark document background color is set.
+ font-weight
+ normal Normal font-weight (default)
+ bold Bold text in popup
+ font-style
+ normal Normal font-weight (default)
+ italic Bold text in popup
+ usesymbolsfrommode
+ a mode name to use the symbol recognition from
+ when left out the value is inherited from the parent state
+ useautocompletefrommode
+ a mode name to use the autocomplete from - default is this mode
+ when left out the value is inherited from the parent state
+ type
+ a string description of the type. currently only the values
+ "string" and "comment" have meaning and cause bracket matching
+ and syntax highlighting to ignore these areas of text
+
+ -->
+
+ <default id="Base" color="#f00" inverted-color="#0f0">
+
+ <!--
+ The <keywords> tag specifies keyword groups within the current state.
+ It features the following attributes, all optional if not noted otherwise:
+ id
+ Has to be a unique string. Has to be specified.
+ color
+ a html comptible color in three or six letter hexadecimal format.
+ Used for text on bright document background colors.
+ inverted-color
+ a html comptible color in three or six letter hexadecimal format.
+ Used for text if a dark document background color is set.
+ font-weight
+ normal Normal font-weight (default)
+ bold Bold text in popup
+ font-style
+ normal Normal font-weight (default)
+ italic Bold text in popup
+ casesensitive
+ yes This group is case sensitive (default)
+ no Ignore case for the group
+ useforautocomplete
+ yes Add this group's strings to the autocomplete dictionary (default)
+ no Don't add to autocomplete dictionary
+ -->
+
+ <keywords id="Keywords" color="#6C0540" casesensitive="no" useforautocomplete="yes">
+
+ <!--
+ <string> tags specify plain text to be colored. If your tag does not
+ get colored, check in <charsintokens> if you are tokenizing correctly.
+ -->
+
+ <!-- <string>de_DE</string>
+ <string>en_GB</string> -->
+
+ <!--
+ <regex> tags specify regular expression to be colored.
+ Only the first group will be colored, so enclose the part to color
+ with parens.
+
+ The example colors digits prefixed by foo. (only the digits)
+ -->
+
+ <regex>(.*):</regex>
+
+ </keywords>
+
+ <keywords id="Other keywords" color="#400080" font-weight="bold" font-style="italic">
+ <string>de_DE</string>
+ <string>en_GB</string>
+ </keywords>
+
+
+ <!--
+ The <state> tag specifies a state other than the default state.
+ It features the same attributes as <default>.
+ It has to contain a <begin> and a <end> tag which in turn have to
+ contain a <regex> tag. They can contain <keywords> tags like specified above.
+
+ For example here a states for C blockcomments, C++ singleline comments and strings.
+ The strings state handles escaped quotes with a lookbehind regular expression
+ (see a regex tutorial) and colors "foobar" with strings.
+ -->
+
+
+ <state id="Comment" color="#236E25" font-style="italic">
+ <begin><regex>/\*</regex></begin>
+ <end><regex>\*/</regex></end>
+ </state>
+
+ <state id="SingleComment" color="#236E25" font-style="italic">
+ <begin><regex>//</regex></begin>
+ <end><regex>[\n\r]</regex></end>
+ </state>
+
+ <state id="String" color="#760f15">
+ <begin><regex>"</regex></begin>
+ <end><regex>(((?&lt;!\\)(\\\\)*)|^)"</regex></end>
+ <keywords id="Other keywords" color="#400080" font-style="italic">
+ <string>foobar</string>
+ </keywords>
+ </state>
+
+ <!--
+ The <import> tag lets you import substates and keywords from other modes.
+ It features the following attributes, all optional if not noted otherwise:
+
+ mode
+ the mode to import from if left out it will import from this mode
+
+ state
+ the state to import - if left out the content of the
+ default state will be imported
+
+ keywords-only
+ 'yes' if you only want to import the keywords and not the substates
+ of that state
+
+ -->
+
+ <state id="Inline Javascript" color="#000" usesymbolsfrommode="Javascript" useautocompletefrommode="Javascript">
+ <begin><regex>&lt;(?=script)</regex></begin>
+ <end><regex>/script&gt;</regex></end>
+
+ <import mode="Javascript" />
+
+ <keywords id="Script Tags" color="#881280" font-style="italic">
+ <regex>(\A&lt;\Z)</regex>
+ <regex>(&lt;/script[^&gt;]*&gt;)</regex>
+ </keywords>
+
+ <state id="Opening Script Tag" color="#881280" font-style="italic" usesymbolsfrommode="HTML" useautocompletefrommode="HTML">
+ <begin><regex>\Ascript</regex></begin>
+ <end><regex>&gt;</regex></end>
+
+ <import mode="XML" state="Tags" />
+ </state>
+
+ </state>
+
+ <!--
+ The <state-link> tag lets you reuse complete states including the
+ begin and end regex as well as the attributes on the linked .
+ It features the following attributes, all optional if not noted otherwise:
+
+ state
+ the state to link - not optional
+
+ mode
+ the mode to import from if left out it will import from this mode
+
+
+ -->
+ <state-link state="PHP" mode="PHP-HTML" />
+
+ </default>
+
+ </states>
+
+</syntax>
@@ -0,0 +1,3 @@
+---
+en_GB:
+ key: Value
@@ -0,0 +1,17 @@
+h1. YAML.mode
+
+YAML.mode is a YAML syntax definition for SubEthaEdit & Coda. This is a work in progress so please be patient ;)
+
+h2. Usage
+
+h3. Installation
+
+Simply check out this repo into either <code>~/Library/Application Support/Coda/Modes</code> or <code>~/Library/Application Support/SubEthaEdit/Modes</code>, be sure to name the directory <code>HAML.mode</code>.
+
+h2. Author
+
+Written by StuFF mc - "Pomcast.biz":http://pomcast.biz/
+
+h3. Credits
+
+Thanks to "Panic":http://www.panic.com/ for creating a kick-ass IDE! But also to "The Coding Monkeys":http://codingmonkeys.de for previously doing a kick-ass text editor! Finally, thanks to "the HAML.mode creator":http://github.com/gf3/haml.mode for being the inspiration of this README :-)

0 comments on commit 9fd8edd

Please sign in to comment.