A List of Google Prettify Language Codes - google-code-prettify

I cannot find this anywhere and I swear I used to be able to very simply without much prying. Can anyone help me? Thanks. I would appreciate it. Also, does prettify support Batch?

I thought it would be helpful to have an actual list rather than just a link. I found it in the loader directory that #MikeSamuel linked to from Javascript code prettifier. As the readme states, the prettify.js comments are the authoritative source. However, What is syntax highlighting and how does it work? provided a better formatted list, so I will copy that below. Refer to the the links for the most up-to-date information.
If you are using the Prettify codes to markup Stack Overflow code, you use
<!-- language: lang-or-tag-here -->
your code
Language Codes:
Let Prettify interpret the code and guess.
default
Explicitly do not use any syntax highlighting.
lang-none
Bash and other Shell scripting
lang-bash, lang-bsh, lang-csh, lang-sh
C, C++, et al
lang-c, lang-cc, lang-cpp, lang-cxx, lang-cyc, lang-m
C#
lang-cs
Clojure
lang-clj
CoffeeScript
lang-coffee
CSS
lang-css
Dart
lang-dart
Delphi
lang-pascal
Erlang
lang-erl, lang-erlang
Go
lang-go
Haskell
lang-hs
HTML
lang-html
Java
lang-java
JavaScript
lang-js, lang-javascript
JSON
lang-json
LaTeX and TeX
lang-latex, lang-tex
Lisp and Scheme
lang-cl, lang-el, lang-lisp, lang-lsp, lang-scm, lang-ss, lang-rkt
Lua
lang-lua
OCaml, SML, F#, et al
lang-fs, lang-ml
Pascal
lang-pascal
Perl
lang-pl, lang-perl
PHP
lang-php
Protocol buffers
lang-proto
Python
lang-py, lang-python, lang-cv
R and S
lang-r, lang-s
Regex
lang-regex
Ruby
lang-rb, lang-ruby
Rust
lang-rc, lang-rs, lang-rust
Scala
lang-scala
SQL
lang-sql
VHDL
lang-vhdl, lang-vhd
Visual Basic
lang-vb, lang-vbs
XML
lang-xml

You can find a table in the FAQ, under the header For which languages does it work?:
The comments in prettify.js are authoritative but the lexer should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, Makefiles, and Rust. It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl and Ruby, but, because of commenting conventions, but doesn't work on Smalltalk.
Other languages are supported via extensions: ...
You can find the handlers, with their extensions in the loader directory
For the mapping from extensions to builtin languages, see the registerLangHandler calls in prettify.js

Related

How to add a custom tmLanguage syntax to Sphinx/RST

Is there a method to import a tmLanguage.json into Sphinx to add support for a new/custom language for RST?
There is not directly; if necessary you'll have to write a lexer for a new language in Python. I say if necessary because Sphinx's syntax highlighting is provided under the hood by Pygments, which supports a huge number of languages; you just need to turn support on in Sphinx using the highlight_language config value. The short names for all the various lexers are shown here.
If, somehow, your language doesn't have a lexer already, there are instructions on how to write your own. It's largely (but not entirely) a process of translating the Oniguruma regexes in the .tmLanguage.json file to Python-flavored ones.
One would also hope that you'd contribute it to the pygments Github project, too.

notepad++ open textfile with selfdefined language via console

Like said above I want to open a text-file with a User-Defined highlighting via bash-script.
notepad++ -n$1 -lmyLanguage myfile.dat
if I use prebuild lanuages like xml or bash it works fine like
notepad++ -n12 -lxml myfile.dat
but with my self-deffined language-set its not working. Is it due to where the languages are stored? do i have to move some files?
EDIT:
As far as I found out, its not possible in the conventional way (see answer below). If someone finds a workaround (i.e. maybe altering witht the xml-files) I would be a happy man!
You can definie what syntax should be used for an extension of a file. That can be done by lut in UserLang tag atrribute ext. Try to Look at sample Lang for example sas.
Its not possible yet.
User-Manual sais:
-llanguage short name
Language to set for each file opened. $$$ is a short identifier string,
of which the following are allowed:
normal, php, c, cpp, cs, objc, d, java, rc, html, xml, makefile,
pascal, batch, ini, nfo, asp, sql, vb, javascript, css, perl, python,
lua, tex, cobol, fortran, bash, actionscript, nsis, tcl, lisp, scheme,
asm, diff, props, postscript, ruby, smalltalk, vhdl, kix, autoit,
Gui4Cli, powershell, caml, ada, verilog, matlab, haskell, inno, cmake, yaml,r, jsp

How does Ruby Implement General Delimited Inputs?

After much searching, I can't figure how Ruby implements General Delimited Inputs.
All I can find is Kernel#`, which is used by %x{...}.
Any help would greatly appreciated. Thanks
This is handled in the parsing code, which is written in YACC and C. Check out the source code on GitHub. Specifically, the token that handles this type of quoting begins with tQWORDS_BEG (search within parse.y).
A detailed discussion of the YACC implementation would be long, but if you want to get started, that's where it lives in the code.
Note that the above link is for MRI Ruby. I don't know how other Ruby interpreters handle it, but they all do it in a parser somewhere, and most of those are written in C and likely use YACC to parse. Notable exceptions are JRuby, written in Java, and druby, in OCaml.

ruby markdown processor that does footnotes?

Do any of the maintained decent ruby markdown processors do an extension for footnotes? I know some markdown processors in other languages do (although I'm not sure which ones).
The ruby ones aren't so great at documenting what markdown extensions they might support. (Heck, neither are the ones in other languages).
anyone know?
I have used kramdown, and it's my library of choice for markdown. It actually provides a superset of Markdown syntax, borrowing additional functionality from other libraries. For example, the footnote capability was borrowed from PHP Markdown Extra package.
Example syntax:
That's some text with a footnote.[^1]
[^1]: And that's the footnote.

What grammar based parser-generator tools exist for ruby?

What open source (preferably gem-based) parser-generator options do I have in Ruby?
I've used (flex&bison)|(lex&yacc) from C in the past, and I'm comfortable with BNF-style specifications.
I've heard of treetop, but it looks a bit alien and verbose compared to yacc...
Purpose: I want to convert my text markup language to a BNF and generate the parsing code.
Have you looked at rex and racc, the gem versions of lex and yacc?
There's also parslet if you want a PEG-based processor
Citrus is an option - similar but not identical to Treetop in its grammar.

Resources