{"id":13591002,"url":"https://github.com/andre-simon/highlight","last_synced_at":"2025-04-08T14:32:16.418Z","repository":{"id":217516706,"uuid":"86112619","full_name":"andre-simon/highlight","owner":"andre-simon","description":"Source code to formatted text converter ","archived":true,"fork":false,"pushed_at":"2018-07-20T19:12:24.000Z","size":3888,"stargazers_count":207,"open_issues_count":3,"forks_count":58,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-06T11:45:11.571Z","etag":null,"topics":["escape-sequences","html","latex","rtf","syntax-highlighting","tex"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andre-simon.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-24T21:37:29.000Z","updated_at":"2024-11-05T11:27:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"46d64226-9c4e-4f01-b34c-15b05c81698d","html_url":"https://github.com/andre-simon/highlight","commit_stats":null,"previous_names":["andre-simon/highlight"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-simon%2Fhighlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-simon%2Fhighlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-simon%2Fhighlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-simon%2Fhighlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andre-simon","download_url":"https://codeload.github.com/andre-simon/highlight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247860887,"owners_count":21008374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["escape-sequences","html","latex","rtf","syntax-highlighting","tex"],"created_at":"2024-08-01T16:00:52.625Z","updated_at":"2025-04-08T14:32:16.409Z","avatar_url":"https://github.com/andre-simon.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"\n*** Since Github is now part of Mordor Corp, the highlight Git repo        ***\n*** moved to https://gitlab.com/saalen/highlight                           ***\n\n-------------------------------------------------------------------------------\n---  HIGHLIGHT MANUAL -------  Version 3.43   ------------------ April 2018 ---\n-------------------------------------------------------------------------------\n\nOSI Certified Open Source Software\n\nDeutsche Anleitung: README_DE\n\nCONTENT\n-------------------------------------------------------------------------------\n\n1. OVERVIEW\n   1.1 INTENDED PURPOSE\n   1.2 FEATURE LIST\n   1.3 SUPPORTED PROGRAMMING AND MARKUP LANGUAGES\n\n2. USAGE AND OPTIONS\n   2.1 QUICK INTRODUCTION\n   2.2 CLI OPTIONS\n   2.3 GUI OPTIONS\n   2.4 INPUT AND OUTPUT\n   2.5 GNU SOURCE-HIGHLIGHT COMPATIBILITY\n   2.6 ADVANCED OPTIONS\n   2.7 ENVIRONMENT VARIABLES\n\n3. CONFIGURATION\n   3.1 FILE FORMAT\n   3.2 LANGUAGE DEFINITIONS \n   3.3 REGULAR EXPRESSIONS\n   3.4 THEME DEFINITIONS\n   3.5 KEYWORD GROUPS\n   3.6 PLUG-INS\n   3.7 FILE MAPPING\n   3.8 CONFIG FILE SEARCH\n\n4. EMBEDDING HIGHLIGHT\n   4.1 SAMPLE SCRIPTS\n   4.2 PANDOC\n   4.3 SWIG\n   4.4 TCL\n   4.5 THIRD PARTY SCRIPTS AND PLUG-INS\n\n5. BUILDING AND INSTALLING\n   5.1 PRECOMPILED PACKAGES\n   5.2 BUILDING DEPENDENCIES\n\n6. DEVELOPER CONTACT\n\n\n1. OVERVIEW\n-------------------------------------------------------------------------------\n\nHighlight converts sourcecode to HTML, XHTML, RTF, ODT, LaTeX, TeX, SVG, BBCode, \nPango markup and terminal escape sequences with coloured syntax highlighting.\nLanguage definitions and colour themes are customizable.\n\n\n1.1 INTENDED PURPOSE\n-------------------------------------------------------------------------------\n\nHighlight was designed to offer a flexible but easy to use syntax highlighter\nfor several output formats. No syntax or colouring information is hardcoded,\ninstead all relevant data is stored in configuration scripts. These Lua scripts\nmay be altered and enhanced with plug-in scripts.\n\n\n1.2 FEATURE LIST\n-------------------------------------------------------------------------------\n\n* highlighting of keywords, types, strings, numbers, escape sequences, comments,\n  operators and preprocessor directives\n* coloured output in HTML, XHTML 1.1, RTF, TeX, LaTeX, SVG, BBCode, Pango Markup \n  and terminal escape sequences\n* supports referenced stylesheet files for HTML, LaTeX, TeX or SVG output\n* configuration files are Lua scripts\n* supports plug-in scripts to tweak language definitions and themes\n* syntax elements are defined as regular expressions or plain string lists\n* customizable keyword groups\n* recognition of nested languages within a file\n* reformatting and indentation of C, C++, C# and Java source code\n* wrapping of long lines\n* configurable output of line numbers\n\n\n1.3 SUPPORTED PROGRAMMING AND MARKUP LANGUAGES\n-------------------------------------------------------------------------------\n\nPlease see README_LANGLIST for the current set of supported languages.\nYou may also run \"highlight --list-scripts=langs\" to get a list and associated\nfile extensions.\n\n\n2. USAGE AND OPTIONS\n-------------------------------------------------------------------------------\n\n2.1 QUICK INTRODUCTION\n-------------------------------------------------------------------------------\n\nThe following examples show how to produce a highlighted C++ file, using \nmain.cpp as input file:\n\n- Generate HTML:\n  highlight -i main.cpp -o main.cpp.html\n  highlight \u003c main.cpp \u003e main.cpp.html --syntax cpp\n\n  You will find the HTML file and highlight.css in the working directory.\n  If you use IO redirection (2nd example), you must define the programming\n  language with --syntax.\n\n- Generate HTML with embedded CSS definitions and line numbers:\n  highlight -i main.cpp -o main.cpp.html --include-style --line-numbers\n\n- Generate HTML with inline CSS definitions:\n  highlight -i main.cpp -o main.cpp.html --inline-css\n\n- Generate LaTeX using \"horstmann\" source formatting style and \"neon\" colour\n  theme: \n  highlight -O latex -i main.cpp -o main.cpp.tex --reformat horstmann --style neon\n\n  The following output formats may be defined with --out-format:\n  \n  html:      HTML5 (default)\n  xhtml:     XHTML 1.1\n  tex:       Plain TeX\n  latex:     LaTeX\n  rtf:       RTF\n  odt:       OpenDocument Text (Flat XML)\n  svg:       SVG\n  bbcode:    BBCode\n  pango:     Pango markup\n  ansi:      Terminal 16 color escape codes\n  xterm256:  Terminal 256 color escape codes\n  truecolor: Terminal 16m color escape codes\n\n- Customize font settings:\n  highlight --syntax ada --font-size 12 --font \"'Courier New',monospace\"\n  highlight --syntax ada --out-format=latex --font-size tiny --font sffamily\n\n- Define an output directory:\n  highlight -d some/target/dir/ *.cpp *.h\n\nSee \"highlight --help\" or \"man highlight\" for more details.\n\n\n2.2 CLI OPTIONS\n-------------------------------------------------------------------------------\n\nThe command line version of highlight offers the following options:\n\nUSAGE: highlight [OPTIONS]... [FILES]...\n\nGeneral options:\n\n -B, --batch-recursive=\u003cwc\u003e     convert all matching files, searches subdirs\n                                  (Example: -B '*.cpp')\n -D, --data-dir=\u003cdirectory\u003e     set path to data directory\n     --config-file=\u003cfile\u003e       set path to a lang or theme file\n -d, --outdir=\u003cdirectory\u003e       name of output directory\n -h, --help                     print this help\n -i, --input=\u003cfile\u003e             name of single input file\n -o, --output=\u003cfile\u003e            name of single output file\n -P, --progress                 print progress bar in batch mode\n -q, --quiet                    supress progress info in batch mode\n -S, --syntax=\u003ctype\u003e            specify type of source code\n -v, --verbose                  print debug info\n     --force                    generate output if input syntax is unknown\n     --list-scripts=\u003ctype\u003e      list installed scripts\n                                  \u003ctype\u003e = [langs, themes, plugins]\n     --plug-in=\u003cscript\u003e         execute Lua plug-in script; repeat option to\n                                  execute multiple plug-ins\n     --plug-in-param=\u003cvalue\u003e    set plug-in input parameter\n     --print-config             print path configuration\n     --print-style              print stylesheet only (see --style-outfile)\n     --skip=\u003clist\u003e              ignore listed unknown file types\n                                  (Example: --skip='bak;c~;h~')\n     --start-nested=\u003clang\u003e      define nested language which starts input\n                                  without opening delimiter\n     --stdout                   output to stdout (batch mode, --print-style)\n     --validate-input           test if input is text, remove Unicode BOM\n     --version                  print version and copyright information\n\n\nOutput formatting options:\n\n -O, --out-format=\u003cformat\u003e      output file in given format\n                                  \u003cformat\u003e=[html, xhtml, latex, tex, odt, rtf,\n                                  ansi, xterm256, truecolor, bbcode, pango, svg]\n -c, --style-outfile=\u003cfile\u003e     name of style file or print to stdout, if\n                                  'stdout' is given as file argument\n -e, --style-infile=\u003cfile\u003e      to be included in style-outfile (deprecated)\n                                  use a plug-in file instead\n -f, --fragment                 omit document header and footer\n -F, --reformat=\u003cstyle\u003e         reformats and indents output in given style\n                                  \u003cstyle\u003e = [allman, banner, gnu,\n                                  horstmann, java, kr, linux, mozilla, otbs, vtk,\n                                  stroustrup, whitesmith, google, pico, lisp]\n -I, --include-style            include style definition in output file\n -J, --line-length=\u003cnum\u003e        line length before wrapping (see -V, -W)\n -j, --line-number-length=\u003cnum\u003e line number width incl. left padding (default: 5)\n -k, --font=\u003cfont\u003e              set font (specific to output format)\n -K, --font-size=\u003cnum?\u003e         set font size (specific to output format)\n -l, --line-numbers             print line numbers in output file\n -m, --line-number-start=\u003ccnt\u003e  start line numbering with cnt (assumes -l)\n -s, --style=\u003cstyle\u003e            set colour style (theme)\n -t, --replace-tabs=\u003cnum\u003e       replace tabs by \u003cnum\u003e spaces\n -T, --doc-title=\u003ctitle\u003e        document title\n -u, --encoding=\u003cenc\u003e           set output encoding which matches input file\n                                  encoding; omit encoding info if set to NONE\n -V, --wrap-simple              wrap lines after 80 (default) characters w/o\n                                  indenting function parameters and statements\n -W, --wrap                     wrap lines after 80 (default) characters\n     --wrap-no-numbers          omit line numbers of wrapped lines\n                                  (assumes -l)\n -z, --zeroes                   pad line numbers with 0's\n     --delim-cr                 set CR as end-of-line delimiter (MacOS 9)\n     --keep-injections          output plug-in injections in spite of -f\n     --kw-case=\u003ccase\u003e           change case of case insensitive keywords\n                                  \u003ccase\u003e =  [upper, lower, capitalize]\n     --no-trailing-nl           omit trailing newline\n     --no-version-info          omit version info comment\n\n\n(X)HTML output options:\n\n -a, --anchors                  attach anchor to line numbers\n -y, --anchor-prefix=\u003cstr\u003e      set anchor name prefix\n -N, --anchor-filename          use input file name as anchor prefix\n -C, --print-index              print index with hyperlinks to output files\n -n, --ordered-list             print lines as ordered list items\n     --class-name=\u003cname\u003e        set CSS class name prefix;\n                                  omit class name if set to NONE\n     --inline-css               output CSS within each tag (verbose output)\n     --enclose-pre              enclose fragmented output with pre tag \n                                  (assumes -f)\n\n\nLaTeX output options:\n\n -b, --babel                    disable Babel package shorthands\n -r, --replace-quotes           replace double quotes by \\dq{}\n     --beamer                   adapt output for the Beamer package\n     --pretty-symbols           improve appearance of brackets and other symbols\n\n\nRTF output options:\n\n     --page-color               include page color attributes\n -x, --page-size=\u003cps\u003e           set page size \n                                  \u003cps\u003e = [a3, a4, a5, b4, b5, b6, letter]\n     --char-styles              include character stylesheets\n\n\nSVG output options:\n\n     --height                   set image height (units allowed)\n     --width                    set image width (see --height)\n\n\nGNU source-highlight compatibility options:\n\n     --doc                      create stand alone document\n     --no-doc                   cancel the --doc option\n     --css=filename             the external style sheet filename\n     --src-lang=STRING          source language\n -t, --tab=INT                  specify tab length\n -n, --line-number[=0]          number all output lines, optional padding\n     --line-number-ref[=p]      number all output lines and generate an anchor,\n                                  made of the specified prefix p + the line\n                                  number  (default='line')\n     --output-dir=path          output directory\n     --failsafe                 if no language definition is found for the\n                                  input, it is simply copied to the output\n                                  \n2.3 GUI OPTIONS\n-------------------------------------------------------------------------------\n\nThe Graphical User Interface offers a subset of the CLI's features. It includes\na dynamic preview of the output file's apperarance. Please see screenshots and\nscreencasts on the project website.\nInvoke highlight-gui with the --portable option to let it save its settings\nin the binary's current directory (instead of using the registry).\n\n\n2.4 INPUT AND OUTPUT\n-------------------------------------------------------------------------------\n\nIf no input or output file name is defined by --input and --output options,\nhighlight will use stdin and stdout for file processing.\n\nIf no input filename is defined by --input or given at the prompt, highlight is\nnot able to determine the language type by means of the file extension (except\nsome scripting languages which are figured out by the shebang in the first input\nline). In this case you have to pass highlight the given langage with --syntax\n(this should be the file suffix of the source file in most cases).\nExample: If you want to convert a Python file, highlight needs to load the\npy.lang language definition. The correct argument of --syntax would be \"py\".\n\nhighlight test.py\nhighlight \u003c test.py --syntax py       # --syntax option necessary\ncat test.py | highlight --syntax py\n\nIf there exist multiple suffixes (like C, cc, cpp, h for C++ - files),\nthey are mapped to a language definition in $CONF_DIR/filetypes.conf.\n\nHighlight enters the batch processing mode if multiple input files are defined\nor if --batch-recursive is set.\nIn batch mode, highlight will save the generated files using the original\nfilename, appending the extension of the chosen output type.\nIf files in the input directories happen to share the same name, the output\nfiles will be prefixed with their source path name.\nThe --out-dir option is recommended in batch mode. Use --quiet to improve\nperformance (recommended for usage in shell scripts).\n\nHTML, TeX, LaTeX and SVG output\n-------------------------------\n\nThe HTML, TeX, LaTeX and SVG output formats allow to reference a stylesheet\nfile which contains the formatting information.\n\nIn HTML and SVG output, this file contains CSS definitions and is saved as\n'highlight.css'. In LaTeX and TeX, it contains macro definitions, and is saved\nas 'highlight.sty'.\n\nName and path of the stylesheet may be modified with --style-outfile.\nIf the --outdir option is given, all generated output, including stylesheets,\nare stored in this directory.\n\nUse --include-style to embed the style information in the output documents\nwithout referencing a stylesheet.\n\nReferenced stylesheets have the advantage to share all formatting information\nin a single file, which affects all referencing documents.\n\nWith --style-infile you define a file to be included in the final formatting\ninformation of the document. This way you enhance or redefine the default\nhighlight style definitions without editing generated code.\nNote: Using a plug-in script is the preferred way to enhance styling.\n\nTerminal output:\n----------------\n\nSince there are limited colours defined for ANSI terminal output, there exists\nonly one hard coded colour theme with --out-format=ansi. You should therefore\nuse --out-format=xterm256 to enable output in 256 colours. The 256 colour mode\nis supported by recent releases of xterm, rxvt and Putty (among others).\nRecent terminal emulators also support 16m colors, this mode is enabled with\n--out-format=truecolors.\n\nhighlight --out-format=ansi \u003cinputfile\u003e | less -R\nhighlight --out-format=xterm256 \u003cinputfile\u003e | less -R\n\nText processing:\n----------------\n\nIf the language definition is specified as \"txt\", no highlighting takes place.\n\nhighlight -S txt --out-format=latex README \u003e README.tex\n\n\nExamples\n--------\n\nhighlight --out-format=xhtml  --batch-recursive '*.cpp' --outdir ~/html_code/\nThis command converts all *.cpp files in the current directory and its sub-\ndirectories to xhtml files, and stores the output in /home/you/html_code.\n\nhighlight -out-format=latex  * --outdir /home/you/latex_code/\nThis command onverts all files to LaTeX, stored in /home/you/latex_code/.\n\nhighlight --stdout -s seashell --print-style\nThis command prints only the CSS information to stdout (theme: Seashell).\n\n\n2.5 GNU SOURCE-HIGHLIGHT COMPATIBILITY\n-------------------------------------------------------------------------------\n\nThe command line interface is extensively harmonised with source-highlight\n(http://www.gnu.org/software/src-highlite/).\n\nThe following highlight options have the same meaning as in source-highlight:\n --input, --output, --help, --version, --out-format, --title, --data-dir,\n --verbose, --quiet\n\nThese options were added to enhance compatibility:\n --css, --doc, --failsafe, --line-number, --line-number-ref, --no-doc, --tab,\n --output-dir, --src-lang\n\nThese switches provide a common highlighter interface for scripts, plugins etc.\n\n\n2.6 ADVANCED OPTIONS\n-------------------------------------------------------------------------------\n\nPrevent parsing of binary input files\n-------------------------------------\n\nIf highlight could be invoked with all kinds of input, you can disable parsing\nof binary files using --validate-input. This flag causes highlight to match the\ninput file header with a list of magic numbers. If a binary file type is\ndetected, highlight quits with an error message. This switch also removes an\nUTF-8 BOM in the output.\n\nHighlight nested code without starting delimiter\n------------------------------------------------\n\nIf a file starts with an embedded code section which misses an appropriate opening\ndelimiter, the --start-nested option will switch to the nested language mode.\nThis can be useful with LuaTeX files:\nhighlight luatex.tex --latex --start-nested=inc_luatex\n\ninc_luatex is a Lua language definition with TeX line comments.\nNote that the nested code section has to end with the ending delimiter defined\nin the host language definition.\n\nTest new configuration scripts\n------------------------------\n\nThe option --config-file helps to test new config files before installing them.\nThe given file must be a lang or theme file.\n\nhighlight --config-file xxx.lang --config-file yyy.theme -I\n\nDebug language definitions\n--------------------------\n\nUse --verbose to display the Lua and syntax data.\n\nRemove an UTF8 BOM:\n-------------------\n\nUse --validate-input to get rid of UTF8 byte order marks.\n\nForce output to stdout\n----------------------\n\nUse --stdout to write output files in batch mode to stdout.\n\nPortable GUI (Windows build)\n----------------------------\n\nInvoke highlight-gui.exe with the --portable switch to save its configuration\nin text files instead of the registry.\n\n\n2.7 ENVIRONMENT VARIABLES\n-------------------------------------------------------------------------------\n\nThe command line version recognizes these variables:\n\nHIGHLIGHT_DATADIR: sets the path to highlight's configuration scripts\nHIGHLIGHT_OPTIONS: may contain command line options, but no input file paths.\n\n\n3. CONFIGURATION\n-------------------------------------------------------------------------------\n\n3.1 FILE FORMAT\n-------------------------------------------------------------------------------\n\nConfiguration files are Lua scripts. \nPlease refer to http://www.lua.org/manual/5.1/manual.html for more details\nabout the Lua syntax.\n\nThese constructs are sufficient to edit the scripts:\n\nVariable assigment:\nname = value\n(variables have no type, only values have)\n\nStrings:\nstring1=\"string literal with escape: \\n\"\nstring2=[[raw string without escape sequence]]\n\nIf raw string content starts with \"[\" or ends with \"]\", pad the paranthesis\nwith space to avoid a syntax error. Highlight will strip the string.\nIf the string is a regular expression containing a set with a character class\nlike [[:space:]], use string delimiters with a \"filler\": [=[ regex string ]=]\n\nComments:\n-- line comment\n--[[ block comment ]]\n\nArrays:\narray = { first=1, second=\"2\", 3, { 4,5 } }\nArrays may contain variables and can be nested.\n\n\n3.2 LANGUAGE DEFINITIONS\n-------------------------------------------------------------------------------\n\nA language definition describes all elements of a programming language which\nwill be highlighted by different colours and font types.\nSave the new file in langDefs/, using the following name convention:\n\u003cusual extension of sourcecode files\u003e.lang\n\nExamples: PHP -\u003e php.lang, Java -\u003e java.lang\nIf there exist multiple suffixes, list them in filetypes.conf.\n\n\nSyntax elements:\n\nKeywords = { Id, List|Regex, Group? }\n\n  Id:    Integer, keyword group id (values 1-4, can be reused for several keyword\n          groups)\n  List:  List, list of keywords\n  Regex: String, regular expression\n  Group: Integer, capturing group id of regular expression, defines part of regex\n         which should be returned as keyword (optional; if not set, the match\n         with the highest group number is returned (counts from left to right))\n\n\nComments = { {Block, Nested?, Delimiter={Open, Close?} }\n\n  Block:     Boolean, true if comment is a block comment\n  Nested:    Boolean, true if block comments can be nested (optional)\n  Delimiter: List, contains open delimiter regex (line comment) or open and close\n             delimiter regexes (block comment)\n\n\nStrings = { Delimiter|DelimiterPairs={Open, Close, Raw?}, Escape?, Interpolation?,\n            RawPrefix?, AssertEqualLength? }\n\n  Delimiter:         String, regular expression which describes string delimiters\n  DelimiterPairs:    List, includes open and close delimiter expressions if not\n                     equal, includes optional Raw flag as boolean which marks\n                     delimiter pair to contain a raw string\n  Escape:            String, regex of escape sequences (optional)\n  Interpolation:     String, regex of interpolation sequences (optional)\n  RawPrefix:         String, defines raw string indicator (optional)\n  AssertEqualLength: Boolean, set true if delimiters must have the same length\n\n\nPreProcessor = { Prefix, Continuation? }\n\n  Prefix:        String, regular expression which describes open delimiter\n  Continuation:  String, contains line continuation character (optional).\n\n\nNestedSections = {Lang, Delimiter= {} }\n\n  Lang:      String, name of nested language\n  Delimiter: List, contains open and close delimiters of the code section\n  \n\nDescription:       String, Defines syntax description\n\nDigits:            String, Regular expression which defines digits (optional)\n\nIdentifiers:       String, Regular expression which defines identifiers\n                   (optional)\n\nOperators:         String, Regular expression which defines operators\n\nEnableIndentation: Boolean, set true if syntax may be reformatted and indented\n\nIgnoreCase:        Boolean, set true if keyword case should be ignored\n\n\nGlobal variables:\n\nThe following variables are available within a language definition:\n\nHL_LANG_DIR: path of language definition directory (use with Lua dofile function)\n\nIdentifiers: Default regex for identifiers\nDigits:      Default regex for numbers\n\nThe following integer variables represent the internal highlighting states:\n\nHL_STANDARD\nHL_STRING\nHL_NUMBER\nHL_LINE_COMMENT\nHL_BLOCK_COMMENT\nHL_ESC_SEQ\nHL_PREPROC\nHL_PREPROC_STRING\nHL_OPERATOR\nHL_INTERPOLATION\nHL_LINENUMBER\nHL_KEYWORD\nHL_STRING_END\nHL_LINE_COMMENT_END\nHL_BLOCK_COMMENT_END\nHL_ESC_SEQ_END\nHL_PREPROC_END\nHL_OPERATOR_END\nHL_INTERPOLATION_END\nHL_KEYWORD_END\nHL_EMBEDDED_CODE_BEGIN\nHL_EMBEDDED_CODE_END\nHL_IDENTIFIER_BEGIN\nHL_IDENTIFIER_END\nHL_UNKNOWN\nHL_REJECT\n\nThe function OnStateChange:\n\nThis function is a hook which is called if an internal state changes (e.g. from\nHL_STANDARD to HL_KEYWORD if a keyword is found). It can be used to alter\nthe new state or to manipulate syntax elements like keyword lists.\n\nOnStateChange(oldState, newState, token, kwGroupID)\n\n  Hook Event: Highlighting parser state change\n  Parameters: oldState:  old state\n              newState:  intended new state\n              token:     the current token which triggered the new state\n              kwGroupID: if newState is HL_KEYWORD, the parameter\n                         contains the keyword group ID\n  Returns:    Correct state to continue OR HL_REJECT\n\nReturn HL_REJECT if the recognized token and state should be discarded; the \nfirst character of token will be outputted and highlighted as \"oldState\".\n\nThe highlighting is not working as expected? See src/include/codegenerator.hpp\nfor details about the parser.\n\nExamples:\n\nfunction OnStateChange(oldState, newState, token)\n   if token==\"]]\" and oldState==HL_STRING and newState==HL_BLOCK_COMMENT_END then\n      return HL_STRING_END\n   end\n   return newState\nend\n\nThis function resolves a Lua parsing issue with the \"]]\" close delimiter which\nends both comments and strings.\n\n\nfunction OnStateChange(oldState, newState, token)\n   if token==\"'\" and oldState==HL_NUMBER and newState==HL_STRING then\n      return HL_NUMBER\n   end   \n   return newState\nend\n\nThis hook enables correct parsing of C++14 number separator syntax.\n\nSee README_PLUGINS for other available functions.\n\n\nExample:\n--------\n\nDescription=\"C and C++\"\n\nKeywords={\n  {  Id=1,\n   List={\"goto\", \"break\", \"return\", \"continue\", \"asm\", \"case\", \"default\",\n         -- [..]\n        }\n  },\n  -- [..]\n}\n\nStrings = {\n  Delimiter=[[\"|']],\n  RawPrefix=\"R\",\n}\n\nComments = {\n   { Block=true,\n     Nested=false,\n     Delimiter = { [[\\/\\*]], [[\\*\\/]] }  },\n   { Block=false,\n     Delimiter = { [[//]] } }\n}\n\nIgnoreCase=false\n\nPreProcessor = {\n  Prefix=[[#]],\n  Continuation=\"\\\\\",\n}\n\nOperators=[[\\(|\\)|\\[|\\]|\\{|\\}|\\,|\\;|\\.|\\:|\\\u0026|\\\u003c|\\\u003e|\\!|\\=|\\/|\\*|\\%|\\+|\\-|\\~]]\n\nEnableIndentation=true\n\n\n3.3 REGULAR EXPRESSIONS\n-------------------------------------------------------------------------------\n\nPlease see README_REGEX for the supported regex constructs.\n\n\n3.4 THEME DEFINITIONS\n-------------------------------------------------------------------------------\n\nColour themes contain the formatting information of the language elements which\nare described in language definitions.\n\nThe files have to be stored as *.theme in themes/.\nApply a theme with the --style option.\n\n\nFormat attributes:\n\nAttributes = {Colour, Bold?, Italic?, Underline? }\n\nColour:    String, defines colour in HTML hex notation (\"#rrggbb\")\nBold:      Boolean, true if font should be bold (optional)\nItalic:    Boolean, true if font should be italic (optional)\nUnderline: Boolean, true if font should be underlined (optional)\n\n\nTheme elements:\n\nDescription:   String, Defines theme description\n\nDefault        = Attributes (Colour of unspecified text)\n\nCanvas         = Attributes (Background colour )\n\nNumber         = Attributes (Formatting of numbers)\n\nEscape         = Attributes (Formatting of escape sequences)\n\nString         = Attributes (Formatting of strings)\n\nInterpolation  = Attributes (Formatting of interpolation sequences)\n\nPreProcessor   = Attributes (Formatting of preprocessor directives)\n\nStringPreProc  = Attributes (Formatting of strings within\n                            preprocessor directives)\n\nBlockComment   = Attributes (Formatting of block comments)\n\nLineComment    = Attributes (Formatting of line comments)\n\nLineNum        = Attributes (Formatting of line numbers)\n\nOperator       = Attributes (Formatting of operators)\n\nKeywords= {\n  Attributes1,\n  Attributes2,\n  Attributes3,\n  Attributes4,\n}\n\nAttributesN: Formatting of keyword group N. There should be at least four items\n             to match the number of keyword groups defined in the language\n             definitions\n\nExample:\n\nDefault        = { Colour=\"#000000\" }\nCanvas         = { Colour=\"#ffffff\" }\nNumber         = { Colour=\"#000000\" }\nEscape         = { Colour=\"#bd8d8b\" }\nString         = { Colour=\"#bd8d8b\" }\nStringPreProc  = { Colour=\"#bd8d8b\" }\nBlockComment   = { Colour=\"#ac2020\", Italic=true }\nPreProcessor   = { Colour=\"#000000\" }\nLineNum        = { Colour=\"#555555\" }\nOperator       = { Colour=\"#000000\" }\nLineComment = BlockComment\n\nKeywords = {\n  { Colour= \"#9c20ee\", Bold=true },\n  { Colour= \"#208920\" },\n  { Colour= \"#0000ff\" },\n  { Colour= \"#000000\" },\n}\n\n\n3.5 KEYWORD GROUPS\n-------------------------------------------------------------------------------\n\nYou may define custom keyword groups and corresponding highlighting styles.\nThis is useful if you want to highlight functions of a third party library,\nmacros, constants etc.\n\nYou define a new group in two steps:\n\n 1. Define a new group in your language definition:\n\n    Keywords = {\n      -- add your keyword description:\n      {Id=5, List = {\"ERROR\", \"DEBUG\", \"WARN\"} }\n    }\n\n 2. Add a corresponding highlighting style in your colour theme:\n\n    Keywords= {\n      --add your keyword style as 5th item in the list:\n      { Colour= \"#ff0000\", Bold=true },\n    }\n\nIt is recommended to define keyword groups in user-defined plugin scripts to\navoid editing of original highlight files.\nSee the cpp_qt.lua sample plug-in script and README_PLUGINS for details.\n\n\n3.6 PLUG-INS\n-------------------------------------------------------------------------------\n\nThe --plug-in option receives the path of a Lua script which overrides or\nenhances the settings of theme and language definition files. Plug-ins make\nit possible to apply costum settings without the need to edit installed\nconfiguration files.\nYou can apply multiple plugins by using the --plug-in option more than once.\n\nSee README_PLUGINS for a detailed description and examples of packaged plugins.\n\n\n3.7 FILE MAPPING\n-------------------------------------------------------------------------------\n\nThe script filetypes.conf assigns file extensions and shebang descriptions to\nlanguage definitions.\nA configuration is mandatory only if multiple file extensions are linked to\none syntax or if a extension is ambiguous. Otherwise the syntax definition whose\nname corresponds to the input file extension will be applied.\n\nFormat:\n\nFileMapping={\n  {  Lang, Filenames|Extensions|Shebang },\n}\n\nLang:       String, name of language definition\nFilenames:  list of strings, contains filenames referring to \"Lang\"\nExtensions: list of strings, contains file extensions referring to \"Lang\"\nShebang:    String, Regular expression which matches the first line of the input\n            file\n\nBehaviour upon ambiguous file extensions:\n- CLI: the first association listed here will be used\n- GUI: a syntax selection prompt will be shown\n\nEdit the file gui_files/ext/fileopenfilter.conf to add new syntax types to\nthe GUI's file open filter.\n\n\n3.8 CONFIG FILE SEARCH\n-------------------------------------------------------------------------------\n\nConfiguration scripts are searched in the following directories:\n\n1. ~/.highlight/\n2. value of the environment variable HIGHLIGHT_DATADIR\n3. user defined directory set with --data-dir (deprecated option)\n4. /usr/share/highlight/\n5. /etc/highlight/ (location of filetypes.conf)\n6. current working directory (fallback)\n\nThese subdirectories are expected to contain the corresponding scripts:\n-langDefs: *.lang\n-themes: *.theme\n-plugins: *.lua\n\nA custom filetypes.conf may be placed directly in ~/.highlight/.\nThis search order enables you to enhance the installed scripts without the need\nto copy preinstalled files somewhere else.\n\n\n4. EMBEDDING HIGHLIGHT\n-------------------------------------------------------------------------------\n\n4.1 SAMPLE SCRIPTS\n-------------------------------------------------------------------------------\n\nSee the extras/ subdirectory in the highlight package for some scripts in PHP,\nPerl and Python  which invoke highlight and retrieve its output as string.\nThese scripts may be used as reference to develop plug-ins for other apps.\n\n4.2 PANDOC\n-------------------------------------------------------------------------------\n\nPP macros file and tutorial are located in extras/pandoc.\nSee README.html for usage instruction and example files as reference.\n\n4.3 SWIG\n-------------------------------------------------------------------------------\n\nA SWIG interface file is located in extras/swig.\nSee README_SWIG for installation instructions and the example scripts in Perl,\nPHP and Python as programming reference.\n\n4.4 TCL\n-------------------------------------------------------------------------------\n\nA TCL extension is located in extras/tcl.\nSee README_TCL for installation instructions.\n\n\n4.5 THIRD PARTY SCRIPTS AND PLUG-INS\n-------------------------------------------------------------------------------\n\nSee the extras/web_plugins subdirectory in the highlight package for\nsome plugins which integrate highlight in Wiki and Blogging software:\n\n-DokuWiki\n-MovableType\n-Wordpress\n-Serendipity\n\nOther uses of highlight can be found on andre-smon.de\nThis site shows several use cases of highlight in projects like Webgit, \nEvolution, Inkscape, Ranger and more.\n\n\n5. BUILDING AND INSTALLING\n-------------------------------------------------------------------------------\n\n5.1 PRECOMPILED PACKAGES\n-------------------------------------------------------------------------------\n\nThe file INSTALL describes the installation from source and includes links to \nprecompiled packages.\n\n\n5.2 BUILDING DEPENDENCIES\n-------------------------------------------------------------------------------\n\nHighlight is known to compile with gcc and clang.\nIt depends on Boost headers and Lua 5.x/LuaJit developer packages.\nThe optional GUI depends on Qt5 developer packages.\nPlease see the makefile for further options.\n\n\n6. DEVELOPER CONTACT\n-------------------------------------------------------------------------------\n\nAndre Simon\nandre.simon1@gmx.de\nhttp://www.andre-simon.de/\n\nGithub project with Git repository, bug tracker:\nhttps://github.com/andre-simon/highlight\n\nsf.net project with SVN repository, download mirror, bug tracker, help forum:\nhttp://sourceforge.net/projects/syntaxhighlight/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandre-simon%2Fhighlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandre-simon%2Fhighlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandre-simon%2Fhighlight/lists"}