Syntax Processors

Syntax Anywhere provides dashboard pages at: The dashboard pages have moved to Dashboard > Stacks & Blocks > Syntax Anywhere.

  1. Plugin List. A list of plugins with documentation similar to that below.
  2. Global Settings. A version of the block edit dialog for setting global settings and defaults

[ Syntax Anywhere ]

Syntax Processor Plugins

Syntax Anywhere blocks provide syntax highlighting using plugin classes.

Functionality can be extended by adding plugin classes for additional Syntax Processors. Syntax Processor plugins are simple classes that provide the functionality to adapt Syntax Anywhere to alternative highlighting code. They should inherit from SyntaxPluginBase. Details are provided by comments in the code.

Plugins can be added by placing the plugin classes at packages/anyPackageName/src/JtF/SyntaxAnywhere/SyntaxProcessors/PluginName or application/src/JtF/SyntaxAnywhere/SyntaxProcessors/PluginName. Plugins can also be similarly placed beneath the plugin type's namespace declared in a package controller's AutoloaderRegistries.

[ Syntax Anywhere ]

Ace

Ace syntax editor, in read only mode.

The Ace syntax editor is loaded from the concrete5 core and used to display code in read only mode. This can be usefull for languages with unusual structure such as assembler and SQL. The Languages need to be set manually.

Ace is pretty good at picking out and processing html <tags>, so you are unlikely to need to set the option to escape html tags before processing.

Ace automatically acquires the background colour of its container, so unless you want to override the theme background, its best not to set a background colour.

Ace requires the language to be set. You can set a default language in the edit dialog and where necessary override that with an attribute languages="html" on the wrapper for the code fragment. Languages available are: abap, actionscript, ada, apache_conf, asciidoc, assembly_x86, autohotkey, batchfile, c_cpp, c9search, cirru, clojure, cobol, coffee, coldfusion, csharp, css, curly, d, dart, diff, django, dot, ejs, erlang, forth, ftl, gherkin, glsl, golang, groovy, haml, handlebars, haskell, haxe, html, html_completions, html_ruby, ini, jack, jade, java, javascript, json, jsoniq, jsp, jsx, julia, latex, less, liquid, lisp, livescript, logiql, lsl, lua, luapage, lucene, makefile, markdown, matlab, mel, mushcode, mushcode_high_rules, mysql, nix, objectivec, ocaml, pascal, perl, pgsql, php, plain_text, powershell, prolog, properties, protobuf, python, r, rdoc, rhtml, ruby, rust, sass, scad, scala, scheme, scss, sh, sjs, smarty, snippets, soy_template, space, sql, stylus, svg, tcl, tex, text, textile, tmsnippet, toml, twig, typescript, vbscript, velocity, verilog, vhdl, xml, xquery, yaml.

Themes available are: Ambiance, Chaos, Chrome, Clouds, Clouds Midnight, Cobalt, Crimson Editor, Dawn, Dreamweaver, Eclipse, Github, Idle Fingers, Katzenmilch, Kr, Kuroir, Merbivore, Merbivore Soft, Mono Industrial, Monokai, Pastel On Dark, Solarized Dark, Solarized Light, Terminal, Textmate, Tomorrow, Tomorrow Night, Tomorrow Night Blue, Tomorrow Night Bright, Tomorrow Night Eighties, Twilight, Vibrant Ink, Xcode

The license for ace.js is BSD.

[ Syntax Anywhere ]

Diagnostic

Diagnostic. Not a syntax processor!

Rather than processing the data passed to the syntax processor, escapes it and outputs the escaped data as a diagnostic. Can be useful when developing further syntax processors.

[ Syntax Anywhere ]

Highlight

JavaScript based prettifier highlight.js, as used on concrete5.org.

Highlight.js JavaScript and themes are loaded from CDNJS Cloudflare. Most languages are automatically detected.

More information is available at https://highlightjs.org/usage/.

Languages currently provided by highlight.js are: Apache, Bash, C#, C++, CSS, CoffeeScript, Diff, HTML, XML, HTTP, Ini, JSON, Java, JavaScript, Makefile, Markdown, Nginx, Objective-C, PHP, Perl, Python, Ruby, SQL, Shell Session.

Further languages can be pulled in by adding a language="language_name" hint in the syntax anywhere marker. Further languages available are: 1c, abnf, accesslog, actionscript, ada, angelscript, applescript, arcade, arduino, armasm, asciidoc, aspectj, autohotkey, autoit, avrasm, awk, axapta, basic, bnf, brainfuck, c-like, c, cal, capnproto, ceylon, clean, clojure-repl, clojure, cmake, coq, cos, crmsh, crystal, csharp, csp, d, dart, delphi, django, dns, dockerfile, dos, dsconfig, dts, dust, ebnf, elixir, elm, erb, erlang-repl, erlang, excel, fix, flix, fortran, fsharp, gams, gauss, gcode, gherkin, glsl, gml, go, golo, gradle, groovy, haml, handlebars, haskell, haxe, hsp, htmlbars, hy, inform7, irpf90, isbl, jboss-cli, julia-repl, julia, kotlin, lasso, latex, ldif, leaf, less, lisp, livecodeserver, livescript, llvm, lsl, lua, mathematica, matlab, maxima, mel, mercury, mipsasm, mizar, mojolicious, monkey, moonscript, n1ql, nim, nix, nsis, ocaml, openscad, oxygene, parser3, pf, pgsql, php-template, plaintext, pony, powershell, processing, profile, prolog, properties, protobuf, puppet, purebasic, python-repl, q, qml, r, reasonml, rib, roboconf, routeros, rsl, ruleslanguage, rust, sas, scala, scheme, scilab, scss, smali, smalltalk, sml, sqf, stan, stata, step21, stylus, subunit, swift, taggerscript, tap, tcl, thrift, tp, twig, typescript, vala, vbnet, vbscript-html, vbscript, verilog, vhdl, vim, x86asm, xl, xquery, yaml, zephir

Highlight is pretty good at picking out and processing html <tags>, so you are unlikely to need to set the option to escape html tags before processing.

The option to dominate background will spread whatever background the highlight theme provides out to the overall wrapper Syntax Anywhere places about syntax formatted sections. The option to inherit background does the opposite, replacing the background provided by the theme with that provided by Syntax Anywhere.

Themes available are: Default, A11y Dark, A11y Light, Agate, An Old Hope, Androidstudio, Arduino Light, Arta, Ascetic, Atom One Dark, Atom One Dark Reasonable, Atom One Light, Brown Paper, Cave Dark, Cave Light, Codepen Embed, Color Brewer, Darcula, Dark, Docco, Dracula, Dune Dark, Dune Light, Estuary Dark, Estuary Light, Far, Forest Dark, Forest Light, Foundation, Github, Github Gist, Gml, Googlecode, Gradient Dark, Grayscale, Gruvbox Dark, Gruvbox Light, Heath Dark, Heath Light, Hopscotch, Hybrid, Idea, Ir Black, Isbl Editor Dark, Isbl Editor Light, Kimbie Dark, Kimbie Light, Lakeside Dark, Lakeside Light, Lightfair, Magula, Mono Blue, Monokai, Monokai Sublime, Night Owl, Nord, Obsidian, Ocean, Paraiso Dark, Paraiso Light, Plateau Dark, Plateau Light, Pojoaque, Purebasic, Qtcreator Dark, Qtcreator Light, Railscasts, Rainbow, Routeros, Savanna Dark, Savanna Light, School Book, Seaside Dark, Seaside Light, Shades Of Purple, Solarized Dark, Solarized Light, Srcery, Sulphurpool Dark, Sulphurpool Light, Sunburst, Tomorrow, Tomorrow Night, Tomorrow Night Blue, Tomorrow Night Bright, Tomorrow Night Eighties, Vs, Vs2015, Xcode, Xt256, Zenburn

The license for highlight.js is BSD.

[ Syntax Anywhere ]

None

Apply no highlighting or line numbering.

Wraps and escapes everything and implements colour settings, but no line numbers or anything else.

[ Syntax Anywhere ]

Prettify

JavaScript based prettifier from Google, as used by Google and Stackoverflow.

Prettify.js JavaScript and the default theme css are loaded from CDNJS. Other themes are bundled with this addon, sourced from both https://github.com/google/code-prettify and https://jmblog.github.io/color-themes-for-google-code-prettify/. Languages are automatically detected.

More information is available at https://github.com/google/code-prettify.

Prettify leaves html <tags> intact. When processed and written back to the page this could have undesirable side effects, especially when script tags are involved and the consequence could be a fatal JavaScript error. It is usually best to leave the escape html tags option set for this syntax processor.

Languages built in to prettify.js are: Bash, C, C#, C++, HTML, Java, JavaScript, Perl, Python, Ruby, Shell, XHTML, XML, XSL and other C-like syntaxes including PHP and CSS.

Further languages can be pulled in by adding a language="language_name" hint in the syntax anywhere marker. Further languages available are: apollo, clj, css, go, hs, lisp, lua, ml, n, proto, scala, sql, tex, vb, vhdl, wiki, xq, yaml

The option to dominate background will spread whatever background the prettify theme provides out to the overall wrapper Syntax Anywhere places about syntax formatted sections. The option to inherit background does the opposite, replacing the background provided by the theme with that provided by Syntax Anywhere.

Themes available are: Default, Cave Dark, Cave Light, Desert, Doxy, Dune Dark, Dune Light, Estuary Dark, Estuary Light, Forest Dark, Forest Light, Github, Github V2, Heath Dark, Heath Light, Hemisu Dark, Hemisu Light, Lakeside Dark, Lakeside Light, Plateau Dark, Plateau Light, Savanna Dark, Savanna Light, Seaside Dark, Seaside Light, Sons Of Obsidian, Sulphurpool Dark, Sulphurpool Light, Sunburst, Tomorrow, Tomorrow Night, Tomorrow Night Blue, Tomorrow Night Bright, Tomorrow Night Eighties, Tranquil Heart, Vibrant Ink

The license for Prettify.js is Apache 2.0. The licenses for themes are Apache 2.0 for themes provided with prettify.js and MIT for the additional themes.

[ Syntax Anywhere ]

Prettify Local

Prettify, with all assets provided by the web server, not from a CDN.

This version of prettify uses assets held on the web server, not from a CDN, so is suitable for sites that prefer to avoid CDN dependancies. Prettify.js JavaScript and the all themes css are bundled with this addon, sourced from both https://github.com/google/code-prettify and https://jmblog.github.io/color-themes-for-google-code-prettify/. Languages are automatically detected.

More information is available at https://github.com/google/code-prettify.

Prettify leaves html <tags> intact. When processed and written back to the page this could have undesirable side effects, especially when script tags are involved and the consequence could be a fatal JavaScript error. It is usually best to leave the escape html tags option set for this syntax processor.

The option to dominate background will spread whatever background the prettify theme provides out to the overall wrapper Syntax Anywhere places about syntax formatted sections. The option to inherit background does the opposite, replacing the background provided by the theme with that provided by Syntax Anywhere.

Themes available are: Default, Cave Dark, Cave Light, Desert, Doxy, Dune Dark, Dune Light, Estuary Dark, Estuary Light, Forest Dark, Forest Light, Github, Github V2, Heath Dark, Heath Light, Hemisu Dark, Hemisu Light, Lakeside Dark, Lakeside Light, Plateau Dark, Plateau Light, Savanna Dark, Savanna Light, Seaside Dark, Seaside Light, Sons Of Obsidian, Sulphurpool Dark, Sulphurpool Light, Sunburst, Tomorrow, Tomorrow Night, Tomorrow Night Blue, Tomorrow Night Bright, Tomorrow Night Eighties, Tranquil Heart, Vibrant Ink

The license for Prettify.js is Apache 2.0. The licenses for themes are Apache 2.0 for themes provided with prettify.js and MIT for the additional themes.

[ Syntax Anywhere ]

Prism

Lightweight prettifier prism.js, requires language to be specified.

rism.js JavaScript and themes are loaded from CDNJS.

More information is available at http://prismjs.com/.

Prism.js requires all languages to be explicityly specified. Each code block needs to hint the language used by adding a language="language_name" hint in the syntax anywhere marker. If not, it will be defaulted to php. Languages pre-loaded are C and similar, css, html, javascript, php. Further languages loaded on demand are:

Prism is pretty good at picking out and processing html <tags>, so you are unlikely to need to set the option to escape html tags before processing.

The option to dominate background will spread whatever background the prism theme provides out to the overall wrapper Syntax Anywhere places about syntax formatted sections. The option to inherit background does the opposite, replacing the background provided by the theme with that provided by Syntax Anywhere.

Themes available are: Default

The license for prism.js is MIT.

[ Syntax Anywhere ]

Simple Lines

Very simply provide zebra striping and line numbers.

A minimal formatter involving no external resources, so fast to render and universally available. Simply wrap lines into a list with or without line numbers and with a hint of zebra striping.