From 638f678cc2353e5a5c553d1bc600bbed5919a102 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sun, 28 May 2023 23:52:09 -0600 Subject: remove explicit source style in docs when not needed --- docs/modules/ROOT/pages/features.adoc | 2 +- docs/modules/ROOT/pages/index.adoc | 2 +- docs/modules/ROOT/pages/localization-support.adoc | 4 ++-- docs/modules/ROOT/pages/reference-safe-mode.adoc | 2 +- docs/modules/api/pages/convert-strings.adoc | 14 +++++++------- docs/modules/docbook-backend/pages/index.adoc | 4 ++-- docs/modules/extensions/pages/block-macro-processor.adoc | 6 +++--- docs/modules/extensions/pages/block-processor.adoc | 6 +++--- .../extensions/pages/compound-block-processor.adoc | 2 +- docs/modules/extensions/pages/docinfo-processor.adoc | 4 ++-- docs/modules/extensions/pages/include-processor.adoc | 6 +++--- .../modules/extensions/pages/inline-macro-processor.adoc | 6 +++--- docs/modules/extensions/pages/postprocessor.adoc | 4 ++-- docs/modules/extensions/pages/preprocessor.adoc | 4 ++-- docs/modules/extensions/pages/register.adoc | 2 +- docs/modules/extensions/pages/tree-processor.adoc | 6 +++--- docs/modules/html-backend/pages/custom-stylesheet.adoc | 14 +++++++------- docs/modules/html-backend/pages/default-stylesheet.adoc | 6 +++--- docs/modules/html-backend/pages/favicon.adoc | 10 +++++----- docs/modules/html-backend/pages/manage-images.adoc | 2 +- docs/modules/html-backend/pages/skip-front-matter.adoc | 2 +- docs/modules/html-backend/pages/stylesheet-modes.adoc | 6 +++--- docs/modules/install/pages/ruby-packaging.adoc | 2 +- docs/modules/migrate/pages/asciidoc-py.adoc | 6 +++--- docs/modules/migrate/pages/confluence-xhtml.adoc | 2 +- docs/modules/stem/pages/asciimath-gem.adoc | 4 ++-- docs/modules/stem/pages/mathematical.adoc | 2 +- docs/modules/stem/pages/mathjax.adoc | 2 +- docs/modules/syntax-highlighting/pages/coderay.adoc | 16 +++++++--------- docs/modules/syntax-highlighting/pages/highlightjs.adoc | 4 ++-- docs/modules/syntax-highlighting/pages/index.adoc | 13 ++++++++++++- docs/modules/syntax-highlighting/pages/pygments.adoc | 6 +++--- docs/modules/syntax-highlighting/pages/rouge.adoc | 6 +++--- 33 files changed, 93 insertions(+), 84 deletions(-) (limited to 'docs') diff --git a/docs/modules/ROOT/pages/features.adoc b/docs/modules/ROOT/pages/features.adoc index 9a5ac3f3..de9566e0 100644 --- a/docs/modules/ROOT/pages/features.adoc +++ b/docs/modules/ROOT/pages/features.adoc @@ -73,7 +73,7 @@ If you're writing technical documentation that presents snippets of source code Syntax highlighting is the practice of colorizing (or otherwise emphasizing) keywords and syntax elements in a structured programming or configuration language. Here's an example to give you an idea: -[source,ruby] +[,ruby] ---- phrase = "I love AsciiDoc" puts phrase diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index 814beb96..6a837696 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -36,7 +36,7 @@ a| $ asciidoctor document.adoc a| -[source,ruby] +[,ruby] ---- require 'asciidoctor' Asciidoctor.convert_file \ diff --git a/docs/modules/ROOT/pages/localization-support.adoc b/docs/modules/ROOT/pages/localization-support.adoc index 1a4fcaae..08b41ccb 100644 --- a/docs/modules/ROOT/pages/localization-support.adoc +++ b/docs/modules/ROOT/pages/localization-support.adoc @@ -137,7 +137,7 @@ Specify `listing-caption` to turn on captions for listing blocks. If you plan to support multiple languages, you'll want to define the attributes for each language inside a xref:asciidoc:directives:conditionals.adoc[conditional preprocessor directive]. For example: -[source,asciidoc] +[,asciidoc] ---- \ifeval::["{lang}" == "de"] :caution-caption: Achtung @@ -158,7 +158,7 @@ To use this file to translate the built-in labels according the value of the `la . Put the file in the folder [.path]_locale_ relative to your document. . Add the following line to the header of your AsciiDoc document: + -[source,asciidoc] +[,asciidoc] ---- \include::locale/attributes.adoc[] ---- diff --git a/docs/modules/ROOT/pages/reference-safe-mode.adoc b/docs/modules/ROOT/pages/reference-safe-mode.adoc index bc278ccd..bf645603 100644 --- a/docs/modules/ROOT/pages/reference-safe-mode.adoc +++ b/docs/modules/ROOT/pages/reference-safe-mode.adoc @@ -14,7 +14,7 @@ The xref:safe-modes.adoc[safe mode] can be referenced by one of the following do The attributes in the next example define replacement text for features that are disabled in high security environments: -[source,asciidoc] +[,asciidoc] ---- \ifdef::safe-mode-secure[] Link to chapters instead of including them. diff --git a/docs/modules/api/pages/convert-strings.adoc b/docs/modules/api/pages/convert-strings.adoc index c4ef8d3c..6213a649 100644 --- a/docs/modules/api/pages/convert-strings.adoc +++ b/docs/modules/api/pages/convert-strings.adoc @@ -8,7 +8,7 @@ A string is the bare AsciiDoc content (often the contents of a file). To parse an AsciiDoc string into a document object model, use: -[source,ruby] +[,ruby] ---- doc = Asciidoctor.load '*This* is Asciidoctor.' ---- @@ -34,14 +34,14 @@ However, if you're only interested in converting the AsciiDoc source when using To convert the AsciiDoc string directly to HTML, use: -[source,ruby] +[,ruby] ---- puts Asciidoctor.convert '*This* is Asciidoctor.' ---- Here's the output you will see: -[source,html] +[,html] ----

This is Asciidoctor.

@@ -86,7 +86,7 @@ That template is responsible for providing the styles and library integrations n You can still generate a standalone document when converting a string. To convert from an AsciiDoc string to a standalone output document, you need to explicitly set the `:standalone` option to `true`. -[source,ruby] +[,ruby] ---- puts Asciidoctor.convert '*This* is Asciidoctor.', standalone: true ---- @@ -98,7 +98,7 @@ If you don't set the `:standalone` option to `true`, you only get the embedded d When the input or output is a file, the `:standalone` option is enabled by default. Thus, to instruct Asciidoctor to write standalone HTML to a file from an AsciiDoc string, the `:to_file` option is mandatory. -[source,ruby] +[,ruby] ---- Asciidoctor.convert '*This* is Asciidoctor.', to_file: 'out.html' ---- @@ -113,7 +113,7 @@ However, you can force it to be included without the header and footer by settin If you only want the inline markup to be returned, set the `:doctype` option to `'inline'`: -[source,ruby] +[,ruby] ---- puts Asciidoctor.convert '*This* is Asciidoctor.', doctype: 'inline' ---- @@ -125,7 +125,7 @@ In this mode, Asciidoctor will only process the first block (e.g., paragraph) in You can produce DocBook 5.0 by setting the `:backend` option to `'docbook'`. Since embedded DocBook isn't that useful, we also enable the standalone document (i.e., header and footer) by setting the `:standalone` option to `true`. -[source,ruby] +[,ruby] ---- puts Asciidoctor.convert '*This* is Asciidoctor.', standalone: true, backend: 'docbook' ---- diff --git a/docs/modules/docbook-backend/pages/index.adoc b/docs/modules/docbook-backend/pages/index.adoc index a1cf2d73..68b5b38c 100644 --- a/docs/modules/docbook-backend/pages/index.adoc +++ b/docs/modules/docbook-backend/pages/index.adoc @@ -37,7 +37,7 @@ include::html-backend:example$my-document.adoc[tags=title;body] Here's a snippet of the XML generated by the DocBook converter. .XML generated from AsciiDoc -[source,xml] +[,xml] ---- @@ -76,7 +76,7 @@ A summary of the differences are as follows: If you're using the Asciidoctor API, you can generate a DocBook document directly from your application. .Generate DocBook output from the API -[source,ruby] +[,ruby] ---- Asciidoctor.convert_file 'my-document.adoc', backend: 'docbook' ---- diff --git a/docs/modules/extensions/pages/block-macro-processor.adoc b/docs/modules/extensions/pages/block-macro-processor.adoc index cf38ea98..af3e6ea4 100644 --- a/docs/modules/extensions/pages/block-macro-processor.adoc +++ b/docs/modules/extensions/pages/block-macro-processor.adoc @@ -6,7 +6,7 @@ Create a block macro named `gist` for embedding a gist. == sample-with-gist-macro.adoc -[source,asciidoc] +[,asciidoc] ---- .My Gist gist::123456[] @@ -14,7 +14,7 @@ gist::123456[] == GistBlockMacro -[source,ruby] +[,ruby] ---- class GistBlockMacro < Asciidoctor::Extensions::BlockMacroProcessor use_dsl @@ -38,7 +38,7 @@ end == Usage -[source,ruby] +[,ruby] ---- Asciidoctor::Extensions.register do block_macro GistBlockMacro if document.basebackend? 'html' diff --git a/docs/modules/extensions/pages/block-processor.adoc b/docs/modules/extensions/pages/block-processor.adoc index f6eb179b..40ebca6f 100644 --- a/docs/modules/extensions/pages/block-processor.adoc +++ b/docs/modules/extensions/pages/block-processor.adoc @@ -6,7 +6,7 @@ Register a custom block style named `shout` that uppercases all the words and co == sample-with-shout-block.adoc -[source,asciidoc] +[,asciidoc] ---- [shout] The time is now. Get a move on. @@ -14,7 +14,7 @@ The time is now. Get a move on. == ShoutBlock -[source,ruby] +[,ruby] ---- class ShoutBlock < Asciidoctor::Extensions::BlockProcessor PeriodRx = /\.(?= |$)/ @@ -35,7 +35,7 @@ end == Usage -[source,ruby] +[,ruby] ---- Asciidoctor::Extensions.register do block ShoutBlock diff --git a/docs/modules/extensions/pages/compound-block-processor.adoc b/docs/modules/extensions/pages/compound-block-processor.adoc index cd88a3b6..f225f1e9 100644 --- a/docs/modules/extensions/pages/compound-block-processor.adoc +++ b/docs/modules/extensions/pages/compound-block-processor.adoc @@ -21,7 +21,7 @@ Register a custom block named `collapsible` that transforms a listing block into .... .collapsible-block.rb -[source,ruby] +[,ruby] ---- class CollapsibleBlock < Asciidoctor::Extensions::BlockProcessor enable_dsl diff --git a/docs/modules/extensions/pages/docinfo-processor.adoc b/docs/modules/extensions/pages/docinfo-processor.adoc index 636b24a0..95372289 100644 --- a/docs/modules/extensions/pages/docinfo-processor.adoc +++ b/docs/modules/extensions/pages/docinfo-processor.adoc @@ -6,7 +6,7 @@ Appends the Google Analytics tracking code to the bottom of an HTML document. == GoogleAnalyticsDocinfoProcessor -[source,ruby] +[,ruby] ---- class GoogleAnalyticsDocinfoProcessor < Asciidoctor::Extensions::DocinfoProcessor use_dsl @@ -27,7 +27,7 @@ end == Usage -[source,ruby] +[,ruby] ---- Asciidoctor::Extensions.register do docinfo_processor GoogleAnalyticsDocinfoProcessor diff --git a/docs/modules/extensions/pages/include-processor.adoc b/docs/modules/extensions/pages/include-processor.adoc index cf627562..4c7ed13d 100644 --- a/docs/modules/extensions/pages/include-processor.adoc +++ b/docs/modules/extensions/pages/include-processor.adoc @@ -13,7 +13,7 @@ TIP: Asciidoctor supports including content from a URI out of the box if you set :source-highlighter: coderay .Gemfile -[source,ruby] +[,ruby] ---- \include::https://cdn.jsdelivr.net/gh/asciidoctor/asciidoctor/Gemfile[] ---- @@ -21,7 +21,7 @@ TIP: Asciidoctor supports including content from a URI out of the box if you set == UriIncludeProcessor -[source,ruby] +[,ruby] ---- class UriIncludeProcessor < Asciidoctor::Extensions::IncludeProcessor def handles? target @@ -38,7 +38,7 @@ end == Usage -[source,ruby] +[,ruby] ---- Asciidoctor::Extensions.register do include_processor UriIncludeProcessor diff --git a/docs/modules/extensions/pages/inline-macro-processor.adoc b/docs/modules/extensions/pages/inline-macro-processor.adoc index cb28f628..a2d0628a 100644 --- a/docs/modules/extensions/pages/inline-macro-processor.adoc +++ b/docs/modules/extensions/pages/inline-macro-processor.adoc @@ -6,14 +6,14 @@ Create an inline macro named `man` that links to another man page. == sample-with-man-link.adoc -[source,asciidoc] +[,asciidoc] ---- See man:gittutorial[7] to get started. ---- == ManpageInlineMacro -[source,ruby] +[,ruby] ---- class ManInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor use_dsl @@ -41,7 +41,7 @@ end == Usage -[source,ruby] +[,ruby] ---- Asciidoctor::Extensions.register do inline_macro ManInlineMacro diff --git a/docs/modules/extensions/pages/postprocessor.adoc b/docs/modules/extensions/pages/postprocessor.adoc index 130ca547..cba64734 100644 --- a/docs/modules/extensions/pages/postprocessor.adoc +++ b/docs/modules/extensions/pages/postprocessor.adoc @@ -6,7 +6,7 @@ Insert copyright text in the footer. == CopyrightFooterPostprocessor -[source,ruby] +[,ruby] ---- class CopyrightFooterPostprocessor < Asciidoctor::Extensions::Postprocessor def process document, output @@ -25,7 +25,7 @@ end == Usage -[source,ruby] +[,ruby] ---- Asciidoctor::Extensions.register do postprocessor CopyrightFooterPostprocessor diff --git a/docs/modules/extensions/pages/preprocessor.adoc b/docs/modules/extensions/pages/preprocessor.adoc index 83c48026..0465773e 100644 --- a/docs/modules/extensions/pages/preprocessor.adoc +++ b/docs/modules/extensions/pages/preprocessor.adoc @@ -50,7 +50,7 @@ content === FrontMatterPreprocessor -[source,ruby] +[,ruby] ---- class FrontMatterPreprocessor < Asciidoctor::Extensions::Preprocessor def process document, reader @@ -80,7 +80,7 @@ end === Usage -[source,ruby] +[,ruby] ---- Asciidoctor::Extensions.register do preprocessor FrontMatterPreprocessor diff --git a/docs/modules/extensions/pages/register.adoc b/docs/modules/extensions/pages/register.adoc index 468398ef..d2ca56ef 100644 --- a/docs/modules/extensions/pages/register.adoc +++ b/docs/modules/extensions/pages/register.adoc @@ -4,7 +4,7 @@ These extensions are registered per document using a callback that feels like a DSL: -[source,ruby] +[,ruby] ---- Asciidoctor::Extensions.register do |document| preprocessor FrontMatterPreprocessor diff --git a/docs/modules/extensions/pages/tree-processor.adoc b/docs/modules/extensions/pages/tree-processor.adoc index 39fedff9..23add3bf 100644 --- a/docs/modules/extensions/pages/tree-processor.adoc +++ b/docs/modules/extensions/pages/tree-processor.adoc @@ -17,7 +17,7 @@ Detect literal blocks that contain shell commands, strip the prompt character an === sample-with-shell-session.adoc -[source,asciidoc] +[,asciidoc] ---- $ echo "Hello, World!" > Hello, World! @@ -27,7 +27,7 @@ Detect literal blocks that contain shell commands, strip the prompt character an === ShellSessionTreeProcessor -[source,ruby] +[,ruby] ---- class ShellSessionTreeProcessor < Asciidoctor::Extensions::TreeProcessor LF = ?\n @@ -60,7 +60,7 @@ end === Usage -[source,ruby] +[,ruby] ---- Asciidoctor::Extensions.register do tree_processor ShellSessionTreeProcessor diff --git a/docs/modules/html-backend/pages/custom-stylesheet.adoc b/docs/modules/html-backend/pages/custom-stylesheet.adoc index d808d9f9..35be2559 100644 --- a/docs/modules/html-backend/pages/custom-stylesheet.adoc +++ b/docs/modules/html-backend/pages/custom-stylesheet.adoc @@ -18,7 +18,7 @@ To keep it simple, we'll just define a basic stylesheet that changes all text to Create the file [.path]_my-stylesheet.css_ the directory with your AsciiDoc source files and populate it with the following contents: .my-stylesheet.css -[source,css] +[,css] ---- body { color: #ff0000; @@ -31,7 +31,7 @@ The `stylesheet` document attribute must be set by the end of the header to be e One way to do that is to set the attribute in the document header: .stylesheet attribute set in document header -[source,asciidoc] +[,asciidoc] ---- include::example$my-document.adoc[tag=title] :stylesheet: my-stylesheet.css @@ -75,7 +75,7 @@ The `stylesdir` document attribute must be set by the end of the header to be ef One way to do that is to set the attribute in the document header: .stylesdir attribute set in document header -[source,asciidoc] +[,asciidoc] ---- include::example$my-document.adoc[tag=title] :stylesheet: my-stylesheet.css @@ -113,7 +113,7 @@ If you invoke Asciidoctor as follows: Then when you inspect the HTML, you will see: -[source,html] +[,html] ---- ---- @@ -130,7 +130,7 @@ We'll specify the location of `stylesdir` as an absolute path and generate the o Asciidoctor generates the HTML file into the [.path]_public_ folder, but it does not copy the stylesheet. Furthermore, it uses an absolute path in the link to the stylesheet: -[source,html] +[,html] ---- ---- @@ -189,14 +189,14 @@ Let's say you have three AsciiDoc documents saved in the following directory str For [.path]_a.adoc_ and [.path]_b.adoc_, set `stylesdir` to: -[source,asciidoc] +[,asciidoc] ---- :stylesdir: my-styles ---- For [.path]_c.adoc_, set `stylesdir` to: -[source,asciidoc] +[,asciidoc] ---- :stylesdir: ../my-styles ---- diff --git a/docs/modules/html-backend/pages/default-stylesheet.adoc b/docs/modules/html-backend/pages/default-stylesheet.adoc index 48a6d2e4..6c2cdca8 100644 --- a/docs/modules/html-backend/pages/default-stylesheet.adoc +++ b/docs/modules/html-backend/pages/default-stylesheet.adoc @@ -83,7 +83,7 @@ Otherwise, the browser will not be able to find the stylesheet. To solve this problem, set the safe mode to server or lower (e.g., server, safe, or unsafe) and Asciidoctor will embed the default stylesheet, like when using the `asciidoctor` command. -[source,ruby] +[,ruby] ---- require 'asciidoctor' @@ -133,7 +133,7 @@ Let's say you want to change the color of headings (and other heading-like title Start by creating a file named [.path]_docinfo.html_ (head is the default location) and populate it with a `