diff --git a/README.md b/README.md index 6a7c77d24..c272c03ea 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ translators for Pygments lexers and styles. | A | ABAP, ABNF, ActionScript, ActionScript 3, Ada, Agda, AL, Alloy, Angular2, ANTLR, ApacheConf, APL, AppleScript, ArangoDB AQL, Arduino, ArmAsm, AutoHotkey, AutoIt, Awk | | B | Ballerina, Bash, Bash Session, Batchfile, BibTeX, Bicep, BlitzBasic, BNF, BQN, Brainfuck | | C | C, C#, C++, Caddyfile, Caddyfile Directives, Cap'n Proto, Cassandra CQL, Ceylon, CFEngine3, cfstatement, ChaiScript, Chapel, Cheetah, Clojure, CMake, COBOL, CoffeeScript, Common Lisp, Coq, Crystal, CSS, Cython | -| D | D, Dart, Dax, Diff, Django/Jinja, dns, Docker, DTD, Dylan | +| D | D, Dart, Dax, Desktop Entry, Diff, Django/Jinja, dns, Docker, DTD, Dylan | | E | EBNF, Elixir, Elm, EmacsLisp, Erlang | | F | Factor, Fennel, Fish, Forth, Fortran, FortranFixed, FSharp | | G | GAS, GDScript, Genshi, Genshi HTML, Genshi Text, Gherkin, GLSL, Gnuplot, Go, Go HTML Template, Go Text Template, GraphQL, Groff, Groovy | diff --git a/lexers/embedded/desktop_entry.xml b/lexers/embedded/desktop_entry.xml new file mode 100644 index 000000000..ad71ad471 --- /dev/null +++ b/lexers/embedded/desktop_entry.xml @@ -0,0 +1,17 @@ + + + Desktop file + desktop + desktop_entry + *.desktop + application/x-desktop + + + + + + + + + + \ No newline at end of file diff --git a/lexers/testdata/desktop_entry.actual b/lexers/testdata/desktop_entry.actual new file mode 100644 index 000000000..1c2a4682e --- /dev/null +++ b/lexers/testdata/desktop_entry.actual @@ -0,0 +1,8 @@ +# Created with jdDesktopEntryEdit 1.3 +[Desktop Entry] +Type=Application +Name=Chroma +Comment= A general purpose syntax highlighter in pure Go +TryExec=chroma +Exec=chroma +Terminal=true diff --git a/lexers/testdata/desktop_entry.expected b/lexers/testdata/desktop_entry.expected new file mode 100644 index 000000000..be9442ea5 --- /dev/null +++ b/lexers/testdata/desktop_entry.expected @@ -0,0 +1,31 @@ +[ + {"type":"CommentSingle","value":"# Created with jdDesktopEntryEdit 1.3"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"[Desktop Entry]"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameAttribute","value":"Type"}, + {"type":"Operator","value":"="}, + {"type":"LiteralString","value":"Application"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameAttribute","value":"Name"}, + {"type":"Operator","value":"="}, + {"type":"LiteralString","value":"Chroma"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameAttribute","value":"Comment"}, + {"type":"Operator","value":"="}, + {"type":"TextWhitespace","value":" "}, + {"type":"LiteralString","value":"A general purpose syntax highlighter in pure Go"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameAttribute","value":"TryExec"}, + {"type":"Operator","value":"="}, + {"type":"LiteralString","value":"chroma"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameAttribute","value":"Exec"}, + {"type":"Operator","value":"="}, + {"type":"LiteralString","value":"chroma"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameAttribute","value":"Terminal"}, + {"type":"Operator","value":"="}, + {"type":"LiteralString","value":"true"}, + {"type":"TextWhitespace","value":"\n"} +]