From e57c0ff285e8ae1b81190bf6e4b37933926a49ff Mon Sep 17 00:00:00 2001 From: Dan Allen <dan@opendevise.com> Date: Wed, 8 Mar 2023 04:35:19 -0700 Subject: [PATCH] add tip to docs for how to find list of supported source languages for the various syntax highlighters --- docs/CHANGELOG.adoc | 3 +++ docs/modules/verbatim/pages/source-highlighter.adoc | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.adoc b/docs/CHANGELOG.adoc index 7ebd741..eaafa35 100644 --- a/docs/CHANGELOG.adoc +++ b/docs/CHANGELOG.adoc @@ -6,6 +6,9 @@ https://github.com/asciidoctor/asciidoc-docs/commits/main[commit history]. == Published Q1 2023 +Added:: +* Add tip for how to find list of supported source languages for the various syntax highlighters + Changed:: * Clarify that superscript and subscript formatting is neither constrained nor unconstrained, but rather a specialty hybrid * Clarify that first menu item must start with word character or character reference diff --git a/docs/modules/verbatim/pages/source-highlighter.adoc b/docs/modules/verbatim/pages/source-highlighter.adoc index 041a8ec..bb550fe 100644 --- a/docs/modules/verbatim/pages/source-highlighter.adoc +++ b/docs/modules/verbatim/pages/source-highlighter.adoc @@ -73,8 +73,14 @@ In other words, the `source-highlighter` attribute means "`use this syntax highl To apply highlighting to a block of source code, you must specify a source language. If the block is a literal block or paragraph, you must also specify the `source` style. -The available source language values are defined by the syntax highlighter library. -In most cases, the source language value is the proper name of the language in lowercase (e.g., `ruby`, `java`). +The AsciiDoc language does not specify the list of valid source language values. +Instead, the available source language values are defined by the syntax highlighter library. + +TIP: You can find the list of available languages supported by Rouge in the https://github.com/rouge-ruby/rouge/blob/master/docs/Languages.md[Rouge documentation]. +You can print a list of available languages supported by Pygments by running `pygmentize -L formatters`. +The available languages supported by highlight.js depends on which bundle of highlight.js you are using. + +Typically, the source language value is the proper name of the language in lowercase (e.g., `ruby`, `java`). Most syntax highlighters also accept using the source file extension (e.g., `js`, `rb`), though it's important to be consistent. If the syntax highlighter doesn't recognize or support the source language, the block will not be highlighted. -- GitLab