From 23bcb7d2f5bc5e894251a73133048e561c63aa7f Mon Sep 17 00:00:00 2001 From: Edoardo Tenani Date: Wed, 28 Jan 2015 11:38:20 +0100 Subject: Add arduino lexer and style --- pygments/styles/arduino.py | 97 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 pygments/styles/arduino.py (limited to 'pygments/styles/arduino.py') diff --git a/pygments/styles/arduino.py b/pygments/styles/arduino.py new file mode 100644 index 00000000..f6bcd1cd --- /dev/null +++ b/pygments/styles/arduino.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +""" + pygments.styles.arduino + ~~~~~~~~~~~~~~~~~~~~~~~ + + Arduino® Syntax highlighting style. + + :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +class ArduinoStyle(Style): + """ + The Arduino® language style. This style is designed to highlight the Arduino source code, so exepect the best results with it. + """ + + background_color = "#ffffff" + default_style = "" + + styles = { + Whitespace: "", # class: 'w' + Error: "#a61717", # class: 'err' + + Comment: "#95a5a6", # class: 'c' + Comment.Multiline: "", # class: 'cm' + Comment.Preproc: "#434f54", # class: 'cp' + Comment.Single: "", # class: 'c1' + Comment.Special: "", # class: 'cs' + + Keyword: "#728E00", # class: 'k' + Keyword.Constant: "#00979D", # class: 'kc' + Keyword.Declaration: "", # class: 'kd' + Keyword.Namespace: "", # class: 'kn' + Keyword.Pseudo: "#00979D", # class: 'kp' + Keyword.Reserved: "", # class: 'kr' + Keyword.Type: "#00979D", # class: 'kt' + + Operator: "#434f54", # class: 'o' + Operator.Word: "", # class: 'ow' + + Name: "#434f54", # class: 'n' + Name.Attribute: "", # class: 'na' + Name.Builtin: "", # class: 'nb' + Name.Builtin.Pseudo: "", # class: 'bp' + Name.Class: "", # class: 'nc' + Name.Constant: "", # class: 'no' + Name.Decorator: "", # class: 'nd' + Name.Entity: "", # class: 'ni' + Name.Exception: "", # class: 'ne' + Name.Function: "#D35400", # class: 'nf' + Name.Property: "", # class: 'py' + Name.Label: "", # class: 'nl' + Name.Namespace: "", # class: 'nn' + Name.Other: "#728E00", # class: 'nx' + Name.Tag: "", # class: 'nt' + Name.Variable: "", # class: 'nv' + Name.Variable.Class: "", # class: 'vc' + Name.Variable.Global: "", # class: 'vg' + Name.Variable.Instance: "", # class: 'vi' + + Number: "#434f54", # class: 'm' + Number.Float: "", # class: 'mf' + Number.Hex: "", # class: 'mh' + Number.Integer: "", # class: 'mi' + Number.Integer.Long: "", # class: 'il' + Number.Oct: "", # class: 'mo' + + String: "#7F8C8D", # class: 's' + String.Backtick: "", # class: 'sb' + String.Char: "", # class: 'sc' + String.Doc: "", # class: 'sd' + String.Double: "", # class: 's2' + String.Escape: "", # class: 'se' + String.Heredoc: "", # class: 'sh' + String.Interpol: "", # class: 'si' + String.Other: "", # class: 'sx' + String.Regex: "", # class: 'sr' + String.Single: "", # class: 's1' + String.Symbol: "", # class: 'ss' + + Generic: "", # class: 'g' + Generic.Deleted: "", # class: 'gd', + Generic.Emph: "", # class: 'ge' + Generic.Error: "", # class: 'gr' + Generic.Heading: "", # class: 'gh' + Generic.Inserted: "", # class: 'gi' + Generic.Output: "", # class: 'go' + Generic.Prompt: "", # class: 'gp' + Generic.Strong: "", # class: 'gs' + Generic.Subheading: "", # class: 'gu' + Generic.Traceback: "", # class: 'gt' + } -- cgit v1.2.1 From c6cfc1da86412450f5dc48c8025ab42d04c907f6 Mon Sep 17 00:00:00 2001 From: Tim Hatch Date: Wed, 14 Oct 2015 11:54:55 -0700 Subject: Cleanups in preparation for 2.1 release. --- pygments/styles/arduino.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pygments/styles/arduino.py') diff --git a/pygments/styles/arduino.py b/pygments/styles/arduino.py index f6bcd1cd..cb4d17b0 100644 --- a/pygments/styles/arduino.py +++ b/pygments/styles/arduino.py @@ -16,7 +16,8 @@ from pygments.token import Keyword, Name, Comment, String, Error, \ class ArduinoStyle(Style): """ - The Arduino® language style. This style is designed to highlight the Arduino source code, so exepect the best results with it. + The Arduino® language style. This style is designed to highlight the + Arduino source code, so exepect the best results with it. """ background_color = "#ffffff" -- cgit v1.2.1 From e1c47b6387bfe11577bb43fbdfadef857b49fec4 Mon Sep 17 00:00:00 2001 From: Edoardo Tenani Date: Wed, 27 Jan 2016 19:09:32 +0100 Subject: Update ArduinoStyle --- pygments/styles/arduino.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pygments/styles/arduino.py') diff --git a/pygments/styles/arduino.py b/pygments/styles/arduino.py index cb4d17b0..5b31bb84 100644 --- a/pygments/styles/arduino.py +++ b/pygments/styles/arduino.py @@ -29,7 +29,7 @@ class ArduinoStyle(Style): Comment: "#95a5a6", # class: 'c' Comment.Multiline: "", # class: 'cm' - Comment.Preproc: "#434f54", # class: 'cp' + Comment.Preproc: "#728E00", # class: 'cp' Comment.Single: "", # class: 'c1' Comment.Special: "", # class: 'cs' @@ -38,15 +38,15 @@ class ArduinoStyle(Style): Keyword.Declaration: "", # class: 'kd' Keyword.Namespace: "", # class: 'kn' Keyword.Pseudo: "#00979D", # class: 'kp' - Keyword.Reserved: "", # class: 'kr' + Keyword.Reserved: "#00979D", # class: 'kr' Keyword.Type: "#00979D", # class: 'kt' - Operator: "#434f54", # class: 'o' + Operator: "#728E00", # class: 'o' Operator.Word: "", # class: 'ow' Name: "#434f54", # class: 'n' Name.Attribute: "", # class: 'na' - Name.Builtin: "", # class: 'nb' + Name.Builtin: "#728E00", # class: 'nb' Name.Builtin.Pseudo: "", # class: 'bp' Name.Class: "", # class: 'nc' Name.Constant: "", # class: 'no' @@ -64,7 +64,7 @@ class ArduinoStyle(Style): Name.Variable.Global: "", # class: 'vg' Name.Variable.Instance: "", # class: 'vi' - Number: "#434f54", # class: 'm' + Number: "#8A7B52", # class: 'm' Number.Float: "", # class: 'mf' Number.Hex: "", # class: 'mh' Number.Integer: "", # class: 'mi' @@ -95,4 +95,4 @@ class ArduinoStyle(Style): Generic.Strong: "", # class: 'gs' Generic.Subheading: "", # class: 'gu' Generic.Traceback: "", # class: 'gt' - } + } \ No newline at end of file -- cgit v1.2.1