class Markd::Options

Overview

Markdown rendering options.

Defined in:

markd/options.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(time : Bool = false, gfm : Bool = false, toc : Bool = false, smart : Bool = false, source_pos : Bool = false, safe : Bool = false, prettyprint : Bool = false, emoji : Bool = false, tagfilter : Bool = false, autolink : Bool = false, base_url : Nil | URI = nil) #

[View source]

Instance Method Detail

def autolink=(autolink : Bool) #

If true, more autolinks will be detected. Setting to false does not disable autolink support as a whole.


[View source]
def autolink? : Bool #

If true, more autolinks will be detected. Setting to false does not disable autolink support as a whole.


[View source]
def base_url : URI | Nil #

If #base_url is not nil, it is used to resolve URLs of relative links. It act's like HTML's <base href="base_url"> in the context of a Markdown document.


[View source]
def base_url=(base_url : URI | Nil) #

If #base_url is not nil, it is used to resolve URLs of relative links. It act's like HTML's <base href="base_url"> in the context of a Markdown document.


[View source]
def emoji=(emoji : Bool) #

Enables GFM emoji support.

For example:

@octocat :+1: This PR looks great - it's ready to merge! :ship:

Becomes:

@octocat 👍 This PR looks great - it's ready to merge! 🚢

https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#using-emojis


[View source]
def emoji? : Bool #

Enables GFM emoji support.

For example:

@octocat :+1: This PR looks great - it's ready to merge! :ship:

Becomes:

@octocat 👍 This PR looks great - it's ready to merge! 🚢

https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#using-emojis


[View source]
def gfm : Bool #

DEPRECATED Use #gfm? instead.


[View source]
def gfm=(gfm : Bool) #

Enables GitHub Flavored Markdown support.

https://github.github.com/gfm/


[View source]
def gfm? : Bool #

Enables GitHub Flavored Markdown support.

https://github.github.com/gfm/


[View source]
def prettyprint : Bool #

DEPRECATED Use #prettyprint? instead.


[View source]
def prettyprint=(prettyprint : Bool) #

If true, code tags generated by code blocks will have a prettyprint class added to them, to be used by Google code-prettify.


[View source]
def prettyprint? : Bool #

If true, code tags generated by code blocks will have a prettyprint class added to them, to be used by Google code-prettify.


[View source]
def safe : Bool #

DEPRECATED Use #safe? instead.


[View source]
def safe=(safe : Bool) #

If true, raw HTML will not be passed through to HTML output (it will be replaced by comments).


[View source]
def safe? : Bool #

If true, raw HTML will not be passed through to HTML output (it will be replaced by comments).


[View source]
def smart : Bool #

DEPRECATED Use #smart? instead.


[View source]
def smart=(smart : Bool) #

If true:

  • straight quotes will be made curly
  • -- will be changed to an en dash
  • --- will be changed to an em dash
  • ... will be changed to ellipses

[View source]
def smart? : Bool #

If true:

  • straight quotes will be made curly
  • -- will be changed to an en dash
  • --- will be changed to an em dash
  • ... will be changed to ellipses

[View source]
def source_pos : Bool #

DEPRECATED Use #source_pos? instead.


[View source]
def source_pos=(source_pos : Bool) #

If true, source position information for block-level elements will be rendered in the data-sourcepos attribute (for HTML).


[View source]
def source_pos? : Bool #

If true, source position information for block-level elements will be rendered in the data-sourcepos attribute (for HTML).


[View source]
def tagfilter=(tagfilter : Bool) #

If true, the following HTML tags will be filtered when rendering HTML output:

  • <title>
  • <textarea>
  • <style>
  • <xmp>
  • <iframe>
  • <noembed>
  • <noframes>
  • <script>
  • <plaintext>

All other HTML tags are left untouched.


[View source]
def tagfilter? : Bool #

If true, the following HTML tags will be filtered when rendering HTML output:

  • <title>
  • <textarea>
  • <style>
  • <xmp>
  • <iframe>
  • <noembed>
  • <noframes>
  • <script>
  • <plaintext>

All other HTML tags are left untouched.


[View source]
def time : Bool #

DEPRECATED Use #time? instead.


[View source]
def time=(time : Bool) #

Render parsing cost time for reading the source, parsing blocks, and parsing inline.


[View source]
def time? : Bool #

Render parsing cost time for reading the source, parsing blocks, and parsing inline.


[View source]
def toc=(toc : Bool) #

Not supported for now.


[View source]
def toc? : Bool #

Not supported for now.


[View source]