diff --git a/README.md b/README.md index 1ad27525..2e1d2def 100644 --- a/README.md +++ b/README.md @@ -100,26 +100,29 @@ For more information on these options, see [the comrak documentation](https://gi ### Plugins In addition to the possibilities provided by generic CommonMark rendering, Commonmarker also supports plugins as a means of -providing further niceties. For example: +providing further niceties. - code = <<~CODE - ```ruby - def hello - puts "hello" - end +#### Syntax Highlighter Plugin - CODE - - Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "Inspired GitHub" } }) - - #

-    # def hello
-    #  puts "hello"
-    # end
-    # 
-    # 
+```ruby +code = <<~CODE + ```ruby + def hello + puts "hello" + end +CODE + +puts Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "InspiredGitHub" } }) + +#

+# def hello
+# puts "hello"
+# end
+# 
+# 
+``` -You can disable plugins just the same as with options, by passing `nil`: +To disable this plugin, pass `nil`: ```ruby Commonmarker.to_html(code, plugins: { syntax_highlighter: nil }) @@ -127,6 +130,16 @@ Commonmarker.to_html(code, plugins: { syntax_highlighter: nil }) Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: nil } }) ``` +Available themes ([source](https://docs.rs/syntect/5.0.0/syntect/highlighting/struct.ThemeSet.html#implementations)): + +- base16-ocean.dark +- base16-eighties.dark +- base16-mocha.dark +- base16-ocean.light +- InspiredGitHub +- Solarized (dark) +- Solarized (light) + ## Output formats Commonmarker can currently only generate output in one format: HTML.