module Vitepressify::Utils
Overview
Contains helper methods.
Extended Modules
Defined in:
vitepressify/utils.crConstant Summary
-
Admonition_regex =
/(#{Admonitions_keywords.join('|')}):? ?(.+)/
-
Regex that matches admonitions and their content.
-
Admonitions =
{note: Container::INFO, experimental: Container::TIP, optimize: Container::TIP, fixme: Container::WARNING, warning: Container::WARNING, todo: Container::WARNING, bug: Container::DANGER, deprecated: Container::DANGER}
-
Crystal docs admonitions => vitepress containers.
-
Admonitions_keywords =
Admonitions.keys.map do |x| x.to_s.upcase end
-
All Crystal docs admonitions.
-
Admonitions_keywords_regex =
/(#{Admonitions_keywords.join('|')}):?/
-
Regex that matches just the admonitions.
-
Allowed_codeblocks =
{"abap", "actionscript-3", "ada", "apache", "apex", "apl", "applescript", "asm", "astro", "awk", "ballerina", "bat", "batch", "berry", "be", "bibtex", "bicep", "blade", "c", "cadence", "cdc", "clarity", "clojure", "clj", "cmake", "cobol", "codeql", "ql", "coffee", "cpp", "crystal", "csharp", "c#", "css", "cue", "d", "dart", "diff", "docker", "dream-maker", "elixir", "elm", "erb", "erlang", "erl", "fish", "fsharp", "f#", "gherkin", "git-commit", "git-rebase", "glsl", "gnuplot", "go", "graphql", "groovy", "hack", "haml", "handlebars", "hbs", "haskell", "hs", "hcl", "hlsl", "html", "ini", "java", "javascript", "js", "jinja-html", "json", "jsonc", "jsonnet", "jssm", "fsl", "jsx", "julia", "kotlin", "latex", "less", "liquid", "lisp", "logo", "lua", "make", "makefile", "markdown", "md", "marko", "matlab", "mdx", "mermaid", "nginx", "nim", "nix", "objective-c", "objc", "objective-cpp", "ocaml", "pascal", "perl", "php", "plsql", "postcss", "powershell", "ps", "ps1", "prisma", "prolog", "pug", "jade", "puppet", "purescript", "python", "py", "r", "raku", "perl6", "razor", "rel", "riscv", "rst", "ruby", "rb", "rust", "rs", "sas", "sass", "scala", "scheme", "scss", "shaderlab", "shader", "shellscript'", "shell", "bash", "sh", "zsh", "smalltalk", "solidity", "sparql", "sql", "ssh-config", "stata", "stylus", "styl", "svelte", "swift", "system-verilog", "tasl", "tcl", "tex", "toml", "tsx", "turtle", "twig", "typescript", "ts", "vb", "cmd", "verilog", "vhdl", "viml", "vim", "vimscript", "vue-html", "vue", "wasm", "wenyan", "文言", "xml", "xsl", "yaml", "zenscript"}
-
All langs shiki allows (else it crashes).
-
Allowed_codeblocks_regex =
/^```(#{Allowed_codeblocks.join('|')})({.+})?$/i
Instance Method Summary
-
#viteify(content : String) : String
Function that transforms Crystal Doc Admonitions to VitePress blocks.
Instance Method Detail
def viteify(content : String) : String
#
Function that transforms Crystal Doc Admonitions
to VitePress blocks.
Also =>
crystal,
](// => ](https://
It does so by looping through all lines and skipping
inside multiline admonitions while also keeping track
of multiple admonitions in a row. It's goal is to
wrap both inline and multiline admonitions while
avoiding creating nested ones.