Documentation/Source/eric4.QScintilla.Lexers.LexerPygments.html

changeset 3
0d9daebf5b8c
equal deleted inserted replaced
2:bc6196164237 3:0d9daebf5b8c
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4 <html><head>
5 <title>eric4.QScintilla.Lexers.LexerPygments</title>
6 <style>
7 body {
8 background:white;
9 margin: 0em 1em 10em 1em;
10 color: black;
11 }
12
13 h1 { color: white; background: #4FA4FF; }
14 h2 { color: white; background: #4FA4FF; }
15 h3 { color: white; background: #00557F; }
16 h4 { color: white; background: #00557F; }
17
18 a { color: #AA5500; }
19
20 </style>
21 </head>
22 <body><a NAME="top" ID="top"></a>
23 <h1>eric4.QScintilla.Lexers.LexerPygments</h1>
24 <p>
25 Module implementing a custom lexer using pygments.
26 </p>
27 <h3>Global Attributes</h3>
28 <table>
29 <tr><td>PYGMENTS_ERROR</td></tr><tr><td>PYGMENTS_INSERTED</td></tr><tr><td>TOKEN_MAP</td></tr>
30 </table>
31 <h3>Classes</h3>
32 <table>
33 <tr>
34 <td><a href="#LexerPygments">LexerPygments</a></td>
35 <td>Class implementing a custom lexer using pygments.</td>
36 </tr>
37 </table>
38 <h3>Functions</h3>
39 <table>
40 <tr><td>None</td></tr>
41 </table>
42 <hr /><hr />
43 <a NAME="LexerPygments" ID="LexerPygments"></a>
44 <h2>LexerPygments</h2>
45 <p>
46
47 </p><p>
48 Class implementing a custom lexer using pygments.
49 </p>
50 <h3>Derived from</h3>
51 LexerContainer
52 <h3>Class Attributes</h3>
53 <table>
54 <tr><td>None</td></tr>
55 </table>
56 <h3>Methods</h3>
57 <table>
58 <tr>
59 <td><a href="#LexerPygments.__init__">LexerPygments</a></td>
60 <td>Constructor</td>
61 </tr><tr>
62 <td><a href="#LexerPygments.__guessLexer">__guessLexer</a></td>
63 <td>Private method to guess a pygments lexer.</td>
64 </tr><tr>
65 <td><a href="#LexerPygments.canStyle">canStyle</a></td>
66 <td>Public method to check, if the lexer is able to style the text.</td>
67 </tr><tr>
68 <td><a href="#LexerPygments.defaultColor">defaultColor</a></td>
69 <td>Public method to get the default foreground color for a style.</td>
70 </tr><tr>
71 <td><a href="#LexerPygments.defaultFont">defaultFont</a></td>
72 <td>Public method to get the default font for a style.</td>
73 </tr><tr>
74 <td><a href="#LexerPygments.defaultPaper">defaultPaper</a></td>
75 <td>Public method to get the default background color for a style.</td>
76 </tr><tr>
77 <td><a href="#LexerPygments.description">description</a></td>
78 <td>Public method returning the descriptions of the styles supported by the lexer.</td>
79 </tr><tr>
80 <td><a href="#LexerPygments.isCommentStyle">isCommentStyle</a></td>
81 <td>Public method to check, if a style is a comment style.</td>
82 </tr><tr>
83 <td><a href="#LexerPygments.isStringStyle">isStringStyle</a></td>
84 <td>Public method to check, if a style is a string style.</td>
85 </tr><tr>
86 <td><a href="#LexerPygments.language">language</a></td>
87 <td>Public method returning the language of the lexer.</td>
88 </tr><tr>
89 <td><a href="#LexerPygments.name">name</a></td>
90 <td>Public method to get the name of the pygments lexer.</td>
91 </tr><tr>
92 <td><a href="#LexerPygments.styleBitsNeeded">styleBitsNeeded</a></td>
93 <td>Public method to get the number of style bits needed by the lexer.</td>
94 </tr><tr>
95 <td><a href="#LexerPygments.styleText">styleText</a></td>
96 <td>Public method to perform the styling.</td>
97 </tr>
98 </table>
99 <a NAME="LexerPygments.__init__" ID="LexerPygments.__init__"></a>
100 <h4>LexerPygments (Constructor)</h4>
101 <b>LexerPygments</b>(<i>parent = None, name = ""</i>)
102 <p>
103 Constructor
104 </p><dl>
105 <dt><i>parent</i></dt>
106 <dd>
107 parent widget of this lexer
108 </dd><dt><i>name=</i></dt>
109 <dd>
110 name of the pygments lexer to use (string)
111 </dd>
112 </dl><a NAME="LexerPygments.__guessLexer" ID="LexerPygments.__guessLexer"></a>
113 <h4>LexerPygments.__guessLexer</h4>
114 <b>__guessLexer</b>(<i>text</i>)
115 <p>
116 Private method to guess a pygments lexer.
117 </p><dl>
118 <dt><i>text</i></dt>
119 <dd>
120 text to base guessing on (string)
121 </dd>
122 </dl><dl>
123 <dt>Returns:</dt>
124 <dd>
125 reference to the guessed lexer (pygments.lexer)
126 </dd>
127 </dl><a NAME="LexerPygments.canStyle" ID="LexerPygments.canStyle"></a>
128 <h4>LexerPygments.canStyle</h4>
129 <b>canStyle</b>(<i></i>)
130 <p>
131 Public method to check, if the lexer is able to style the text.
132 </p><dl>
133 <dt>Returns:</dt>
134 <dd>
135 flag indicating the lexer capability (boolean)
136 </dd>
137 </dl><a NAME="LexerPygments.defaultColor" ID="LexerPygments.defaultColor"></a>
138 <h4>LexerPygments.defaultColor</h4>
139 <b>defaultColor</b>(<i>style</i>)
140 <p>
141 Public method to get the default foreground color for a style.
142 </p><dl>
143 <dt><i>style</i></dt>
144 <dd>
145 style number (integer)
146 </dd>
147 </dl><dl>
148 <dt>Returns:</dt>
149 <dd>
150 foreground color (QColor)
151 </dd>
152 </dl><a NAME="LexerPygments.defaultFont" ID="LexerPygments.defaultFont"></a>
153 <h4>LexerPygments.defaultFont</h4>
154 <b>defaultFont</b>(<i>style</i>)
155 <p>
156 Public method to get the default font for a style.
157 </p><dl>
158 <dt><i>style</i></dt>
159 <dd>
160 style number (integer)
161 </dd>
162 </dl><dl>
163 <dt>Returns:</dt>
164 <dd>
165 font (QFont)
166 </dd>
167 </dl><a NAME="LexerPygments.defaultPaper" ID="LexerPygments.defaultPaper"></a>
168 <h4>LexerPygments.defaultPaper</h4>
169 <b>defaultPaper</b>(<i>style</i>)
170 <p>
171 Public method to get the default background color for a style.
172 </p><dl>
173 <dt><i>style</i></dt>
174 <dd>
175 style number (integer)
176 </dd>
177 </dl><dl>
178 <dt>Returns:</dt>
179 <dd>
180 background color (QColor)
181 </dd>
182 </dl><a NAME="LexerPygments.description" ID="LexerPygments.description"></a>
183 <h4>LexerPygments.description</h4>
184 <b>description</b>(<i>style</i>)
185 <p>
186 Public method returning the descriptions of the styles supported
187 by the lexer.
188 </p><dl>
189 <dt><i>style</i></dt>
190 <dd>
191 style number (integer)
192 </dd>
193 </dl><dl>
194 <dt>Returns:</dt>
195 <dd>
196 description for the style (string)
197 </dd>
198 </dl><a NAME="LexerPygments.isCommentStyle" ID="LexerPygments.isCommentStyle"></a>
199 <h4>LexerPygments.isCommentStyle</h4>
200 <b>isCommentStyle</b>(<i>style</i>)
201 <p>
202 Public method to check, if a style is a comment style.
203 </p><dl>
204 <dt>Returns:</dt>
205 <dd>
206 flag indicating a comment style (boolean)
207 </dd>
208 </dl><a NAME="LexerPygments.isStringStyle" ID="LexerPygments.isStringStyle"></a>
209 <h4>LexerPygments.isStringStyle</h4>
210 <b>isStringStyle</b>(<i>style</i>)
211 <p>
212 Public method to check, if a style is a string style.
213 </p><dl>
214 <dt>Returns:</dt>
215 <dd>
216 flag indicating a string style (boolean)
217 </dd>
218 </dl><a NAME="LexerPygments.language" ID="LexerPygments.language"></a>
219 <h4>LexerPygments.language</h4>
220 <b>language</b>(<i></i>)
221 <p>
222 Public method returning the language of the lexer.
223 </p><dl>
224 <dt>Returns:</dt>
225 <dd>
226 language of the lexer (string)
227 </dd>
228 </dl><a NAME="LexerPygments.name" ID="LexerPygments.name"></a>
229 <h4>LexerPygments.name</h4>
230 <b>name</b>(<i></i>)
231 <p>
232 Public method to get the name of the pygments lexer.
233 </p><dl>
234 <dt>Returns:</dt>
235 <dd>
236 name of the pygments lexer (string)
237 </dd>
238 </dl><a NAME="LexerPygments.styleBitsNeeded" ID="LexerPygments.styleBitsNeeded"></a>
239 <h4>LexerPygments.styleBitsNeeded</h4>
240 <b>styleBitsNeeded</b>(<i></i>)
241 <p>
242 Public method to get the number of style bits needed by the lexer.
243 </p><dl>
244 <dt>Returns:</dt>
245 <dd>
246 number of style bits needed (integer)
247 </dd>
248 </dl><a NAME="LexerPygments.styleText" ID="LexerPygments.styleText"></a>
249 <h4>LexerPygments.styleText</h4>
250 <b>styleText</b>(<i>start, end</i>)
251 <p>
252 Public method to perform the styling.
253 </p><dl>
254 <dt><i>start</i></dt>
255 <dd>
256 position of first character to be styled (integer)
257 </dd><dt><i>end</i></dt>
258 <dd>
259 position of last character to be styled (integer)
260 </dd>
261 </dl>
262 <div align="right"><a href="#top">Up</a></div>
263 <hr />
264 </body></html>

eric ide

mercurial