diff options
| author | blackbird <devnull@localhost> | 2007-01-20 18:34:13 +0100 |
|---|---|---|
| committer | blackbird <devnull@localhost> | 2007-01-20 18:34:13 +0100 |
| commit | ed188fd9f6fc0f5adaec44daca32d6bcfff5ce80 (patch) | |
| tree | 95f7fbbb082844682ecf2e74a4b289760aac6891 /docs | |
| parent | 48588688b32b374c7edeee945336cc83eaa38a74 (diff) | |
| download | pygments-ed188fd9f6fc0f5adaec44daca32d6bcfff5ce80.tar.gz | |
[svn] various changes in pygments (does also affect the docs)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/src/tokens.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/src/tokens.txt b/docs/src/tokens.txt index 853bf2cb..22ccccea 100644 --- a/docs/src/tokens.txt +++ b/docs/src/tokens.txt @@ -81,6 +81,21 @@ of those token aliases, a number of subtypes exists (excluding the special token The `is_token_subtype()` function in the `pygments.token` module can be used to test if a token type is a subtype of another (such as `Name.Tag` and `Name`). +(This is the same as ``Name.Tag in Name``. The in operator was newly introduced +in pygments 0.7, the function still exists for backwards compatiblity) + +With pygments 0.7 it's also possible to convert token from strings (for example +if you want to supply a token from the command line): + +.. sourcecode:: pycon + + >>> from pygments.token import String, string_to_token + >>> string_to_token("String") + Token.Literal.String + >>> string_to_token("Token.Literal.String") + Token.Literal.String + >>> string_to_token(String) + Token.Literal.String Keyword Tokens |
