ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* ConTeXt syntax file for KDE Kate
@ 2002-04-03 17:20 Henning Hraban Ramm
  2002-04-04  8:48 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Henning Hraban Ramm @ 2002-04-03 17:20 UTC (permalink / raw)


Ahoi!

I'd like to adapt the syntax highlighting of the Kate editor.
But my understanding of XML is too poor...
I just changed some things from the LaTeX mode, as far as I understood.

--- context.xml ---------
<?xml version="1.01" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="ConTeXt" section="Markup" 
extensions="*.tex;*.TEX" mimetype="text/x-tex" casesensitive="1">
  <highlighting>
    <list name="keywords">
      <item> start</item>
      <item> itemize</item>
      <item>TeX</item>

<!-- missing long list of items -- is there a way to get all ConTeXt commands 
as list? -->

      </list>
    <contexts>

	<context attribute="0" lineEndContext="0">
        	<StringDetect String="\start" attribute="4" context="1" 
insensitive="FALSE"/>
        	<StringDetect String="\stop" attribute="4" context="1" 
insensitive="FALSE"/>
		<DetectChar char="\" attribute="2" context="2" />
		<RegExpr String="%.*$" attribute="3" context="0"/>
	</context>

<!-- What must I do here above? -->

	<context attribute="0" lineEndContext="1">
		<keyword String="keywords" attribute="1" context="1"/>
		<DetectChar char="}" attribute="4" context="0"/>
	</context>
	<context attribute="0" lineEndContext="0">
		<keyword String="keywords" attribute="2" context="0" />
	</context>
    </contexts>
    <itemDatas>
      <itemData name="Normal Text" defStyleNum="dsNormal"/>
      <itemData name="Keyword" defStyleNum="dsNormal" color="#0000ff" 
selColor="#ff0000" bold="1" italic="1"/>
      <itemData name="Comment" defStyleNum="dsComment"/>
      <itemData name="Begin End" defStyleNum="dsNormal" color="#000000" 
selColor="#ffffff" bold="1" italic="1"/>

    </itemDatas>
  </highlighting>
  <general>
    <comments>
      <comment name="singleLine" start="%" />
    </comments>
  </general>
</language>
------------------ end of context.xml ----

---- language.dtd ----

<!ELEMENT language (highlighting, general?)>
<!ATTLIST language
  name CDATA #REQUIRED
  section (Sources|Markup|Other|Scripts) #REQUIRED
  extensions CDATA #REQUIRED
  mimetype CDATA #REQUIRED
  casesensitive (0|1) #IMPLIED
>

<!ELEMENT general (comments?, keywords?)>
<!ATTLIST general
>

<!ELEMENT comments (comment)+>
<!ATTLIST comments
>

<!ELEMENT comment EMPTY>
<!ATTLIST comment
  name (singleLine|multiLine) #REQUIRED
  start CDATA #REQUIRED
  end CDATA #IMPLIED
>

<!ELEMENT keywords EMPTY>
<!ATTLIST keywords
  casesensitive CDATA #IMPLIED
  weakDeliminator CDATA #IMPLIED
>

<!ELEMENT highlighting (list*, contexts, itemDatas)>
<!ATTLIST highlighting
>

<!ELEMENT list (item)+>
<!ATTLIST list
  name (types|keywords|attribute-definitions|literals|definitions) #REQUIRED
>

<!ELEMENT item (#PCDATA)>

<!ELEMENT contexts (context)+>

<!ELEMENT context (keyword | Float | HlCOct | HlCHex | Int | DetectChar | 
Detect2Chars | AnyChar | StringDetect | RegExpr | LineContinue | 
HlCStringChar | RangeDetect | HlCChar)*>
<!ATTLIST context
  attribute CDATA #REQUIRED
  lineEndContext NMTOKEN #REQUIRED
  lineBeginContext NMTOKEN #IMPLIED
  name CDATA #IMPLIED
>

<!ELEMENT keyword EMPTY>
<!ATTLIST keyword
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
  String (types|keywords|attribute-definitions|literals|definitions) #REQUIRED
  weakDelimiter CDATA #IMPLIED
>

<!ELEMENT Float (AnyChar)*>
<!ATTLIST Float
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
>

<!ELEMENT HlCOct EMPTY>
<!ATTLIST HlCOct
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
>

<!ELEMENT HlCHex EMPTY>
<!ATTLIST HlCHex
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
>

<!ELEMENT HlCChar EMPTY>
<!ATTLIST HlCChar
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
>

<!ELEMENT Int (StringDetect)*>
<!ATTLIST Int
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
>

<!ELEMENT DetectChar EMPTY>
<!ATTLIST DetectChar
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
  char CDATA #REQUIRED
>

<!ELEMENT Detect2Chars EMPTY>
<!ATTLIST Detect2Chars
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
  char CDATA #REQUIRED
  char1 CDATA #REQUIRED
>

<!ELEMENT AnyChar EMPTY>
<!ATTLIST AnyChar
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
  String CDATA #REQUIRED
>

<!ELEMENT StringDetect EMPTY>
<!ATTLIST StringDetect
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
  String CDATA #REQUIRED
  insensitive (TRUE|FALSE) #REQUIRED
>

<!ELEMENT RegExpr EMPTY>
<!ATTLIST RegExpr
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
  String CDATA #REQUIRED
>

<!ELEMENT LineContinue EMPTY>
<!ATTLIST LineContinue
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
>

<!ELEMENT HlCStringChar EMPTY>
<!ATTLIST HlCStringChar
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
>

<!ELEMENT RangeDetect EMPTY>
<!ATTLIST RangeDetect
  attribute CDATA #REQUIRED
  context NMTOKEN #REQUIRED
  char CDATA #REQUIRED
  char1 CDATA #REQUIRED
>

<!ELEMENT itemDatas (itemData)+>
<!ATTLIST itemDatas
>

<!ELEMENT itemData EMPTY>
<!ATTLIST itemData
  name CDATA #REQUIRED
  defStyleNum CDATA #REQUIRED
  color CDATA #IMPLIED
  selColor CDATA #IMPLIED
  italic CDATA #IMPLIED
  bold CDATA #IMPLIED
>

---- end of DTD -----------


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-04-07 19:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-03 17:20 ConTeXt syntax file for KDE Kate Henning Hraban Ramm
2002-04-04  8:48 ` Hans Hagen
2002-04-04 10:17   ` Patrick Gundlach
2002-04-04 12:17     ` Taco Hoekwater
2002-04-07 19:05       ` Henning Hraban Ramm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).