pax_global_header00006660000000000000000000000064144125102710014507gustar00rootroot0000000000000052 comment=2e6aaf5529657df6117a0075fb49954f773da397 makeup-1.1.1/000077500000000000000000000000001441251027100127715ustar00rootroot00000000000000makeup-1.1.1/.ex_doc.exs000066400000000000000000000001411441251027100150250ustar00rootroot00000000000000[ main: "readme", extras: [ "CHANGELOG.md", "CONTRIBUTING.md", "README.md" ] ] makeup-1.1.1/.github/000077500000000000000000000000001441251027100143315ustar00rootroot00000000000000makeup-1.1.1/.github/workflows/000077500000000000000000000000001441251027100163665ustar00rootroot00000000000000makeup-1.1.1/.github/workflows/ci.yml000066400000000000000000000016501441251027100175060ustar00rootroot00000000000000name: CI on: pull_request: push: branches: - master jobs: test: runs-on: ubuntu-latest env: MIX_ENV: test strategy: fail-fast: false matrix: include: - pair: elixir: 1.6.6 otp: 20.3 - pair: elixir: 1.13.3 otp: 24.2.1 lint: lint steps: - uses: actions/checkout@v2 - uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.pair.otp}} elixir-version: ${{matrix.pair.elixir}} - name: Install Dependencies run: mix deps.get --only test # - run: mix format --check-formatted # if: ${{ matrix.lint }} - run: mix deps.get && mix deps.unlock --check-unused if: ${{ matrix.lint }} - run: mix deps.compile - run: mix compile --warnings-as-errors if: ${{ matrix.lint }} - run: mix test makeup-1.1.1/.gitignore000066400000000000000000000011631441251027100147620ustar00rootroot00000000000000# The directory Mix will write compiled artifacts to. /_build/ # If you run "mix test --cover", coverage assets end up here. /cover/ # The directory Mix downloads your dependencies sources to. /deps/ # Where 3rd-party dependencies like ExDoc output generated docs. /doc/ # Ignore .fetch files in case you like to edit your project deps locally. /.fetch # If the VM crashes, it generates a dump, let's ignore it too. erl_crash.dump # Also ignore archive artifacts (built via "mix archive.build"). *.ez # IPython notebook backups .ipynb_checkpoints/** # VSCode project folder .vscode/** # Elixir liveserver .elixir_ls/**makeup-1.1.1/CHANGELOG.md000066400000000000000000000054421441251027100146070ustar00rootroot00000000000000# Changelog ### 1.1.0 - 2023-03-04 Reduce module footprint. ### 1.1.0 - 2022-02-12 Require NimbleParsec `~> 1.2.2` onwards to prepare for future deprecations. ### 1.0.5 - 2020-10-02 #### Bugfix #1 Fix serious bug in the `Makeup.Lexer.Combinators.lexeme/1` when given a list of unicode characters. Before this fix, the following combinator: ``` import Makeup.Lexer.Combinators characters_lexeme = utf8_char([]) |> utf8_char([]) |> lexeme() |> token(:character_lexeme) ``` when given as input a string like `"àó"` would return the following invalid Unicode: ``` [{:character_lexeme, %{}, <<225, 242>>}] ``` instead of ``` [{:character_lexeme, %{}, "áò"}] ``` This was caused by the use of `IO.iodata_to_binary/1` instead of (the slower) `to_string()`. This was a problem because `IO.iodata_to_binary/1` would put any byte in a binary instead of (correctly) encoding bytes > 128 as a Unicode character. This is not a problem with `IO.iodata_to_binary/1` it's a problem with using that function when we want to encode characters as Unicode strings. #### Bugfix #2 Fixed an edge case in the HTML encoder in the formatter. ### 1.0.4 - 2020-09-25 Fix warnings and update NimbleParsec dependency. ### 1.0.3 - 2020-06-07 Allow styles to be given as atoms when generating stylesheets. ### 1.0.2 - 2020-05-28 Update NimbleParsec dependency. ### 1.0.1 - 2020-03-24 Remove warnings on recent Elixir versions. ### 1.0.0 - 2019-07-15 Upgrade the HTML formatter so that you can use different kinds of tags around the tokens. Previous versions always used the `` tag (e.g. `name`). You can now use other HTML tags using the `:highlight_tag` option: ```elixir alias Makeup.Formatters.HTML.HTMLFormatter HTMLFormatter.format_as_iolist(tokens, highlight_tag: "font") ``` ### 0.8.0 - 2019-01-01 This release adds a new file extension registry for lexers. This means that it's now possible to lookup lexers by file extension. Since the previous release it was already possible to lookup lexers by language name. For example: ```elixir elixir_lexer = Makeup.Registry.fetch_lexer_by_extension!("elixir") ``` Now you can also do this this: ```elixir elixir_lexer = Makeup.Registry.get_lexer_by_extension!("ex") ``` Documentation of the registry functionality was also improved. ### 0.7.0 - 2018-12-30 Adds a register where lexer developers can register their lexers. This allows one to pick a lexer based on the language name. The goal is for Makeup to be aware of the available lexers. In a project such as ExDoc this allows Makeup to support an unbounded number of languages just by declaring the lexer as a dependency. ### 0.6.0 - 2018-12-22 Fixes the combinators affected by compatibility breaks in `nimble_parsec` from `0.4.x` to `0.5.x`. Pins `nimble_parsec` to version `0.5.0`. makeup-1.1.1/CONTRIBUTING.md000066400000000000000000000333551441251027100152330ustar00rootroot00000000000000# Contributing This document is meant to help people who want to contribute to Makeup. ## The release script This project uses a release script to make it easy to publish a new release. The script performs a series of checks and executes a number of tasks. The script was inspired by the continuous release philosophy of the Python Hypothesis library. You can find a high-level description [here](https://hypothesis.works/articles/continuous-releases/). There are many differences though. The main one is that this release script acts purely locally, and must be explicitly invoked, while the one in hypothesis is a commit hook that runs on a continuous integration server. Currently, the script does the following: 1. Run the tests (abort the release if any tests fail) 2. Get the current version from the `mix.exs` file 3. Read a special `RELEASE.md` file to extract the release type (major, minor or patch) and the text to add as a new entry in the CHANGELOG 4. Update the version 5. Add the new version to the `mix.exs` file 6. Add a new entry to the CHANGELOG 7. Commit the changes to Git 8. Add a `vX.Y.Z` tag to the repo, so that it's easy to find each release 9. Remove the `RELEASE.md` file, which must be written again for a new release 10. Publish the package on Hex.pm It decreases the number of mistakes and the amount of commands you need to run. The path to the script is `scripts/release.exs`. The `mix.exs` file defines an alias so that you can run the script `mix release`. ## Special files ### The `RELEASE.md` file The `RELEASE.md` file must start with a line of the form `RELEASE_TYPE: type`, where type is either `major`, `minor` or `patch`. The following lines are used as the text for the entry in the changelog file. A simple example of a `RELEASE.md` file would be: RELEASE_TYPE: minor This is a minor release. It adds a minor feature and fixes two important bugs. ### The `CHANGELOG.md` file The `CHANGELOG.md` file must contain the following line: The newest changelog entry will be under this line. ## Using # High Level Architecture ## What Makeup Is The goal of Makeup is to take up something plain, and turn it into something pretty. The previous sentence is only the first of probably many puns about makeup. Makeup takes as argument a string representing source code, and returns some data that contains the highlighted source code. Currently, Makeup only supports HTML output (actually HTML + CSS + a little JavaScript). In the future it might support other kinds of output. It's made up of three parts: * The *Lexer*, which turns the raw source code into a list of tokens. There must be a lexer per programming language. * The *Formatter*, which turns the list of tokens into something else (what exactly is format dependent). * The *Styles*, which control the output of the Formatter. The main goal of having syntax highlighting is to make the code more understandable for a *human* audience. As discussed above, there is no need to actually parse the raw source into a valid AST. This allows us to make lots of simplifications regarding what exactly to parse, and which kinds of tokens we recognize. ## What Makeup Is Not Makeup is not a static code analyzer. As an analyzer, Makeup is very shallow and only cares about the surface details of your code. The goal here is to make the code pretty to humans, not to gain any deep insights. Makeup is not a general-purpose language parser. If it helps you write a better lexer, by all means implement a parser for the language in question so that you can lex it better, but in general it's probably not worth it. Makeup is not a tool to hyperlink your source code. While such tools might be built on top of Makeup, it's not the original goal. # Lexers The *Lexer*, turns the raw source code into a flat list of tokens. ## Tokens A token has the following type: ```elixir {atom(), map(), String.t()} ``` The token format was inspired by the format of an Elixir AST node. * The *first* element of the 3-tuple is the type of token. Makeup supports a limited number of token types. The supported token types are: [[...]](#supported-tokens) * The *second* element is a map, containing some metadata about the token. Some formatters can make use of the metadata in order to improve the output. The only metadata keys currently used by the HTML formatter are the `:group_id` and the `:unselectable` keys. * `:group_id` is used to mark delimiters as belonging to the same group, so that they are both highlighted when the user places the mouse cursor on top of one of them. * `:unselectable` is used to mark a certain token as impossible to select in the HTML output. It's useful for prompts in interactive interpreter sessions, which you usually don't want to copy and paste. * The *third* element is an iolist (not exactly, see below) or a binary containing the text that forms the token. Makeup lexers should by default use iolists instead of binaries because they usually bring better performance. For example, the following are valid tokens: * `{:name, %{}, "a"}` - represents the variable `a` * `{:string_double, %{}, "\"A String\""}` - represents a literal string * `{:number_integer, %{}, ["17"]}` - represents the number `17` ### Note: iolists and makeup The above description of the third element of the token is a slight simplification. Erlang iolists can contain *binaries*, *lists* and *integers representing bytes*. They can't contain arbitrary integers that encode Unicode characters. It's very inconvenient to handle these Unicode characters inside the lexer, so Makeup has chosen to handle them inside the *formatter*, which actually writes the "iolists" into an output device or a string. Because the *formatter* usually has to escape the token values anyway, it is natural to "escape" Unicode characters at that level. ## Improving an Existing Lexer There are probably lots of opportunities to profile the lexers and increase performance. Although performance is important, being correct is also important. When faced with the choice between being fast or being correct, you should be aware of the trade-off. ## Writing a New Lexer Makeup lexers use the excellent [NimbleParsec](https://github.com/plataformatec/nimble_parsec) parsing library by default. Writing a NimbleParsec parser is not a requirement to write an Elixir lexer. As said above, a lexer is just a module that implements the behavior above. You can write your lexer in any way you want. You may use a different parsing library, a custom tokenizer, or even something like Regex. On the other hand, by doing so you won't be making use of the combinators defined by Makeup. Because a Lexer is just a module that implements a behavior, there is no need for your grammar rules to output the final token stream. You can process the token stream any way you want, as long as the format is the same. For example, the current Elixir lexer iterates over the identifiers in the token list to highlight some keywords such as `if`, `when` and `defmodule`. Makeup now provides an API to register lexers on application start. This means that you can dynamically add support for new programming languages by just depending on a new lexer (as long as the application which is using Makeup knows how to get a lexer from the registry, of course). The lexer has the responsibility to register itself on application start. ### Matching delimiters A new lexer should make an effort to match delimiters such as parenthesis when appropriate. Such matched delimiters can be highlighted when the user places the mouse cursor on top of one of the delimiters. This makes it easy to visualize which part of the code is surrounded by the delimiters. This is not a hard requirement for a new lexer, of course, but it's probably quite easy to implement for almost every language. ```html

def f(x)
do
  x + 1
end
``` ### Aside: A Parser? Why not Regexes? They're simpler... Can't I just use a Regex-based lexer like normal people? Well, you can if you really want to. But Regexes are very weak, and clearly not enough to lex most programming languages. Most Regex-based lexers (like those employed by Pygments) are actually state machines with arbitrarily deep stacks with state transitions driven by Regex matches. This is equivalent to a stack-based automaton, which allows these lexers to support arbitrary levels of nesting. This is good enough to reasonably tokenize most programming languages, but it's much more low level than NimbleParsec (and probably slower). NimbleParsec allows you to define possibly recursive rules and handles the state transitions itself, probably with better performance. It's quite easy to port a Pygments lexer into Elixir, and sometimes they are shorter. The hardest part is actually extracting the rules from the Regex-driven state machine. # Formatter A formatter is an arbitrary module, which exports functions that perform arbitrary transformations on your list of tokens. The output formats are so different that it doesn't really make much sense for a formatter to implement a behavior. Some formatters should only output iolists, while others should only output binaries. Others might not produce any output. Think for example of a code formatter for a GUI application, which may work only by running function calls that statefully change the UI state. Usually you'll want to implement two functions: * `format_as_iolist(tokens, opts \\ [])` (converts a list of tokens into an iolist) * `format_as_binary(tokens, opts \\ [])` (converts a list of tokens into a binary) ### Note: why iolists? Concatenating strings is very slow on the BEAM. The fast way to generate strings is to first generate an iolist and then calling `IO.iodata_to_binary/1` on the iolist to generate a binary. ## Improving an Existing Formatter The HTML formatter probably doesn't need many improvements. ## Writing a New Formatter Some formatters that would be interesting to have: * HTML Formatter with inline CSS styles (the default one uses CSS classes) * (La)TeX Formatter * Formatter suitable for use in terminals While lexers will remain in separate packages for the foreseeable future, I think formatters could be available on Makeup itself. You can of course write your own formatters tailored to your projects. Be sure to use iolists instead of binaries whenever possible. # Style ## Improving an Existing Style While existing styles could use some improvements, you're probably better off writing and contributing new ones. ## Writing a New Style Writing a style is easy. A style is just an Elixir module that can be converted into a CSS stylesheet. If you prefer, you can write the CSS stylesheet directly for your application, but for now, Makeup will only accept styles written as Elixir modules. It's possible that in the future there will be a macro that generates an Elixir module at compile-time from a CSS stylesheet. It's probably not too hard to write a simple CSS parser and interpreter using NimbleParsec. # Writing Documentation ## Improving Makeup's Documentation This document is a work in progress. Educating people so that they can contribute (especially new lexers) is a priority. A tool such as Makeup depends on the work of many people, as no one is proficient in all the programming languages Makeup might have to highlight. Also, at the moment, the options recognized by the lexers are not documented properly. ## Improving NimbleParsec's Documentation Makeup lexers depend on NimbleParsec. The NimbleParsec docs and test suite are somewhat lacking at the moment. Teaching people how to use NimbleParsec is important if we want to encourage new contributions. Currently, not many people are using NimbleParsec, so building a knowledge base around it might be important. # Adoption and Marketing Increasing the adoption of Makeup is desirable, because not only it enhances the readability of code examples in the wild, but it might bring new contributors. New contributors bring new lexers, which bring higher adoption, which brings new contributors. This is a virtuous cycle we must encourage. --- #### Supported Tokens ```elixir :comment :comment_hashbang :comment_multiline :comment_preproc :comment_preproc_file :comment_single :comment_special :error :escape :generic :generic_deleted :generic_emph, :generic_error :generic_heading, :generic_inserted :generic_output, :generic_prompt :generic_strong :generic_subheading :generic_traceback :keyword :keyword_constant :keyword_declaration, :keyword_namespace :keyword_pseudo :keyword_reserved :keyword_type, :literal :literal_date :name :name_attribute :name_builtin, :name_builtin_pseudo :name_class :name_constant :name_decorator :name_entity :name_exception :name_function :name_function_magic :name_label :name_namespace :name_other :name_property :name_tag :name_variable, :name_variable_class, :name_variable_global :name_variable_instance :name_variable_magic :number, :number_bin :number_float, :number_hex :number_integer :number_integer_long :number_oct, :operator, :operator_word, :other :punctuation :string :string_affix :string_backtick, :string_char :string_delimiter, :string_doc :string_double :string_escape :string_heredoc :string_interpol, :string_other :string_regex :string_sigil :string_single :string_symbol :text :whitespace ``` makeup-1.1.1/LICENSE000066400000000000000000000024631441251027100140030ustar00rootroot00000000000000Copyright (c) 2006-2021 by the respective authors (see AUTHORS file). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. makeup-1.1.1/README.md000066400000000000000000000105321441251027100142510ustar00rootroot00000000000000# Makeup [![Module Version](https://img.shields.io/hexpm/v/makeup.svg)](https://hex.pm/packages/makeup) [![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/makeup/) ## Introduction Makeup is a "generic syntax highlighter suitable for use in code hosting, forums, wikis or other applications that need to prettify source code" . This tagline was shamelessly stolen from the [Pygments website](http://pygments.org/). Pygments the major inspiration for this package, and the structure is basically the same. It has **lexers**, **formatters** and **styles**. * **Lexers** turn the source code into a list of tokens. * **Formatters** turn the list of tokens into something else (HTML, TeX, images, etc.). Currently only an HTML formatter exists. * **Styles** customize the output of the formatter. Makeup supports all Pygments' styles (in fact, they were converted from the Python's source). New custom styles can be added to makeup itself, or defined in the Project that uses it. ## Demo To see a sample of Makeup's output, go check the [demo](https://elixir-makeup.github.io/makeup_demo/). Please note that not all styles define all differences between tokens. In a given style, strings and characters might be rendered in the same color while in others , the colors might be different. That is style-dependent. Some of the richer styles are the Tango style ([elixir](https://elixir-makeup.github.io/makeup_demo/elixir.html#tango)), the Colorful style ([elixir](https://elixir-makeup.github.io/makeup_demo/elixir.html#colorful)), the Default style ([elixir](https://elixir-makeup.github.io/makeup_demo/elixir.html#default)), and the Friendly style ([elixir](https://elixir-makeup.github.io/makeup_demo/elixir.html#friendly)). ## Supported Languages The supported source languages are: * [Elixir](https://github.com/elixir-makeup/makeup_elixir) * [Erlang](https://github.com/elixir-makeup/makeup_erlang) * [C](https://github.com/elixir-makeup/makeup_c) * [HTML](https://github.com/elixir-makeup/makeup_html) * [Diff](https://github.com/elixir-makeup/makeup_diff) * [JSON](https://github.com/elixir-makeup/makeup_json) * [(H)EEx](https://github.com/elixir-makeup/makeup_eex) ## Installation The package can be installed by adding `makeup` and `makeup_elixir` (required for the ElixirLexer) to your list of dependencies in `mix.exs`: ```elixir def deps do [ {:makeup, "x.y.z"}, {:makeup_elixir, "x.y.z"} ] end ``` Documentation can be found at [https://hexdocs.pm/makeup](https://hexdocs.pm/makeup). ## Changes Changes from previous versions are details in the [Changelog](CHANGELOG.md). ## Quickstart To highlight some Elixir code (newlines added for clarity): ```elixir Makeup.highlight(source) # "

#   x 
#   + 1
# 
\n" ``` As you can see, the default HTML formatter uses CSS classes. You'll need a CSS stylesheet to get the different colors and styles. To generate a stylesheet: ``` Makeup.stylesheet(style) # by default, the StyleMap.default style is used. # ... output omitted ``` ## Advantages over Pygments One of the greatest advantages is that it runs on the BEAM, so it can be used with Elixir projects without external dependencies. Another advantage is that the way lexers are written, we can be a lot smarter than Pygments in processing the output. For the developer, lexers are also easier to write than the Pygments lexers, because we use a PEG parser. Most Pygments lexers use something like a state table that works based on regex matches, and uses the results of those matches to switch to another state. Using a PEG parser we can define the grammar in a more natural way. The lexers are written using the excellent [NimbleParsec](https://github.com/dashbitco/nimble_parsec) parser. ## Disadvantages over Pygments It supports fewer languages. ## Documentation on how to write a new lexer Contributions are highly appreciated. The most direct way you can contribute to Makeup is by writing a new lexer. You can find some information here: [CONTRIBUTING.md](CONTRIBUTING.md) ## LICENSE Makeup is licensed under the BSD license. This is the same license as the Pygments Makeup uses and it seems to be compatible with the licenses used by all the dependencies. makeup-1.1.1/generators.ipynb000066400000000000000000002114651441251027100162160ustar00rootroot00000000000000{ "cells": [ { "cell_type": "markdown", "metadata": { "deletable": true, "editable": true }, "source": [ "# Python Helpers\n", "\n", "The python helpers in this IPython notebook serve to generate Elixir modules out of Pygments's styles. This gives us 29 styles for free, even if some of the styles are a little weird. It's good to have a choice. Because this introspects python code, it is written in python and will continue to be written in python for as long as it's needed.\n", "\n", "I've done this in an IPython notebook because it's the best environment for exploratory programming using python.\n", "\n", "This is not to be regularly used during development, so I didn't bother creating a proper python package or even a requirements file. The external dependencies needed to run this notebook are:\n", "\n", "* jupyter\n", "* pygments\n", "* jinja2" ] }, { "cell_type": "markdown", "metadata": { "deletable": true, "editable": true }, "source": [ "## Style Modules Generation\n", "\n", "The code is pretty simple. It introspects the Python classes with some help from Pygments itself, and then generates Elixir modules with the same functionality. The architecture is of course quite different (Elixir lexers are *data*, not Objects).\n", "\n", "Please don't touch the `lib/makeup/styles/html/style_map.ex` file between these markers:\n", "\n", "```elixir\n", " # %% Start Pygments - Don't remove this line \n", " ...\n", " # %% End Pygments - Don't remove this line \n", "```\n", "\n", "Because they will be overwritten if this is run again." ] }, { "cell_type": "code", "execution_count": 67, "metadata": { "collapsed": false, "deletable": true, "editable": true, "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "defmodule Makeup.Styles.HTML.StyleMap do\n", " alias Makeup.Styles.HTML\n", "\n", " # %% Start Pygments %%\n", " \n", " @doc \"\"\"\n", " The *abap* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#abap).\n", " \"\"\"\n", " def abap_style, do: HTML.AbapStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *algol* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#algol).\n", " \"\"\"\n", " def algol_style, do: HTML.AlgolStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *algol_nu* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#algol_nu).\n", " \"\"\"\n", " def algol_nu_style, do: HTML.Algol_NuStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *arduino* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#arduino).\n", " \"\"\"\n", " def arduino_style, do: HTML.ArduinoStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *autumn* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#autumn).\n", " \"\"\"\n", " def autumn_style, do: HTML.AutumnStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *borland* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#borland).\n", " \"\"\"\n", " def borland_style, do: HTML.BorlandStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *bw* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#bw).\n", " \"\"\"\n", " def bw_style, do: HTML.BlackWhiteStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *colorful* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#colorful).\n", " \"\"\"\n", " def colorful_style, do: HTML.ColorfulStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *default* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#default).\n", " \"\"\"\n", " def default_style, do: HTML.DefaultStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *emacs* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#emacs).\n", " \"\"\"\n", " def emacs_style, do: HTML.EmacsStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *friendly* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#friendly).\n", " \"\"\"\n", " def friendly_style, do: HTML.FriendlyStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *fruity* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#fruity).\n", " \"\"\"\n", " def fruity_style, do: HTML.FruityStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *igor* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#igor).\n", " \"\"\"\n", " def igor_style, do: HTML.IgorStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *lovelace* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#lovelace).\n", " \"\"\"\n", " def lovelace_style, do: HTML.LovelaceStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *manni* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#manni).\n", " \"\"\"\n", " def manni_style, do: HTML.ManniStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *monokai* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#monokai).\n", " \"\"\"\n", " def monokai_style, do: HTML.MonokaiStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *murphy* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#murphy).\n", " \"\"\"\n", " def murphy_style, do: HTML.MurphyStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *native* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#native).\n", " \"\"\"\n", " def native_style, do: HTML.NativeStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *paraiso_dark* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#paraiso_dark).\n", " \"\"\"\n", " def paraiso_dark_style, do: HTML.ParaisoDarkStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *paraiso_light* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#paraiso_light).\n", " \"\"\"\n", " def paraiso_light_style, do: HTML.ParaisoLightStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *pastie* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#pastie).\n", " \"\"\"\n", " def pastie_style, do: HTML.PastieStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *perldoc* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#perldoc).\n", " \"\"\"\n", " def perldoc_style, do: HTML.PerldocStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *rainbow_dash* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#rainbow_dash).\n", " \"\"\"\n", " def rainbow_dash_style, do: HTML.RainbowDashStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *rrt* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#rrt).\n", " \"\"\"\n", " def rrt_style, do: HTML.RrtStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *tango* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#tango).\n", " \"\"\"\n", " def tango_style, do: HTML.TangoStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *trac* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#trac).\n", " \"\"\"\n", " def trac_style, do: HTML.TracStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *vim* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#vim).\n", " \"\"\"\n", " def vim_style, do: HTML.VimStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *vs* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#vs).\n", " \"\"\"\n", " def vs_style, do: HTML.VisualStudioStyle.style()\n", " \n", " \n", " @doc \"\"\"\n", " The *xcode* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#xcode).\n", " \"\"\"\n", " def xcode_style, do: HTML.XcodeStyle.style()\n", "end\n" ] } ], "source": [ "import pygments.styles\n", "import jinja2\n", "import textwrap\n", "from itertools import chain\n", "import os\n", "import re\n", "\n", "tokens = [\n", " ':text',\n", " ':whitespace',\n", " ':escape',\n", " ':error',\n", " ':other' ,\n", " ':keyword',\n", " ':keyword_constant',\n", " ':keyword_declaration',\n", " ':keyword_namespace',\n", " ':keyword_pseudo',\n", " ':keyword_reserved',\n", " ':keyword_type' ,\n", " ':name',\n", " ':name_attribute',\n", " ':name_builtin',\n", " ':name_builtin_pseudo',\n", " ':name_class',\n", " ':name_constant',\n", " ':name_decorator',\n", " ':name_entity',\n", " ':name_exception',\n", " ':name_function',\n", " ':name_function_magic',\n", " ':name_property',\n", " ':name_label',\n", " ':name_namespace',\n", " ':name_other',\n", " ':name_tag',\n", " ':name_variable',\n", " ':name_variable_class',\n", " ':name_variable_global',\n", " ':name_variable_instance',\n", " ':name_variable_magic',\n", " ':literal',\n", " ':literal_date',\n", " ':string',\n", " ':string_affix',\n", " ':string_backtick',\n", " ':string_char',\n", " ':string_delimiter',\n", " ':string_doc',\n", " ':string_double',\n", " ':string_escape',\n", " ':string_heredoc',\n", " ':string_interpol',\n", " ':string_other',\n", " ':string_regex',\n", " ':string_sigil',\n", " ':string_single',\n", " ':string_symbol',\n", " ':number',\n", " ':number_bin',\n", " ':number_float',\n", " ':number_hex',\n", " ':number_integer',\n", " ':number_integer_long',\n", " ':number_oct',\n", " ':operator',\n", " ':operator_word',\n", " ':punctuation',\n", " ':comment',\n", " ':comment_hashbang',\n", " ':comment_multiline',\n", " ':comment_preproc',\n", " ':comment_preproc_file',\n", " ':comment_single',\n", " ':comment_special',\n", " ':generic',\n", " ':generic_deleted',\n", " ':generic_emph',\n", " ':generic_error',\n", " ':generic_heading',\n", " ':generic_inserted',\n", " ':generic_output',\n", " ':generic_prompt',\n", " ':generic_strong',\n", " ':generic_subheading',\n", " ':generic_traceback']\n", "\n", "style_module_template = jinja2.Template('''\n", "defmodule Makeup.Styles.HTML.{{module_name}} do\n", " @moduledoc false\n", "\n", " require Makeup.Token.TokenTypes\n", " alias Makeup.Token.TokenTypes, as: Tok\n", "\n", " @styles %{\n", " {% for tok in tokens %}\n", " {%- if styles[ex_to_py[tok]] %}{{ tok }} => \"{{ styles[ex_to_py[tok]] }}\"{% if not loop.last %},{% endif %}\n", " {% endif -%}\n", " {%- endfor %}\n", " }\n", " \n", " alias Makeup.Styles.HTML.Style\n", " \n", " @style_struct Style.make_style(\n", " short_name: \"{{ short_name }}\",\n", " long_name: \"{{ long_name }}\",\n", " background_color: \"{{ background_color }}\",\n", " highlight_color: \"{{ highlight_color }}\",\n", " styles: @styles)\n", " \n", " def style() do\n", " @style_struct\n", " end\n", "end\n", "''')\n", "\n", "style_map_file_fragment = jinja2.Template('''\n", " {% for (lowercase, uppercase) in pairs %}\n", " @doc \"\"\"\n", " The *{{ lowercase }}* style. Example [here](https://elixir-makeup.github.io/makeup_demo/elixir.html#{{ lowercase }}).\n", " \"\"\"\n", " def {{ lowercase }}_style, do: HTML.{{ uppercase }}.style()\n", " \n", " {% endfor -%}\n", " \n", " # All styles\n", " @pygments_style_map_binaries %{\n", " {% for (lowercase, uppercase) in pairs %} \"{{ lowercase }}\" => HTML.{{ uppercase }}.style(),\n", " {% endfor %} }\n", " \n", " @pygments_style_map_atoms %{\n", " {% for (lowercase, uppercase) in pairs %} {{ lowercase }}: HTML.{{ uppercase }}.style(),\n", " {% endfor %}}\n", "\n", "\n", "''')\n", "\n", "def py_to_ex(cls):\n", " # We don't want to operate on token classes, only their names\n", " name = str(cls)\n", " # They are of the form \"Token.*\"\n", " # Trim the \"Token.\" prefix\n", " name = name.replace('Token.Literal.', 'Token.')\n", " trimmed = name[6:]\n", " # Convert to lower case\n", " # It would be confusing to have them in uppercase in Elixir\n", " # because they could be mistaken by aliases.\n", " # Besides, having them in lowercase allows us to use macros\n", " # to make sure at compile time we're not using any inexistent styles.\n", " lowered = trimmed.lower()\n", " # Continue turning them into valid identifiers\n", " replaced = lowered.replace('.', '_')\n", " # Turn it into a macro under the Tok alias\n", " return (str(cls), ':' + replaced)\n", "\n", "def invert(pairs):\n", " return [(y, x) for (x, y) in pairs]\n", " \n", "def stringify_styles(styles):\n", " return dict((str(k), v) for (k,v) in styles.items())\n", "\n", "def correct_docs(text, level=2):\n", " # The module docs are writte in rST.\n", " # rST is similar enough to markdown that we can fake it\n", " # by removing the first lines with the title and\n", " # replacing some directives.\n", " \n", " # First, remove all indent\n", " md = textwrap.dedent(text)\n", " # Replace the :copyright directive\n", " md = md.strip().replace(':copyright:', '©')\n", " # Replace the :license: directive\n", " md = md.replace(':license:', 'License:')\n", " # Add a link to the BDS license\n", " md = md.replace('see LICENSE for details',\n", " 'see [here](https://opensource.org/licenses/BSD-3-Clause) for details')\n", " # Escape the '*' character, which is probably not used for emphasis by the license\n", " md = md.replace('*', '\\\\*')\n", " # remove the first 3 lines, which contain the title\n", " # and indent all lines (2 spaces by default)\n", " indented = \"\\n\".join(((\" \" * level) + line) for line in md.split('\\n')[3:])\n", " return indented\n", "\n", "def style_to_ex_module(key, value, tokens):\n", " # Pygments stores the module name and the class name under this weird format\n", " module_name, class_name = value.split('::')\n", " # Import the module\n", " __import__('pygments.styles.' + module_name)\n", " # Store the module in a variable\n", " module = getattr(pygments.styles, module_name)\n", " short_name = module_name\n", " long_name = class_name[:-5] + \" \" + class_name[-5:]\n", " # Extract the class from the module\n", " style_class = getattr(module, class_name)\n", " # Map the Elixir styles into Python stringified token classes\n", " ex_to_py = dict(invert([py_to_ex(k) for k in style_class.styles.keys()]))\n", " stringified_styles = stringify_styles(style_class.styles)\n", " # Render the tokens\n", " return style_module_template.render(\n", " # Preprocess the docs\n", " moduledoc=correct_docs(module.__doc__, 2),\n", " # We take the style name unchanged from Python\n", " # (including the *Style suffix)\n", " module_name=style_class.__name__,\n", " # The elixir token styles\n", " tokens=tokens,\n", " # Other class attributes\n", " short_name=short_name,\n", " long_name=long_name,\n", " background_color=style_class.background_color,\n", " highlight_color=style_class.highlight_color,\n", " styles=stringified_styles,\n", " ex_to_py=ex_to_py)\n", "\n", "def all_styles(style_map, tokens):\n", " # This function generates elixir an elixir file (with a module for each Pygments style.\n", " # It will overwrite existing files.\n", " for key, value in style_map.items():\n", " source = style_to_ex_module(key, value, tokens)\n", " # The path where we'll generate the file\n", " file_path = os.path.join('lib/makeup/styles/html/pygments/', key + '.ex')\n", " with open(file_path, 'wb') as f:\n", " f.write(source.encode())\n", "\n", "def generate_style_map_file(style_map):\n", " sorted_pairs = sorted([\n", " # Turn the key into a valid Elxir identifier\n", " (key.replace('-', '_'), value.split('::')[1])\n", " for (key, value) in style_map.items()\n", " ])\n", " # Generate the new text fragment\n", " new_fragment = style_map_file_fragment.render(pairs=sorted_pairs)\n", " file_path = os.path.join('lib/makeup/styles/html/style_map.ex')\n", " with open(file_path, 'r') as f:\n", " source = f.read()\n", " \n", " # Recognize the pattern to replace\n", " pattern = re.compile(\n", " \"(?<= # %% Start Pygments %%)(\\r?\\n)\"\n", " \"(.*?\\r?\\n)\"\n", " \"(?= # %% End Pygments %%)\", re.DOTALL)\n", " # Replace the text between the markers\n", " replaced = re.sub(\n", " pattern,\n", " new_fragment,\n", " source)\n", " # Check we've done the right thing\n", " print(replaced)\n", " # Replace the file contents\n", " with open(file_path, 'wb') as f:\n", " source = f.write(replaced.encode())\n", " \n", "# (Re)generate modules for all styles\n", "all_styles(pygments.styles.STYLE_MAP, tokens)\n", "# Regenerate the style_map file\n", "generate_style_map_file(pygments.styles.STYLE_MAP)" ] }, { "cell_type": "markdown", "metadata": { "deletable": true, "editable": true }, "source": [ "# Default Language Names\n", "\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false, "deletable": true, "editable": true, "scrolled": true }, "outputs": [], "source": [ "from pygments.lexers import get_all_lexers\n", "import jinja2" ] }, { "cell_type": "code", "execution_count": 38, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "%{\n", "\n", " %{module: Makeup.Lexers.ABAPLexer, name: \"ABAP\", shortnames: [\"abap\"]},\n", " %{module: Makeup.Lexers.APLLexer, name: \"APL\", shortnames: [\"apl\"]},\n", " %{module: Makeup.Lexers.AbnfLexer, name: \"ABNF\", shortnames: [\"abnf\"]},\n", " %{module: Makeup.Lexers.ActionScript3Lexer, name: \"ActionScript 3\", shortnames: [\"as3\", \"actionscript3\"]},\n", " %{module: Makeup.Lexers.ActionScriptLexer, name: \"ActionScript\", shortnames: [\"as\", \"actionscript\"]},\n", " %{module: Makeup.Lexers.AdaLexer, name: \"Ada\", shortnames: [\"ada\", \"ada95\", \"ada2005\"]},\n", " %{module: Makeup.Lexers.AdlLexer, name: \"ADL\", shortnames: [\"adl\"]},\n", " %{module: Makeup.Lexers.AgdaLexer, name: \"Agda\", shortnames: [\"agda\"]},\n", " %{module: Makeup.Lexers.AheuiLexer, name: \"Aheui\", shortnames: [\"aheui\"]},\n", " %{module: Makeup.Lexers.AlloyLexer, name: \"Alloy\", shortnames: [\"alloy\"]},\n", " %{module: Makeup.Lexers.AmbientTalkLexer, name: \"AmbientTalk\", shortnames: [\"at\", \"ambienttalk\", \"ambienttalk/2\"]},\n", " %{module: Makeup.Lexers.AmplLexer, name: \"Ampl\", shortnames: [\"ampl\"]},\n", " %{module: Makeup.Lexers.Angular2HtmlLexer, name: \"HTML + Angular2\", shortnames: [\"html+ng2\"]},\n", " %{module: Makeup.Lexers.Angular2Lexer, name: \"Angular2\", shortnames: [\"ng2\"]},\n", " %{module: Makeup.Lexers.AntlrActionScriptLexer, name: \"ANTLR With ActionScript Target\", shortnames: [\"antlr-as\", \"antlr-actionscript\"]},\n", " %{module: Makeup.Lexers.AntlrCSharpLexer, name: \"ANTLR With C# Target\", shortnames: [\"antlr-csharp\", \"antlr-c#\"]},\n", " %{module: Makeup.Lexers.AntlrCppLexer, name: \"ANTLR With CPP Target\", shortnames: [\"antlr-cpp\"]},\n", " %{module: Makeup.Lexers.AntlrJavaLexer, name: \"ANTLR With Java Target\", shortnames: [\"antlr-java\"]},\n", " %{module: Makeup.Lexers.AntlrLexer, name: \"ANTLR\", shortnames: [\"antlr\"]},\n", " %{module: Makeup.Lexers.AntlrObjectiveCLexer, name: \"ANTLR With ObjectiveC Target\", shortnames: [\"antlr-objc\"]},\n", " %{module: Makeup.Lexers.AntlrPerlLexer, name: \"ANTLR With Perl Target\", shortnames: [\"antlr-perl\"]},\n", " %{module: Makeup.Lexers.AntlrPythonLexer, name: \"ANTLR With Python Target\", shortnames: [\"antlr-python\"]},\n", " %{module: Makeup.Lexers.AntlrRubyLexer, name: \"ANTLR With Ruby Target\", shortnames: [\"antlr-ruby\", \"antlr-rb\"]},\n", " %{module: Makeup.Lexers.ApacheConfLexer, name: \"ApacheConf\", shortnames: [\"apacheconf\", \"aconf\", \"apache\"]},\n", " %{module: Makeup.Lexers.AppleScriptLexer, name: \"AppleScript\", shortnames: [\"applescript\"]},\n", " %{module: Makeup.Lexers.ArduinoLexer, name: \"Arduino\", shortnames: [\"arduino\"]},\n", " %{module: Makeup.Lexers.AspectJLexer, name: \"AspectJ\", shortnames: [\"aspectj\"]},\n", " %{module: Makeup.Lexers.AsymptoteLexer, name: \"Asymptote\", shortnames: [\"asy\", \"asymptote\"]},\n", " %{module: Makeup.Lexers.AutoItLexer, name: \"AutoIt\", shortnames: [\"autoit\"]},\n", " %{module: Makeup.Lexers.AutohotkeyLexer, name: \"autohotkey\", shortnames: [\"ahk\", \"autohotkey\"]},\n", " %{module: Makeup.Lexers.AwkLexer, name: \"Awk\", shortnames: [\"awk\", \"gawk\", \"mawk\", \"nawk\"]},\n", " %{module: Makeup.Lexers.BBCodeLexer, name: \"BBCode\", shortnames: [\"bbcode\"]},\n", " %{module: Makeup.Lexers.BCLexer, name: \"BC\", shortnames: [\"bc\"]},\n", " %{module: Makeup.Lexers.BSTLexer, name: \"BST\", shortnames: [\"bst\", \"bst-pybtex\"]},\n", " %{module: Makeup.Lexers.BaseMakefileLexer, name: \"Base Makefile\", shortnames: [\"basemake\"]},\n", " %{module: Makeup.Lexers.BashLexer, name: \"Bash\", shortnames: [\"bash\", \"sh\", \"ksh\", \"zsh\", \"shell\"]},\n", " %{module: Makeup.Lexers.BashSessionLexer, name: \"Bash Session\", shortnames: [\"console\", \"shell-session\"]},\n", " %{module: Makeup.Lexers.BatchLexer, name: \"Batchfile\", shortnames: [\"bat\", \"batch\", \"dosbatch\", \"winbatch\"]},\n", " %{module: Makeup.Lexers.BefungeLexer, name: \"Befunge\", shortnames: [\"befunge\"]},\n", " %{module: Makeup.Lexers.BibTeXLexer, name: \"BibTeX\", shortnames: [\"bib\", \"bibtex\"]},\n", " %{module: Makeup.Lexers.BlitzBasicLexer, name: \"BlitzBasic\", shortnames: [\"blitzbasic\", \"b3d\", \"bplus\"]},\n", " %{module: Makeup.Lexers.BlitzMaxLexer, name: \"BlitzMax\", shortnames: [\"blitzmax\", \"bmax\"]},\n", " %{module: Makeup.Lexers.BnfLexer, name: \"BNF\", shortnames: [\"bnf\"]},\n", " %{module: Makeup.Lexers.BooLexer, name: \"Boo\", shortnames: [\"boo\"]},\n", " %{module: Makeup.Lexers.BoogieLexer, name: \"Boogie\", shortnames: [\"boogie\"]},\n", " %{module: Makeup.Lexers.BrainfuckLexer, name: \"Brainfuck\", shortnames: [\"brainfuck\", \"bf\"]},\n", " %{module: Makeup.Lexers.BroLexer, name: \"Bro\", shortnames: [\"bro\"]},\n", " %{module: Makeup.Lexers.BugsLexer, name: \"BUGS\", shortnames: [\"bugs\", \"winbugs\", \"openbugs\"]},\n", " %{module: Makeup.Lexers.CAmkESLexer, name: \"CAmkES\", shortnames: [\"camkes\", \"idl4\"]},\n", " %{module: Makeup.Lexers.CLexer, name: \"C\", shortnames: [\"c\"]},\n", " %{module: Makeup.Lexers.CMakeLexer, name: \"CMake\", shortnames: [\"cmake\"]},\n", " %{module: Makeup.Lexers.CObjdumpLexer, name: \"c-objdump\", shortnames: [\"c-objdump\"]},\n", " %{module: Makeup.Lexers.CPSALexer, name: \"CPSA\", shortnames: [\"cpsa\"]},\n", " %{module: Makeup.Lexers.CSharpAspxLexer, name: \"aspx-cs\", shortnames: [\"aspx-cs\"]},\n", " %{module: Makeup.Lexers.CSharpLexer, name: \"C#\", shortnames: [\"csharp\", \"c#\"]},\n", " %{module: Makeup.Lexers.Ca65Lexer, name: \"ca65 assembler\", shortnames: [\"ca65\"]},\n", " %{module: Makeup.Lexers.CadlLexer, name: \"cADL\", shortnames: [\"cadl\"]},\n", " %{module: Makeup.Lexers.CapDLLexer, name: \"CapDL\", shortnames: [\"capdl\"]},\n", " %{module: Makeup.Lexers.CapnProtoLexer, name: \"Cap'n Proto\", shortnames: [\"capnp\"]},\n", " %{module: Makeup.Lexers.CbmBasicV2Lexer, name: \"CBM BASIC V2\", shortnames: [\"cbmbas\"]},\n", " %{module: Makeup.Lexers.CeylonLexer, name: \"Ceylon\", shortnames: [\"ceylon\"]},\n", " %{module: Makeup.Lexers.Cfengine3Lexer, name: \"CFEngine3\", shortnames: [\"cfengine3\", \"cf3\"]},\n", " %{module: Makeup.Lexers.ChaiscriptLexer, name: \"ChaiScript\", shortnames: [\"chai\", \"chaiscript\"]},\n", " %{module: Makeup.Lexers.ChapelLexer, name: \"Chapel\", shortnames: [\"chapel\", \"chpl\"]},\n", " %{module: Makeup.Lexers.CheetahHtmlLexer, name: \"HTML+Cheetah\", shortnames: [\"html+cheetah\", \"html+spitfire\", \"htmlcheetah\"]},\n", " %{module: Makeup.Lexers.CheetahJavascriptLexer, name: \"JavaScript+Cheetah\", shortnames: [\"js+cheetah\", \"javascript+cheetah\", \"js+spitfire\", \"javascript+spitfire\"]},\n", " %{module: Makeup.Lexers.CheetahLexer, name: \"Cheetah\", shortnames: [\"cheetah\", \"spitfire\"]},\n", " %{module: Makeup.Lexers.CheetahXmlLexer, name: \"XML+Cheetah\", shortnames: [\"xml+cheetah\", \"xml+spitfire\"]},\n", " %{module: Makeup.Lexers.CirruLexer, name: \"Cirru\", shortnames: [\"cirru\"]},\n", " %{module: Makeup.Lexers.ClayLexer, name: \"Clay\", shortnames: [\"clay\"]},\n", " %{module: Makeup.Lexers.CleanLexer, name: \"Clean\", shortnames: [\"clean\"]},\n", " %{module: Makeup.Lexers.ClojureLexer, name: \"Clojure\", shortnames: [\"clojure\", \"clj\"]},\n", " %{module: Makeup.Lexers.ClojureScriptLexer, name: \"ClojureScript\", shortnames: [\"clojurescript\", \"cljs\"]},\n", " %{module: Makeup.Lexers.CobolFreeformatLexer, name: \"COBOLFree\", shortnames: [\"cobolfree\"]},\n", " %{module: Makeup.Lexers.CobolLexer, name: \"COBOL\", shortnames: [\"cobol\"]},\n", " %{module: Makeup.Lexers.CoffeeScriptLexer, name: \"CoffeeScript\", shortnames: [\"coffee-script\", \"coffeescript\", \"coffee\"]},\n", " %{module: Makeup.Lexers.ColdfusionCFCLexer, name: \"Coldfusion CFC\", shortnames: [\"cfc\"]},\n", " %{module: Makeup.Lexers.ColdfusionHtmlLexer, name: \"Coldfusion HTML\", shortnames: [\"cfm\"]},\n", " %{module: Makeup.Lexers.ColdfusionLexer, name: \"cfstatement\", shortnames: [\"cfs\"]},\n", " %{module: Makeup.Lexers.CommonLispLexer, name: \"Common Lisp\", shortnames: [\"common-lisp\", \"cl\", \"lisp\"]},\n", " %{module: Makeup.Lexers.ComponentPascalLexer, name: \"Component Pascal\", shortnames: [\"componentpascal\", \"cp\"]},\n", " %{module: Makeup.Lexers.CoqLexer, name: \"Coq\", shortnames: [\"coq\"]},\n", " %{module: Makeup.Lexers.CppLexer, name: \"C++\", shortnames: [\"cpp\", \"c++\"]},\n", " %{module: Makeup.Lexers.CppObjdumpLexer, name: \"cpp-objdump\", shortnames: [\"cpp-objdump\", \"c++-objdumb\", \"cxx-objdump\"]},\n", " %{module: Makeup.Lexers.CrmshLexer, name: \"Crmsh\", shortnames: [\"crmsh\", \"pcmk\"]},\n", " %{module: Makeup.Lexers.CrocLexer, name: \"Croc\", shortnames: [\"croc\"]},\n", " %{module: Makeup.Lexers.CryptolLexer, name: \"Cryptol\", shortnames: [\"cryptol\", \"cry\"]},\n", " %{module: Makeup.Lexers.CrystalLexer, name: \"Crystal\", shortnames: [\"cr\", \"crystal\"]},\n", " %{module: Makeup.Lexers.CsoundDocumentLexer, name: \"Csound Document\", shortnames: [\"csound-document\", \"csound-csd\"]},\n", " %{module: Makeup.Lexers.CsoundOrchestraLexer, name: \"Csound Orchestra\", shortnames: [\"csound\", \"csound-orc\"]},\n", " %{module: Makeup.Lexers.CsoundScoreLexer, name: \"Csound Score\", shortnames: [\"csound-score\", \"csound-sco\"]},\n", " %{module: Makeup.Lexers.CssDjangoLexer, name: \"CSS+Django/Jinja\", shortnames: [\"css+django\", \"css+jinja\"]},\n", " %{module: Makeup.Lexers.CssErbLexer, name: \"CSS+Ruby\", shortnames: [\"css+erb\", \"css+ruby\"]},\n", " %{module: Makeup.Lexers.CssGenshiLexer, name: \"CSS+Genshi Text\", shortnames: [\"css+genshitext\", \"css+genshi\"]},\n", " %{module: Makeup.Lexers.CssLexer, name: \"CSS\", shortnames: [\"css\"]},\n", " %{module: Makeup.Lexers.CssPhpLexer, name: \"CSS+PHP\", shortnames: [\"css+php\"]},\n", " %{module: Makeup.Lexers.CssSmartyLexer, name: \"CSS+Smarty\", shortnames: [\"css+smarty\"]},\n", " %{module: Makeup.Lexers.CudaLexer, name: \"CUDA\", shortnames: [\"cuda\", \"cu\"]},\n", " %{module: Makeup.Lexers.CypherLexer, name: \"Cypher\", shortnames: [\"cypher\"]},\n", " %{module: Makeup.Lexers.CythonLexer, name: \"Cython\", shortnames: [\"cython\", \"pyx\", \"pyrex\"]},\n", " %{module: Makeup.Lexers.DLexer, name: \"D\", shortnames: [\"d\"]},\n", " %{module: Makeup.Lexers.DObjdumpLexer, name: \"d-objdump\", shortnames: [\"d-objdump\"]},\n", " %{module: Makeup.Lexers.DarcsPatchLexer, name: \"Darcs Patch\", shortnames: [\"dpatch\"]},\n", " %{module: Makeup.Lexers.DartLexer, name: \"Dart\", shortnames: [\"dart\"]},\n", " %{module: Makeup.Lexers.DebianControlLexer, name: \"Debian Control file\", shortnames: [\"control\", \"debcontrol\"]},\n", " %{module: Makeup.Lexers.DelphiLexer, name: \"Delphi\", shortnames: [\"delphi\", \"pas\", \"pascal\", \"objectpascal\"]},\n", " %{module: Makeup.Lexers.DgLexer, name: \"dg\", shortnames: [\"dg\"]},\n", " %{module: Makeup.Lexers.DiffLexer, name: \"Diff\", shortnames: [\"diff\", \"udiff\"]},\n", " %{module: Makeup.Lexers.DjangoLexer, name: \"Django/Jinja\", shortnames: [\"django\", \"jinja\"]},\n", " %{module: Makeup.Lexers.DockerLexer, name: \"Docker\", shortnames: [\"docker\", \"dockerfile\"]},\n", " %{module: Makeup.Lexers.DtdLexer, name: \"DTD\", shortnames: [\"dtd\"]},\n", " %{module: Makeup.Lexers.DuelLexer, name: \"Duel\", shortnames: [\"duel\", \"jbst\", \"jsonml+bst\"]},\n", " %{module: Makeup.Lexers.DylanConsoleLexer, name: \"Dylan session\", shortnames: [\"dylan-console\", \"dylan-repl\"]},\n", " %{module: Makeup.Lexers.DylanLexer, name: \"Dylan\", shortnames: [\"dylan\"]},\n", " %{module: Makeup.Lexers.DylanLidLexer, name: \"DylanLID\", shortnames: [\"dylan-lid\", \"lid\"]},\n", " %{module: Makeup.Lexers.ECLLexer, name: \"ECL\", shortnames: [\"ecl\"]},\n", " %{module: Makeup.Lexers.ECLexer, name: \"eC\", shortnames: [\"ec\"]},\n", " %{module: Makeup.Lexers.EarlGreyLexer, name: \"Earl Grey\", shortnames: [\"earl-grey\", \"earlgrey\", \"eg\"]},\n", " %{module: Makeup.Lexers.EasytrieveLexer, name: \"Easytrieve\", shortnames: [\"easytrieve\"]},\n", " %{module: Makeup.Lexers.EbnfLexer, name: \"EBNF\", shortnames: [\"ebnf\"]},\n", " %{module: Makeup.Lexers.EiffelLexer, name: \"Eiffel\", shortnames: [\"eiffel\"]},\n", " %{module: Makeup.Lexers.ElixirConsoleLexer, name: \"Elixir iex session\", shortnames: [\"iex\"]},\n", " %{module: Makeup.Lexers.ElixirLexer, name: \"Elixir\", shortnames: [\"elixir\", \"ex\", \"exs\"]},\n", " %{module: Makeup.Lexers.ElmLexer, name: \"Elm\", shortnames: [\"elm\"]},\n", " %{module: Makeup.Lexers.EmacsLispLexer, name: \"EmacsLisp\", shortnames: [\"emacs\", \"elisp\", \"emacs-lisp\"]},\n", " %{module: Makeup.Lexers.ErbLexer, name: \"ERB\", shortnames: [\"erb\"]},\n", " %{module: Makeup.Lexers.ErlangLexer, name: \"Erlang\", shortnames: [\"erlang\"]},\n", " %{module: Makeup.Lexers.ErlangShellLexer, name: \"Erlang erl session\", shortnames: [\"erl\"]},\n", " %{module: Makeup.Lexers.EvoqueHtmlLexer, name: \"HTML+Evoque\", shortnames: [\"html+evoque\"]},\n", " %{module: Makeup.Lexers.EvoqueLexer, name: \"Evoque\", shortnames: [\"evoque\"]},\n", " %{module: Makeup.Lexers.EvoqueXmlLexer, name: \"XML+Evoque\", shortnames: [\"xml+evoque\"]},\n", " %{module: Makeup.Lexers.EzhilLexer, name: \"Ezhil\", shortnames: [\"ezhil\"]},\n", " %{module: Makeup.Lexers.FSharpLexer, name: \"FSharp\", shortnames: [\"fsharp\"]},\n", " %{module: Makeup.Lexers.FactorLexer, name: \"Factor\", shortnames: [\"factor\"]},\n", " %{module: Makeup.Lexers.FancyLexer, name: \"Fancy\", shortnames: [\"fancy\", \"fy\"]},\n", " %{module: Makeup.Lexers.FantomLexer, name: \"Fantom\", shortnames: [\"fan\"]},\n", " %{module: Makeup.Lexers.FelixLexer, name: \"Felix\", shortnames: [\"felix\", \"flx\"]},\n", " %{module: Makeup.Lexers.FishShellLexer, name: \"Fish\", shortnames: [\"fish\", \"fishshell\"]},\n", " %{module: Makeup.Lexers.FlatlineLexer, name: \"Flatline\", shortnames: [\"flatline\"]},\n", " %{module: Makeup.Lexers.ForthLexer, name: \"Forth\", shortnames: [\"forth\"]},\n", " %{module: Makeup.Lexers.FortranFixedLexer, name: \"FortranFixed\", shortnames: [\"fortranfixed\"]},\n", " %{module: Makeup.Lexers.FortranLexer, name: \"Fortran\", shortnames: [\"fortran\"]},\n", " %{module: Makeup.Lexers.FoxProLexer, name: \"FoxPro\", shortnames: [\"foxpro\", \"vfp\", \"clipper\", \"xbase\"]},\n", " %{module: Makeup.Lexers.GAPLexer, name: \"GAP\", shortnames: [\"gap\"]},\n", " %{module: Makeup.Lexers.GLShaderLexer, name: \"GLSL\", shortnames: [\"glsl\"]},\n", " %{module: Makeup.Lexers.GasLexer, name: \"GAS\", shortnames: [\"gas\", \"asm\"]},\n", " %{module: Makeup.Lexers.GenshiLexer, name: \"Genshi\", shortnames: [\"genshi\", \"kid\", \"xml+genshi\", \"xml+kid\"]},\n", " %{module: Makeup.Lexers.GenshiTextLexer, name: \"Genshi Text\", shortnames: [\"genshitext\"]},\n", " %{module: Makeup.Lexers.GettextLexer, name: \"Gettext Catalog\", shortnames: [\"pot\", \"po\"]},\n", " %{module: Makeup.Lexers.GherkinLexer, name: \"Gherkin\", shortnames: [\"cucumber\", \"gherkin\"]},\n", " %{module: Makeup.Lexers.GnuplotLexer, name: \"Gnuplot\", shortnames: [\"gnuplot\"]},\n", " %{module: Makeup.Lexers.GoLexer, name: \"Go\", shortnames: [\"go\"]},\n", " %{module: Makeup.Lexers.GoloLexer, name: \"Golo\", shortnames: [\"golo\"]},\n", " %{module: Makeup.Lexers.GoodDataCLLexer, name: \"GoodData-CL\", shortnames: [\"gooddata-cl\"]},\n", " %{module: Makeup.Lexers.GosuLexer, name: \"Gosu\", shortnames: [\"gosu\"]},\n", " %{module: Makeup.Lexers.GosuTemplateLexer, name: \"Gosu Template\", shortnames: [\"gst\"]},\n", " %{module: Makeup.Lexers.GroffLexer, name: \"Groff\", shortnames: [\"groff\", \"nroff\", \"man\"]},\n", " %{module: Makeup.Lexers.GroovyLexer, name: \"Groovy\", shortnames: [\"groovy\"]},\n", " %{module: Makeup.Lexers.HamlLexer, name: \"Haml\", shortnames: [\"haml\"]},\n", " %{module: Makeup.Lexers.HandlebarsHtmlLexer, name: \"HTML+Handlebars\", shortnames: [\"html+handlebars\"]},\n", " %{module: Makeup.Lexers.HandlebarsLexer, name: \"Handlebars\", shortnames: [\"handlebars\"]},\n", " %{module: Makeup.Lexers.HaskellLexer, name: \"Haskell\", shortnames: [\"haskell\", \"hs\"]},\n", " %{module: Makeup.Lexers.HaxeLexer, name: \"Haxe\", shortnames: [\"hx\", \"haxe\", \"hxsl\"]},\n", " %{module: Makeup.Lexers.HexdumpLexer, name: \"Hexdump\", shortnames: [\"hexdump\"]},\n", " %{module: Makeup.Lexers.HsailLexer, name: \"HSAIL\", shortnames: [\"hsail\", \"hsa\"]},\n", " %{module: Makeup.Lexers.HtmlDjangoLexer, name: \"HTML+Django/Jinja\", shortnames: [\"html+django\", \"html+jinja\", \"htmldjango\"]},\n", " %{module: Makeup.Lexers.HtmlGenshiLexer, name: \"HTML+Genshi\", shortnames: [\"html+genshi\", \"html+kid\"]},\n", " %{module: Makeup.Lexers.HtmlLexer, name: \"HTML\", shortnames: [\"html\"]},\n", " %{module: Makeup.Lexers.HtmlPhpLexer, name: \"HTML+PHP\", shortnames: [\"html+php\"]},\n", " %{module: Makeup.Lexers.HtmlSmartyLexer, name: \"HTML+Smarty\", shortnames: [\"html+smarty\"]},\n", " %{module: Makeup.Lexers.HttpLexer, name: \"HTTP\", shortnames: [\"http\"]},\n", " %{module: Makeup.Lexers.HxmlLexer, name: \"Hxml\", shortnames: [\"haxeml\", \"hxml\"]},\n", " %{module: Makeup.Lexers.HyLexer, name: \"Hy\", shortnames: [\"hylang\"]},\n", " %{module: Makeup.Lexers.HybrisLexer, name: \"Hybris\", shortnames: [\"hybris\", \"hy\"]},\n", " %{module: Makeup.Lexers.IDLLexer, name: \"IDL\", shortnames: [\"idl\"]},\n", " %{module: Makeup.Lexers.IdrisLexer, name: \"Idris\", shortnames: [\"idris\", \"idr\"]},\n", " %{module: Makeup.Lexers.IgorLexer, name: \"Igor\", shortnames: [\"igor\", \"igorpro\"]},\n", " %{module: Makeup.Lexers.Inform6Lexer, name: \"Inform 6\", shortnames: [\"inform6\", \"i6\"]},\n", " %{module: Makeup.Lexers.Inform6TemplateLexer, name: \"Inform 6 template\", shortnames: [\"i6t\"]},\n", " %{module: Makeup.Lexers.Inform7Lexer, name: \"Inform 7\", shortnames: [\"inform7\", \"i7\"]},\n", " %{module: Makeup.Lexers.IniLexer, name: \"INI\", shortnames: [\"ini\", \"cfg\", \"dosini\"]},\n", " %{module: Makeup.Lexers.IoLexer, name: \"Io\", shortnames: [\"io\"]},\n", " %{module: Makeup.Lexers.IokeLexer, name: \"Ioke\", shortnames: [\"ioke\", \"ik\"]},\n", " %{module: Makeup.Lexers.IrcLogsLexer, name: \"IRC logs\", shortnames: [\"irc\"]},\n", " %{module: Makeup.Lexers.IsabelleLexer, name: \"Isabelle\", shortnames: [\"isabelle\"]},\n", " %{module: Makeup.Lexers.JLexer, name: \"J\", shortnames: [\"j\"]},\n", " %{module: Makeup.Lexers.JagsLexer, name: \"JAGS\", shortnames: [\"jags\"]},\n", " %{module: Makeup.Lexers.JasminLexer, name: \"Jasmin\", shortnames: [\"jasmin\", \"jasminxt\"]},\n", " %{module: Makeup.Lexers.JavaLexer, name: \"Java\", shortnames: [\"java\"]},\n", " %{module: Makeup.Lexers.JavascriptDjangoLexer, name: \"JavaScript+Django/Jinja\", shortnames: [\"js+django\", \"javascript+django\", \"js+jinja\", \"javascript+jinja\"]},\n", " %{module: Makeup.Lexers.JavascriptErbLexer, name: \"JavaScript+Ruby\", shortnames: [\"js+erb\", \"javascript+erb\", \"js+ruby\", \"javascript+ruby\"]},\n", " %{module: Makeup.Lexers.JavascriptGenshiLexer, name: \"JavaScript+Genshi Text\", shortnames: [\"js+genshitext\", \"js+genshi\", \"javascript+genshitext\", \"javascript+genshi\"]},\n", " %{module: Makeup.Lexers.JavascriptLexer, name: \"JavaScript\", shortnames: [\"js\", \"javascript\"]},\n", " %{module: Makeup.Lexers.JavascriptPhpLexer, name: \"JavaScript+PHP\", shortnames: [\"js+php\", \"javascript+php\"]},\n", " %{module: Makeup.Lexers.JavascriptSmartyLexer, name: \"JavaScript+Smarty\", shortnames: [\"js+smarty\", \"javascript+smarty\"]},\n", " %{module: Makeup.Lexers.JclLexer, name: \"JCL\", shortnames: [\"jcl\"]},\n", " %{module: Makeup.Lexers.JsgfLexer, name: \"JSGF\", shortnames: [\"jsgf\"]},\n", " %{module: Makeup.Lexers.JsonBareObjectLexer, name: \"JSONBareObject\", shortnames: [\"json-object\"]},\n", " %{module: Makeup.Lexers.JsonLdLexer, name: \"JSON-LD\", shortnames: [\"jsonld\", \"json-ld\"]},\n", " %{module: Makeup.Lexers.JsonLexer, name: \"JSON\", shortnames: [\"json\"]},\n", " %{module: Makeup.Lexers.JspLexer, name: \"Java Server Page\", shortnames: [\"jsp\"]},\n", " %{module: Makeup.Lexers.JuliaConsoleLexer, name: \"Julia console\", shortnames: [\"jlcon\"]},\n", " %{module: Makeup.Lexers.JuliaLexer, name: \"Julia\", shortnames: [\"julia\", \"jl\"]},\n", " %{module: Makeup.Lexers.JuttleLexer, name: \"Juttle\", shortnames: [\"juttle\", \"juttle\"]},\n", " %{module: Makeup.Lexers.KalLexer, name: \"Kal\", shortnames: [\"kal\"]},\n", " %{module: Makeup.Lexers.KconfigLexer, name: \"Kconfig\", shortnames: [\"kconfig\", \"menuconfig\", \"linux-config\", \"kernel-config\"]},\n", " %{module: Makeup.Lexers.KokaLexer, name: \"Koka\", shortnames: [\"koka\"]},\n", " %{module: Makeup.Lexers.KotlinLexer, name: \"Kotlin\", shortnames: [\"kotlin\"]},\n", " %{module: Makeup.Lexers.LSLLexer, name: \"LSL\", shortnames: [\"lsl\"]},\n", " %{module: Makeup.Lexers.LassoCssLexer, name: \"CSS+Lasso\", shortnames: [\"css+lasso\"]},\n", " %{module: Makeup.Lexers.LassoHtmlLexer, name: \"HTML+Lasso\", shortnames: [\"html+lasso\"]},\n", " %{module: Makeup.Lexers.LassoJavascriptLexer, name: \"JavaScript+Lasso\", shortnames: [\"js+lasso\", \"javascript+lasso\"]},\n", " %{module: Makeup.Lexers.LassoLexer, name: \"Lasso\", shortnames: [\"lasso\", \"lassoscript\"]},\n", " %{module: Makeup.Lexers.LassoXmlLexer, name: \"XML+Lasso\", shortnames: [\"xml+lasso\"]},\n", " %{module: Makeup.Lexers.LeanLexer, name: \"Lean\", shortnames: [\"lean\"]},\n", " %{module: Makeup.Lexers.LessCssLexer, name: \"LessCss\", shortnames: [\"less\"]},\n", " %{module: Makeup.Lexers.LighttpdConfLexer, name: \"Lighttpd configuration file\", shortnames: [\"lighty\", \"lighttpd\"]},\n", " %{module: Makeup.Lexers.LimboLexer, name: \"Limbo\", shortnames: [\"limbo\"]},\n", " %{module: Makeup.Lexers.LiquidLexer, name: \"liquid\", shortnames: [\"liquid\"]},\n", " %{module: Makeup.Lexers.LiterateAgdaLexer, name: \"Literate Agda\", shortnames: [\"lagda\", \"literate-agda\"]},\n", " %{module: Makeup.Lexers.LiterateCryptolLexer, name: \"Literate Cryptol\", shortnames: [\"lcry\", \"literate-cryptol\", \"lcryptol\"]},\n", " %{module: Makeup.Lexers.LiterateHaskellLexer, name: \"Literate Haskell\", shortnames: [\"lhs\", \"literate-haskell\", \"lhaskell\"]},\n", " %{module: Makeup.Lexers.LiterateIdrisLexer, name: \"Literate Idris\", shortnames: [\"lidr\", \"literate-idris\", \"lidris\"]},\n", " %{module: Makeup.Lexers.LiveScriptLexer, name: \"LiveScript\", shortnames: [\"live-script\", \"livescript\"]},\n", " %{module: Makeup.Lexers.LlvmLexer, name: \"LLVM\", shortnames: [\"llvm\"]},\n", " %{module: Makeup.Lexers.LogosLexer, name: \"Logos\", shortnames: [\"logos\"]},\n", " %{module: Makeup.Lexers.LogtalkLexer, name: \"Logtalk\", shortnames: [\"logtalk\"]},\n", " %{module: Makeup.Lexers.LuaLexer, name: \"Lua\", shortnames: [\"lua\"]},\n", " %{module: Makeup.Lexers.MOOCodeLexer, name: \"MOOCode\", shortnames: [\"moocode\", \"moo\"]},\n", " %{module: Makeup.Lexers.MSDOSSessionLexer, name: \"MSDOS Session\", shortnames: [\"doscon\"]},\n", " %{module: Makeup.Lexers.MakefileLexer, name: \"Makefile\", shortnames: [\"make\", \"makefile\", \"mf\", \"bsdmake\"]},\n", " %{module: Makeup.Lexers.MakoCssLexer, name: \"CSS+Mako\", shortnames: [\"css+mako\"]},\n", " %{module: Makeup.Lexers.MakoHtmlLexer, name: \"HTML+Mako\", shortnames: [\"html+mako\"]},\n", " %{module: Makeup.Lexers.MakoJavascriptLexer, name: \"JavaScript+Mako\", shortnames: [\"js+mako\", \"javascript+mako\"]},\n", " %{module: Makeup.Lexers.MakoLexer, name: \"Mako\", shortnames: [\"mako\"]},\n", " %{module: Makeup.Lexers.MakoXmlLexer, name: \"XML+Mako\", shortnames: [\"xml+mako\"]},\n", " %{module: Makeup.Lexers.MaqlLexer, name: \"MAQL\", shortnames: [\"maql\"]},\n", " %{module: Makeup.Lexers.MarkdownLexer, name: \"markdown\", shortnames: [\"md\"]},\n", " %{module: Makeup.Lexers.MaskLexer, name: \"Mask\", shortnames: [\"mask\"]},\n", " %{module: Makeup.Lexers.MasonLexer, name: \"Mason\", shortnames: [\"mason\"]},\n", " %{module: Makeup.Lexers.MathematicaLexer, name: \"Mathematica\", shortnames: [\"mathematica\", \"mma\", \"nb\"]},\n", " %{module: Makeup.Lexers.MatlabLexer, name: \"Matlab\", shortnames: [\"matlab\"]},\n", " %{module: Makeup.Lexers.MatlabSessionLexer, name: \"Matlab session\", shortnames: [\"matlabsession\"]},\n", " %{module: Makeup.Lexers.MiniDLexer, name: \"MiniD\", shortnames: [\"minid\"]},\n", " %{module: Makeup.Lexers.ModelicaLexer, name: \"Modelica\", shortnames: [\"modelica\"]},\n", " %{module: Makeup.Lexers.Modula2Lexer, name: \"Modula-2\", shortnames: [\"modula2\", \"m2\"]},\n", " %{module: Makeup.Lexers.MoinWikiLexer, name: \"MoinMoin/Trac Wiki markup\", shortnames: [\"trac-wiki\", \"moin\"]},\n", " %{module: Makeup.Lexers.MonkeyLexer, name: \"Monkey\", shortnames: [\"monkey\"]},\n", " %{module: Makeup.Lexers.MonteLexer, name: \"Monte\", shortnames: [\"monte\"]},\n", " %{module: Makeup.Lexers.MoonScriptLexer, name: \"MoonScript\", shortnames: [\"moon\", \"moonscript\"]},\n", " %{module: Makeup.Lexers.MozPreprocCssLexer, name: \"CSS+mozpreproc\", shortnames: [\"css+mozpreproc\"]},\n", " %{module: Makeup.Lexers.MozPreprocHashLexer, name: \"mozhashpreproc\", shortnames: [\"mozhashpreproc\"]},\n", " %{module: Makeup.Lexers.MozPreprocJavascriptLexer, name: \"Javascript+mozpreproc\", shortnames: [\"javascript+mozpreproc\"]},\n", " %{module: Makeup.Lexers.MozPreprocPercentLexer, name: \"mozpercentpreproc\", shortnames: [\"mozpercentpreproc\"]},\n", " %{module: Makeup.Lexers.MozPreprocXulLexer, name: \"XUL+mozpreproc\", shortnames: [\"xul+mozpreproc\"]},\n", " %{module: Makeup.Lexers.MqlLexer, name: \"MQL\", shortnames: [\"mql\", \"mq4\", \"mq5\", \"mql4\", \"mql5\"]},\n", " %{module: Makeup.Lexers.MscgenLexer, name: \"Mscgen\", shortnames: [\"mscgen\", \"msc\"]},\n", " %{module: Makeup.Lexers.MuPADLexer, name: \"MuPAD\", shortnames: [\"mupad\"]},\n", " %{module: Makeup.Lexers.MxmlLexer, name: \"MXML\", shortnames: [\"mxml\"]},\n", " %{module: Makeup.Lexers.MySqlLexer, name: \"MySQL\", shortnames: [\"mysql\"]},\n", " %{module: Makeup.Lexers.MyghtyCssLexer, name: \"CSS+Myghty\", shortnames: [\"css+myghty\"]},\n", " %{module: Makeup.Lexers.MyghtyHtmlLexer, name: \"HTML+Myghty\", shortnames: [\"html+myghty\"]},\n", " %{module: Makeup.Lexers.MyghtyJavascriptLexer, name: \"JavaScript+Myghty\", shortnames: [\"js+myghty\", \"javascript+myghty\"]},\n", " %{module: Makeup.Lexers.MyghtyLexer, name: \"Myghty\", shortnames: [\"myghty\"]},\n", " %{module: Makeup.Lexers.MyghtyXmlLexer, name: \"XML+Myghty\", shortnames: [\"xml+myghty\"]},\n", " %{module: Makeup.Lexers.NCLLexer, name: \"NCL\", shortnames: [\"ncl\"]},\n", " %{module: Makeup.Lexers.NSISLexer, name: \"NSIS\", shortnames: [\"nsis\", \"nsi\", \"nsh\"]},\n", " %{module: Makeup.Lexers.NasmLexer, name: \"NASM\", shortnames: [\"nasm\"]},\n", " %{module: Makeup.Lexers.NasmObjdumpLexer, name: \"objdump-nasm\", shortnames: [\"objdump-nasm\"]},\n", " %{module: Makeup.Lexers.NemerleLexer, name: \"Nemerle\", shortnames: [\"nemerle\"]},\n", " %{module: Makeup.Lexers.NesCLexer, name: \"nesC\", shortnames: [\"nesc\"]},\n", " %{module: Makeup.Lexers.NewLispLexer, name: \"NewLisp\", shortnames: [\"newlisp\"]},\n", " %{module: Makeup.Lexers.NewspeakLexer, name: \"Newspeak\", shortnames: [\"newspeak\"]},\n", " %{module: Makeup.Lexers.NginxConfLexer, name: \"Nginx configuration file\", shortnames: [\"nginx\"]},\n", " %{module: Makeup.Lexers.NimrodLexer, name: \"Nimrod\", shortnames: [\"nim\", \"nimrod\"]},\n", " %{module: Makeup.Lexers.NitLexer, name: \"Nit\", shortnames: [\"nit\"]},\n", " %{module: Makeup.Lexers.NixLexer, name: \"Nix\", shortnames: [\"nixos\", \"nix\"]},\n", " %{module: Makeup.Lexers.NuSMVLexer, name: \"NuSMV\", shortnames: [\"nusmv\"]},\n", " %{module: Makeup.Lexers.NumPyLexer, name: \"NumPy\", shortnames: [\"numpy\"]},\n", " %{module: Makeup.Lexers.ObjdumpLexer, name: \"objdump\", shortnames: [\"objdump\"]},\n", " %{module: Makeup.Lexers.ObjectiveCLexer, name: \"Objective-C\", shortnames: [\"objective-c\", \"objectivec\", \"obj-c\", \"objc\"]},\n", " %{module: Makeup.Lexers.ObjectiveCppLexer, name: \"Objective-C++\", shortnames: [\"objective-c++\", \"objectivec++\", \"obj-c++\", \"objc++\"]},\n", " %{module: Makeup.Lexers.ObjectiveJLexer, name: \"Objective-J\", shortnames: [\"objective-j\", \"objectivej\", \"obj-j\", \"objj\"]},\n", " %{module: Makeup.Lexers.OcamlLexer, name: \"OCaml\", shortnames: [\"ocaml\"]},\n", " %{module: Makeup.Lexers.OctaveLexer, name: \"Octave\", shortnames: [\"octave\"]},\n", " %{module: Makeup.Lexers.OdinLexer, name: \"ODIN\", shortnames: [\"odin\"]},\n", " %{module: Makeup.Lexers.OocLexer, name: \"Ooc\", shortnames: [\"ooc\"]},\n", " %{module: Makeup.Lexers.OpaLexer, name: \"Opa\", shortnames: [\"opa\"]},\n", " %{module: Makeup.Lexers.OpenEdgeLexer, name: \"OpenEdge ABL\", shortnames: [\"openedge\", \"abl\", \"progress\"]},\n", " %{module: Makeup.Lexers.PacmanConfLexer, name: \"PacmanConf\", shortnames: [\"pacmanconf\"]},\n", " %{module: Makeup.Lexers.PanLexer, name: \"Pan\", shortnames: [\"pan\"]},\n", " %{module: Makeup.Lexers.ParaSailLexer, name: \"ParaSail\", shortnames: [\"parasail\"]},\n", " %{module: Makeup.Lexers.PawnLexer, name: \"Pawn\", shortnames: [\"pawn\"]},\n", " %{module: Makeup.Lexers.Perl6Lexer, name: \"Perl6\", shortnames: [\"perl6\", \"pl6\"]},\n", " %{module: Makeup.Lexers.PerlLexer, name: \"Perl\", shortnames: [\"perl\", \"pl\"]},\n", " %{module: Makeup.Lexers.PhpLexer, name: \"PHP\", shortnames: [\"php\", \"php3\", \"php4\", \"php5\"]},\n", " %{module: Makeup.Lexers.PigLexer, name: \"Pig\", shortnames: [\"pig\"]},\n", " %{module: Makeup.Lexers.PikeLexer, name: \"Pike\", shortnames: [\"pike\"]},\n", " %{module: Makeup.Lexers.PkgConfigLexer, name: \"PkgConfig\", shortnames: [\"pkgconfig\"]},\n", " %{module: Makeup.Lexers.PlPgsqlLexer, name: \"PL/pgSQL\", shortnames: [\"plpgsql\"]},\n", " %{module: Makeup.Lexers.PostScriptLexer, name: \"PostScript\", shortnames: [\"postscript\", \"postscr\"]},\n", " %{module: Makeup.Lexers.PostgresConsoleLexer, name: \"PostgreSQL console (psql)\", shortnames: [\"psql\", \"postgresql-console\", \"postgres-console\"]},\n", " %{module: Makeup.Lexers.PostgresLexer, name: \"PostgreSQL SQL dialect\", shortnames: [\"postgresql\", \"postgres\"]},\n", " %{module: Makeup.Lexers.PovrayLexer, name: \"POVRay\", shortnames: [\"pov\"]},\n", " %{module: Makeup.Lexers.PowerShellLexer, name: \"PowerShell\", shortnames: [\"powershell\", \"posh\", \"ps1\", \"psm1\"]},\n", " %{module: Makeup.Lexers.PowerShellSessionLexer, name: \"PowerShell Session\", shortnames: [\"ps1con\"]},\n", " %{module: Makeup.Lexers.PraatLexer, name: \"Praat\", shortnames: [\"praat\"]},\n", " %{module: Makeup.Lexers.PrologLexer, name: \"Prolog\", shortnames: [\"prolog\"]},\n", " %{module: Makeup.Lexers.PropertiesLexer, name: \"Properties\", shortnames: [\"properties\", \"jproperties\"]},\n", " %{module: Makeup.Lexers.ProtoBufLexer, name: \"Protocol Buffer\", shortnames: [\"protobuf\", \"proto\"]},\n", " %{module: Makeup.Lexers.PugLexer, name: \"Pug\", shortnames: [\"pug\", \"jade\"]},\n", " %{module: Makeup.Lexers.PuppetLexer, name: \"Puppet\", shortnames: [\"puppet\"]},\n", " %{module: Makeup.Lexers.PyPyLogLexer, name: \"PyPy Log\", shortnames: [\"pypylog\", \"pypy\"]},\n", " %{module: Makeup.Lexers.Python3Lexer, name: \"Python 3\", shortnames: [\"python3\", \"py3\"]},\n", " %{module: Makeup.Lexers.Python3TracebackLexer, name: \"Python 3.0 Traceback\", shortnames: [\"py3tb\"]},\n", " %{module: Makeup.Lexers.PythonConsoleLexer, name: \"Python console session\", shortnames: [\"pycon\"]},\n", " %{module: Makeup.Lexers.PythonLexer, name: \"Python\", shortnames: [\"python\", \"py\", \"sage\"]},\n", " %{module: Makeup.Lexers.PythonTracebackLexer, name: \"Python Traceback\", shortnames: [\"pytb\"]},\n", " %{module: Makeup.Lexers.QBasicLexer, name: \"QBasic\", shortnames: [\"qbasic\", \"basic\"]},\n", " %{module: Makeup.Lexers.QVToLexer, name: \"QVTO\", shortnames: [\"qvto\", \"qvt\"]},\n", " %{module: Makeup.Lexers.QmlLexer, name: \"QML\", shortnames: [\"qml\", \"qbs\"]},\n", " %{module: Makeup.Lexers.RConsoleLexer, name: \"RConsole\", shortnames: [\"rconsole\", \"rout\"]},\n", " %{module: Makeup.Lexers.RNCCompactLexer, name: \"Relax-NG Compact\", shortnames: [\"rnc\", \"rng-compact\"]},\n", " %{module: Makeup.Lexers.RPMSpecLexer, name: \"RPMSpec\", shortnames: [\"spec\"]},\n", " %{module: Makeup.Lexers.RacketLexer, name: \"Racket\", shortnames: [\"racket\", \"rkt\"]},\n", " %{module: Makeup.Lexers.RagelCLexer, name: \"Ragel in C Host\", shortnames: [\"ragel-c\"]},\n", " %{module: Makeup.Lexers.RagelCppLexer, name: \"Ragel in CPP Host\", shortnames: [\"ragel-cpp\"]},\n", " %{module: Makeup.Lexers.RagelDLexer, name: \"Ragel in D Host\", shortnames: [\"ragel-d\"]},\n", " %{module: Makeup.Lexers.RagelEmbeddedLexer, name: \"Embedded Ragel\", shortnames: [\"ragel-em\"]},\n", " %{module: Makeup.Lexers.RagelJavaLexer, name: \"Ragel in Java Host\", shortnames: [\"ragel-java\"]},\n", " %{module: Makeup.Lexers.RagelLexer, name: \"Ragel\", shortnames: [\"ragel\"]},\n", " %{module: Makeup.Lexers.RagelObjectiveCLexer, name: \"Ragel in Objective C Host\", shortnames: [\"ragel-objc\"]},\n", " %{module: Makeup.Lexers.RagelRubyLexer, name: \"Ragel in Ruby Host\", shortnames: [\"ragel-ruby\", \"ragel-rb\"]},\n", " %{module: Makeup.Lexers.RawTokenLexer, name: \"Raw token data\", shortnames: [\"raw\"]},\n", " %{module: Makeup.Lexers.RdLexer, name: \"Rd\", shortnames: [\"rd\"]},\n", " %{module: Makeup.Lexers.RebolLexer, name: \"REBOL\", shortnames: [\"rebol\"]},\n", " %{module: Makeup.Lexers.RedLexer, name: \"Red\", shortnames: [\"red\", \"red/system\"]},\n", " %{module: Makeup.Lexers.RedcodeLexer, name: \"Redcode\", shortnames: [\"redcode\"]},\n", " %{module: Makeup.Lexers.RegeditLexer, name: \"reg\", shortnames: [\"registry\"]},\n", " %{module: Makeup.Lexers.ResourceLexer, name: \"ResourceBundle\", shortnames: [\"resource\", \"resourcebundle\"]},\n", " %{module: Makeup.Lexers.RexxLexer, name: \"Rexx\", shortnames: [\"rexx\", \"arexx\"]},\n", " %{module: Makeup.Lexers.RhtmlLexer, name: \"RHTML\", shortnames: [\"rhtml\", \"html+erb\", \"html+ruby\"]},\n", " %{module: Makeup.Lexers.RoboconfGraphLexer, name: \"Roboconf Graph\", shortnames: [\"roboconf-graph\"]},\n", " %{module: Makeup.Lexers.RoboconfInstancesLexer, name: \"Roboconf Instances\", shortnames: [\"roboconf-instances\"]},\n", " %{module: Makeup.Lexers.RobotFrameworkLexer, name: \"RobotFramework\", shortnames: [\"robotframework\"]},\n", " %{module: Makeup.Lexers.RqlLexer, name: \"RQL\", shortnames: [\"rql\"]},\n", " %{module: Makeup.Lexers.RslLexer, name: \"RSL\", shortnames: [\"rsl\"]},\n", " %{module: Makeup.Lexers.RstLexer, name: \"reStructuredText\", shortnames: [\"rst\", \"rest\", \"restructuredtext\"]},\n", " %{module: Makeup.Lexers.RtsLexer, name: \"TrafficScript\", shortnames: [\"rts\", \"trafficscript\"]},\n", " %{module: Makeup.Lexers.RubyConsoleLexer, name: \"Ruby irb session\", shortnames: [\"rbcon\", \"irb\"]},\n", " %{module: Makeup.Lexers.RubyLexer, name: \"Ruby\", shortnames: [\"rb\", \"ruby\", \"duby\"]},\n", " %{module: Makeup.Lexers.RustLexer, name: \"Rust\", shortnames: [\"rust\"]},\n", " %{module: Makeup.Lexers.SASLexer, name: \"SAS\", shortnames: [\"sas\"]},\n", " %{module: Makeup.Lexers.SLexer, name: \"S\", shortnames: [\"splus\", \"s\", \"r\"]},\n", " %{module: Makeup.Lexers.SMLLexer, name: \"Standard ML\", shortnames: [\"sml\"]},\n", " %{module: Makeup.Lexers.SassLexer, name: \"Sass\", shortnames: [\"sass\"]},\n", " %{module: Makeup.Lexers.ScalaLexer, name: \"Scala\", shortnames: [\"scala\"]},\n", " %{module: Makeup.Lexers.ScamlLexer, name: \"Scaml\", shortnames: [\"scaml\"]},\n", " %{module: Makeup.Lexers.SchemeLexer, name: \"Scheme\", shortnames: [\"scheme\", \"scm\"]},\n", " %{module: Makeup.Lexers.ScilabLexer, name: \"Scilab\", shortnames: [\"scilab\"]},\n", " %{module: Makeup.Lexers.ScssLexer, name: \"SCSS\", shortnames: [\"scss\"]},\n", " %{module: Makeup.Lexers.ShenLexer, name: \"Shen\", shortnames: [\"shen\"]},\n", " %{module: Makeup.Lexers.SilverLexer, name: \"Silver\", shortnames: [\"silver\"]},\n", " %{module: Makeup.Lexers.SlimLexer, name: \"Slim\", shortnames: [\"slim\"]},\n", " %{module: Makeup.Lexers.SmaliLexer, name: \"Smali\", shortnames: [\"smali\"]},\n", " %{module: Makeup.Lexers.SmalltalkLexer, name: \"Smalltalk\", shortnames: [\"smalltalk\", \"squeak\", \"st\"]},\n", " %{module: Makeup.Lexers.SmartyLexer, name: \"Smarty\", shortnames: [\"smarty\"]},\n", " %{module: Makeup.Lexers.SnobolLexer, name: \"Snobol\", shortnames: [\"snobol\"]},\n", " %{module: Makeup.Lexers.SnowballLexer, name: \"Snowball\", shortnames: [\"snowball\"]},\n", " %{module: Makeup.Lexers.SourcePawnLexer, name: \"SourcePawn\", shortnames: [\"sp\"]},\n", " %{module: Makeup.Lexers.SourcesListLexer, name: \"Debian Sourcelist\", shortnames: [\"sourceslist\", \"sources.list\", \"debsources\"]},\n", " %{module: Makeup.Lexers.SparqlLexer, name: \"SPARQL\", shortnames: [\"sparql\"]},\n", " %{module: Makeup.Lexers.SqlLexer, name: \"SQL\", shortnames: [\"sql\"]},\n", " %{module: Makeup.Lexers.SqliteConsoleLexer, name: \"sqlite3con\", shortnames: [\"sqlite3\"]},\n", " %{module: Makeup.Lexers.SquidConfLexer, name: \"SquidConf\", shortnames: [\"squidconf\", \"squid.conf\", \"squid\"]},\n", " %{module: Makeup.Lexers.SspLexer, name: \"Scalate Server Page\", shortnames: [\"ssp\"]},\n", " %{module: Makeup.Lexers.StanLexer, name: \"Stan\", shortnames: [\"stan\"]},\n", " %{module: Makeup.Lexers.StataLexer, name: \"Stata\", shortnames: [\"stata\", \"do\"]},\n", " %{module: Makeup.Lexers.SuperColliderLexer, name: \"SuperCollider\", shortnames: [\"sc\", \"supercollider\"]},\n", " %{module: Makeup.Lexers.SwiftLexer, name: \"Swift\", shortnames: [\"swift\"]},\n", " %{module: Makeup.Lexers.SwigLexer, name: \"SWIG\", shortnames: [\"swig\"]},\n", " %{module: Makeup.Lexers.SystemVerilogLexer, name: \"systemverilog\", shortnames: [\"systemverilog\", \"sv\"]},\n", " %{module: Makeup.Lexers.TAPLexer, name: \"TAP\", shortnames: [\"tap\"]},\n", " %{module: Makeup.Lexers.Tads3Lexer, name: \"TADS 3\", shortnames: [\"tads3\"]},\n", " %{module: Makeup.Lexers.TasmLexer, name: \"TASM\", shortnames: [\"tasm\"]},\n", " %{module: Makeup.Lexers.TclLexer, name: \"Tcl\", shortnames: [\"tcl\"]},\n", " %{module: Makeup.Lexers.TcshLexer, name: \"Tcsh\", shortnames: [\"tcsh\", \"csh\"]},\n", " %{module: Makeup.Lexers.TcshSessionLexer, name: \"Tcsh Session\", shortnames: [\"tcshcon\"]},\n", " %{module: Makeup.Lexers.TeaTemplateLexer, name: \"Tea\", shortnames: [\"tea\"]},\n", " %{module: Makeup.Lexers.TermcapLexer, name: \"Termcap\", shortnames: [\"termcap\"]},\n", " %{module: Makeup.Lexers.TerminfoLexer, name: \"Terminfo\", shortnames: [\"terminfo\"]},\n", " %{module: Makeup.Lexers.TerraformLexer, name: \"Terraform\", shortnames: [\"terraform\", \"tf\"]},\n", " %{module: Makeup.Lexers.TexLexer, name: \"TeX\", shortnames: [\"tex\", \"latex\"]},\n", " %{module: Makeup.Lexers.TextLexer, name: \"Text only\", shortnames: [\"text\"]},\n", " %{module: Makeup.Lexers.ThriftLexer, name: \"Thrift\", shortnames: [\"thrift\"]},\n", " %{module: Makeup.Lexers.TodotxtLexer, name: \"Todotxt\", shortnames: [\"todotxt\"]},\n", " %{module: Makeup.Lexers.TransactSqlLexer, name: \"Transact-SQL\", shortnames: [\"tsql\", \"t-sql\"]},\n", " %{module: Makeup.Lexers.TreetopLexer, name: \"Treetop\", shortnames: [\"treetop\"]},\n", " %{module: Makeup.Lexers.TurtleLexer, name: \"Turtle\", shortnames: [\"turtle\"]},\n", " %{module: Makeup.Lexers.TwigHtmlLexer, name: \"HTML+Twig\", shortnames: [\"html+twig\"]},\n", " %{module: Makeup.Lexers.TwigLexer, name: \"Twig\", shortnames: [\"twig\"]},\n", " %{module: Makeup.Lexers.TypeScriptLexer, name: \"TypeScript\", shortnames: [\"ts\", \"typescript\"]},\n", " %{module: Makeup.Lexers.TypoScriptCssDataLexer, name: \"TypoScriptCssData\", shortnames: [\"typoscriptcssdata\"]},\n", " %{module: Makeup.Lexers.TypoScriptHtmlDataLexer, name: \"TypoScriptHtmlData\", shortnames: [\"typoscripthtmldata\"]},\n", " %{module: Makeup.Lexers.TypoScriptLexer, name: \"TypoScript\", shortnames: [\"typoscript\"]},\n", " %{module: Makeup.Lexers.UrbiscriptLexer, name: \"UrbiScript\", shortnames: [\"urbiscript\"]},\n", " %{module: Makeup.Lexers.VCLLexer, name: \"VCL\", shortnames: [\"vcl\"]},\n", " %{module: Makeup.Lexers.VCLSnippetLexer, name: \"VCLSnippets\", shortnames: [\"vclsnippets\", \"vclsnippet\"]},\n", " %{module: Makeup.Lexers.VCTreeStatusLexer, name: \"VCTreeStatus\", shortnames: [\"vctreestatus\"]},\n", " %{module: Makeup.Lexers.VGLLexer, name: \"VGL\", shortnames: [\"vgl\"]},\n", " %{module: Makeup.Lexers.ValaLexer, name: \"Vala\", shortnames: [\"vala\", \"vapi\"]},\n", " %{module: Makeup.Lexers.VbNetAspxLexer, name: \"aspx-vb\", shortnames: [\"aspx-vb\"]},\n", " %{module: Makeup.Lexers.VbNetLexer, name: \"VB.net\", shortnames: [\"vb.net\", \"vbnet\"]},\n", " %{module: Makeup.Lexers.VelocityHtmlLexer, name: \"HTML+Velocity\", shortnames: [\"html+velocity\"]},\n", " %{module: Makeup.Lexers.VelocityLexer, name: \"Velocity\", shortnames: [\"velocity\"]},\n", " %{module: Makeup.Lexers.VelocityXmlLexer, name: \"XML+Velocity\", shortnames: [\"xml+velocity\"]},\n", " %{module: Makeup.Lexers.VerilogLexer, name: \"verilog\", shortnames: [\"verilog\", \"v\"]},\n", " %{module: Makeup.Lexers.VhdlLexer, name: \"vhdl\", shortnames: [\"vhdl\"]},\n", " %{module: Makeup.Lexers.VimLexer, name: \"VimL\", shortnames: [\"vim\"]},\n", " %{module: Makeup.Lexers.WDiffLexer, name: \"WDiff\", shortnames: [\"wdiff\"]},\n", " %{module: Makeup.Lexers.WhileyLexer, name: \"Whiley\", shortnames: [\"whiley\"]},\n", " %{module: Makeup.Lexers.X10Lexer, name: \"X10\", shortnames: [\"x10\", \"xten\"]},\n", " %{module: Makeup.Lexers.XQueryLexer, name: \"XQuery\", shortnames: [\"xquery\", \"xqy\", \"xq\", \"xql\", \"xqm\"]},\n", " %{module: Makeup.Lexers.XmlDjangoLexer, name: \"XML+Django/Jinja\", shortnames: [\"xml+django\", \"xml+jinja\"]},\n", " %{module: Makeup.Lexers.XmlErbLexer, name: \"XML+Ruby\", shortnames: [\"xml+erb\", \"xml+ruby\"]},\n", " %{module: Makeup.Lexers.XmlLexer, name: \"XML\", shortnames: [\"xml\"]},\n", " %{module: Makeup.Lexers.XmlPhpLexer, name: \"XML+PHP\", shortnames: [\"xml+php\"]},\n", " %{module: Makeup.Lexers.XmlSmartyLexer, name: \"XML+Smarty\", shortnames: [\"xml+smarty\"]},\n", " %{module: Makeup.Lexers.XsltLexer, name: \"XSLT\", shortnames: [\"xslt\"]},\n", " %{module: Makeup.Lexers.XtendLexer, name: \"Xtend\", shortnames: [\"xtend\"]},\n", " %{module: Makeup.Lexers.XtlangLexer, name: \"xtlang\", shortnames: [\"extempore\"]},\n", " %{module: Makeup.Lexers.YamlJinjaLexer, name: \"YAML+Jinja\", shortnames: [\"yaml+jinja\", \"salt\", \"sls\"]},\n", " %{module: Makeup.Lexers.YamlLexer, name: \"YAML\", shortnames: [\"yaml\"]},\n", " %{module: Makeup.Lexers.ZephirLexer, name: \"Zephir\", shortnames: [\"zephir\"]},\n", " %{module: Makeup.Lexers.MakoLexer, name: \"Mako\", shortnames: [\"mako\"]},\n", " %{module: Makeup.Lexers.MakoHtmlLexer, name: \"HTML+Mako\", shortnames: [\"html+mako\"]},\n", " %{module: Makeup.Lexers.MakoXmlLexer, name: \"XML+Mako\", shortnames: [\"xml+mako\"]},\n", " %{module: Makeup.Lexers.MakoJavascriptLexer, name: \"JavaScript+Mako\", shortnames: [\"js+mako\", \"javascript+mako\"]},\n", " %{module: Makeup.Lexers.MakoCssLexer, name: \"CSS+Mako\", shortnames: [\"css+mako\"]}\n" ] } ], "source": [ "def get_lexer_data():\n", " data = []\n", " for lexer in get_all_lexers():\n", " (name, shortnames, filetypes, mimetypes) = lexer\n", " lexer_class = pygments.lexers.get_lexer_by_name(shortnames[0])\n", " row = {\n", " 'class_name': lexer_class.__class__.__name__,\n", " 'name': name,\n", " 'shortnames': shortnames,\n", " 'filetypes': filetypes,\n", " 'mimetypes': mimetypes\n", " }\n", " data.append(row)\n", " return data\n", " \n", "template = jinja2.Template(\"\"\"\n", "%{\n", "{% for lexer in lexer_data %}\n", " %{\\\n", "module: Makeup.Lexers.{{ lexer['class_name'] }}, \\\n", "name: \"{{ lexer['name'] }}\", \\\n", "shortnames: [{% for shortname in lexer['shortnames'] %}\"{{ shortname }}\"{% if not loop.last %}, {% endif %}{% endfor %}]}\\\n", "{% if not loop.last %},{% endif %}\n", "{%- endfor %}\\\n", "\"\"\")\n", "\n", "print(template.render(lexer_data=get_lexer_data()))" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "['ClassNotFound',\n", " 'LEXERS',\n", " 'PythonLexer',\n", " '__all__',\n", " '__builtins__',\n", " '__cached__',\n", " '__doc__',\n", " '__file__',\n", " '__loader__',\n", " '__name__',\n", " '__package__',\n", " '__path__',\n", " '__spec__',\n", " '_automodule',\n", " '_fn_matches',\n", " '_iter_lexerclasses',\n", " '_lexer_cache',\n", " '_load_lexers',\n", " '_mapping',\n", " '_pattern_cache',\n", " 'actionscript',\n", " 'agile',\n", " 'basename',\n", " 'css',\n", " 'd',\n", " 'data',\n", " 'factor',\n", " 'find_lexer_class',\n", " 'find_lexer_class_by_name',\n", " 'find_lexer_class_for_filename',\n", " 'find_plugin_lexers',\n", " 'fnmatch',\n", " 'get_all_lexers',\n", " 'get_filetype_from_buffer',\n", " 'get_lexer_by_name',\n", " 'get_lexer_for_filename',\n", " 'get_lexer_for_mimetype',\n", " 'guess_decode',\n", " 'guess_lexer',\n", " 'guess_lexer_for_filename',\n", " 'html',\n", " 'iolang',\n", " 'itervalues',\n", " 'javascript',\n", " 'jvm',\n", " 'lisp',\n", " 'load_lexer_from_file',\n", " 'perl',\n", " 'php',\n", " 'python',\n", " 're',\n", " 'ruby',\n", " 'scripting',\n", " 'tcl',\n", " 'web',\n", " 'webmisc']" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dir(pygments.lexers)" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "'CheetahHtmlLexer'" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pygments.lexers.get_lexer_by_name(\"HTML+Cheetah\").__class__.__name__" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.0" } }, "nbformat": 4, "nbformat_minor": 2 } makeup-1.1.1/lib/000077500000000000000000000000001441251027100135375ustar00rootroot00000000000000makeup-1.1.1/lib/makeup.ex000066400000000000000000000044661441251027100153710ustar00rootroot00000000000000defmodule Makeup do @moduledoc """ Syntax highlighting library for code, inspired by Pygments. By default, it doesn't include any lexers. You must import them separately (even the Elixir lexer). """ alias Makeup.Formatters.HTML.HTMLFormatter alias Makeup.Lexers.ElixirLexer alias Makeup.Registry @doc """ Highlights the given string using the given lexer and formatter. By default it highlight the Elixir language using `Makeup.Formatters.HTML.HTMLFormatter`. ## Options: - `:lexer` - module name of the lexer to use (default: `Makeup.Lexers.ElixirLexer`) - `:lexer_options` - list of options for the lexer - `:formatter` - module name of the formatter to use (defult: `Makeup.Formatters.HTML.HTMLFormatter`) - `:formatter_options` - list of options for the formatter. For the included HTMLFormatter, that's: - `:css_class` - css class(es) of the main `
` element (default: `"highlight"`)
    - `:highlight_tag` - tag that wraps every token (default: `"span"`)
  """
  def highlight(source, options \\ []) do
    {lexer, lexer_options} = fetch_lexer(options)

    formatter =
      case options[:formatter] do
        nil -> HTMLFormatter
        module when is_atom(module) -> module
      end

    formatter_options = Keyword.get(options, :formatter_options, [])
    tokens = apply(lexer, :lex, [source, lexer_options])
    apply(formatter, :format_as_binary, [tokens, formatter_options])
  end

  defp fetch_lexer(options) do
    {lexer, lexer_options} =
      case options[:lexer] do
        nil -> {ElixirLexer, []}
        module when is_atom(module) -> {module, []}
        name -> Registry.fetch_lexer_by_name!(name)
      end

    {lexer, Keyword.merge(lexer_options, Keyword.get(options, :lexer_options, []))}
  end

  @doc """
  Generates a CSS stylesheet for highlighted code for the given style.

  It expects a `style`, either as an atom name or as "style map",
  and the `css_class` as the top level class for highlighted code.

  For example, if the `css_class` is `"highlight"` (the default), the stylesheet
  has the form:

  ```css
  .highlight .someclass {...}
  .highlight .anotherclass {...}
  ```

  See `Makeup.Styles.HTML.StyleMap` for all style maps.
  """
  def stylesheet(style \\ :default_style, css_class \\ "highlight") do
    HTMLFormatter.stylesheet(style, css_class)
  end
end
makeup-1.1.1/lib/makeup/000077500000000000000000000000001441251027100150215ustar00rootroot00000000000000makeup-1.1.1/lib/makeup/application.ex000066400000000000000000000004111441251027100176560ustar00rootroot00000000000000defmodule Makeup.Application do
  @moduledoc false
  use Application

  alias Makeup.Registry

  def start(_type, _args) do
    Registry.create_name_registry()
    Registry.create_extension_registry()
    Supervisor.start_link([], strategy: :one_for_one)
  end
end
makeup-1.1.1/lib/makeup/formatter.ex000066400000000000000000000000651441251027100173630ustar00rootroot00000000000000defmodule Makeup.Formatter do
  @moduledoc false
end
makeup-1.1.1/lib/makeup/formatters/000077500000000000000000000000001441251027100172075ustar00rootroot00000000000000makeup-1.1.1/lib/makeup/formatters/html/000077500000000000000000000000001441251027100201535ustar00rootroot00000000000000makeup-1.1.1/lib/makeup/formatters/html/html_formatter.ex000066400000000000000000000071701441251027100235450ustar00rootroot00000000000000defmodule Makeup.Formatters.HTML.HTMLFormatter do
  @moduledoc """
  Turns a list of tokens into HTML fragments.
  """

  @group_highlight_js "lib/makeup/formatters/html/scripts/group_highlighter_javascript.js" |> File.read!

  defp render_token(escaped_value, css_class, meta, highlight_tag) do
    group_id = meta[:group_id]
    selectable = Map.get(meta, :selectable, [])

    classes = [
      css_class || [],
      if selectable == false do " unselectable" else [] end
    ]

    [
      "<",
      highlight_tag,
      ~S( class="),
      classes,
      ~S("),
      if group_id do [~S( data-group-id="), group_id, ~S(")] else [] end,
      ">",
      escaped_value,
      "",
    ]
  end

  @doc """
  Format a single token into an iolist.
  """
  def format_token({tag, meta, value}, highlight_tag) do
    escaped_value = escape(value)
    css_class = Makeup.Token.Utils.css_class_for_token_type(tag)
    render_token(escaped_value, css_class, meta, highlight_tag)
  end

  defp escape_for(?&), do: "&"

  defp escape_for(?<), do: "<"

  defp escape_for(?>), do: ">"

  defp escape_for(?"), do: """

  defp escape_for(?'), do: "'"

  defp escape_for(c) when is_integer(c) and c <= 127, do: c

  defp escape_for(c) when is_integer(c) and c >= 128, do: << c :: utf8 >>

  defp escape_for(string) when is_binary(string) do
    string
    |> to_charlist()
    |> Enum.map(&escape_for/1)
  end

  defp escape(iodata) when is_list(iodata) do
    iodata
    |> :lists.flatten()
    |> Enum.map(&escape_for/1)
  end

  defp escape(other) when is_binary(other) do
    escape_for(other)
  end

  defp escape(c) when is_integer(c) do
    [escape_for(c)]
  end

  defp escape(other) do
    raise "Found `#{inspect(other)}` inside what should be an iolist"
  end

  @doc """
  Turns a list of tokens into an iolist which represents an HTML fragment.
  This fragment can be embedded directly into an HTML document.
  """
  def format_inner_as_iolist(tokens, opts) do
    highlight_tag = Keyword.get(opts, :highlight_tag, "span")
    Enum.map(tokens, &format_token(&1, highlight_tag))
  end

  @doc """
  Turns a list of tokens into an HTML fragment.
  This fragment can be embedded directly into an HTML document.
  """
  def format_inner_as_binary(tokens, opts) do
    tokens
    |> format_inner_as_iolist(opts)
    |> IO.iodata_to_binary
  end

  @doc """
  Turns a list of tokens into an iolist which represents an HTML fragment.
  This fragment can be embedded directly into an HTML document.
  """
  def format_as_iolist(tokens, opts \\ []) do
    css_class = Keyword.get(opts, :css_class, "highlight")
    inner = format_inner_as_iolist(tokens, opts)

    [
      ~S(
),
      inner,
      ~S(
) ] end @doc """ Turns a list of tokens into an HTML fragment. This fragment can be embedded directly into an HTML document. """ def format_as_binary(tokens, opts \\ []) do tokens |> format_as_iolist(opts) |> IO.iodata_to_binary end @doc """ Return the CSS stylesheet for a given style. """ def stylesheet(style \\ :default_style, css_class \\ "highlight") def stylesheet(style, css_class) when is_atom(style) do stylesheet(apply(Makeup.Styles.HTML.StyleMap, style, []), css_class) end def stylesheet(style, css_class) do Makeup.Styles.HTML.Style.stylesheet(style, css_class) end @doc """ Return a JavaScript snippet to highlight code on mouseover. This is "raw" javascript, and for inclusion in an HTML file it must be wrapped in a `