summaryrefslogtreecommitdiff
path: root/dot_local/share/gtksourceview-4/language-specs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dot_local/share/gtksourceview-4/language-specs/.keep0
-rw-r--r--dot_local/share/gtksourceview-4/language-specs/gemini.lang91
2 files changed, 91 insertions, 0 deletions
diff --git a/dot_local/share/gtksourceview-4/language-specs/.keep b/dot_local/share/gtksourceview-4/language-specs/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dot_local/share/gtksourceview-4/language-specs/.keep
diff --git a/dot_local/share/gtksourceview-4/language-specs/gemini.lang b/dot_local/share/gtksourceview-4/language-specs/gemini.lang
new file mode 100644
index 0000000..c9278f5
--- /dev/null
+++ b/dot_local/share/gtksourceview-4/language-specs/gemini.lang
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- v0.14.2 -->
+<language id="gemini" name="Gemini" version="2.0" _section="Markup">
+ <metadata>
+ <property name="mimetypes">text/gemini</property>
+ <property name="globs">*.gmi</property>
+ </metadata>
+
+ <styles>
+ <style id="link-marker" name="Link Marker" map-to="def:link-symbol" />
+ <style id="link" name="Link" map-to="def:link-destination" />
+ <style id="link-title" name="Link Title" map-to="def:link-text" />
+
+ <style id="pre" name="Preformatted" map-to="def:preformatted-section" />
+ <style id="pre-alt" name="Preformatted Alt Text" map-to="def:emphasis" />
+
+ <style id="header" name="Header" map-to="def:heading" />
+
+ <style id="list" name="Unordered List" map-to="def:list-marker" />
+
+ <style id="blockquote" name="Blockquote" map-to="def:insertion" />
+ </styles>
+
+ <definitions>
+ <!-- Examples:
+ => url Link
+ => url
+ =>url Link
+ =>url
+ -->
+ <context id="link">
+ <match extended="true">
+ ^
+ (=>) # identifier
+ [ ]? # optional whitespace
+ (\S+) # the link
+ ( .*)? # the title
+ $
+ </match>
+ <include>
+ <context sub-pattern="1" style-ref="link-marker" />
+ <context sub-pattern="2" class="no-spell-check" style-ref="link" />
+ <context sub-pattern="3" style-ref="link-title" />
+ </include>
+ </context>
+
+ <!-- Starts with ``` and ends with ``` -->
+ <context id="pre" class="no-spell-check" style-ref="pre">
+ <start>^```(.*)$</start>
+ <end>^```</end> <!-- technically it's not valid to have anything after this, but the failure conditional is undesirable -->
+ <include>
+ <context sub-pattern="1" where="start" style-ref="pre-alt" />
+ </include>
+ </context>
+
+ <!-- Examples:
+ # Header 1
+ ## Header 2
+ ###Header 3
+ -->
+ <context id="header" style-ref="header">
+ <match>^#{1,3}.+$</match>
+ </context>
+
+ <!-- Examples:
+ * list1
+ * list2
+ -->
+ <context id="list" style-ref="list">
+ <match>^\* </match>
+ </context>
+
+ <!-- Examples:
+ > line1
+ > an entirely unrelated line
+ -->
+ <context id="blockquote" style-ref="blockquote">
+ <match>^>.+$</match>
+ </context>
+
+ <context id="gemini">
+ <include>
+ <context ref="link" />
+ <context ref="pre" />
+ <context ref="header" />
+ <context ref="list" />
+ <context ref="blockquote" />
+ </include>
+ </context>
+ </definitions>
+</language>