Module: Jekyll::WikiRefs

Defined in:
lib/jekyll-wikirefs/config.rb,
lib/jekyll-wikirefs/version.rb,
lib/jekyll-wikirefs/util/regex.rb,
lib/jekyll-wikirefs/util/parser.rb,
lib/jekyll-wikirefs/util/wikiref.rb,
lib/jekyll-wikirefs/patch/context.rb,
lib/jekyll-wikirefs/plugins/filter.rb,
lib/jekyll-wikirefs/util/link_index.rb,
lib/jekyll-wikirefs/patch/doc_manager.rb,
lib/jekyll-wikirefs/plugins/converter.rb,
lib/jekyll-wikirefs/plugins/generator.rb

Defined Under Namespace

Modules: TypeFilters Classes: Context, DocManager, Generator, LinkIndex, Parser, PluginConfig, WebLinkConverter, WikiLinkBlock, WikiLinkInline

Constant Summary collapse

VERSION =
"0.0.15"
SUPPORTED_IMG_FORMATS =
Set.new(['.png', '.jpg', '.gif', '.psd', '.svg'])
/\[\[/
/\]\]/
/(?<embed>\!)/
/\s*::\s*/
/\#/
/\#\^/
/\|/
/[^\n\s\!\#\^\|\]]+/i
REGEX_FILENAME_CHARS =
/[^\\:\#\^\|\[\]]+/i
REGEX_HEADER_CHARS =
/[^\!\#\^\|\[\]]+/i
REGEX_BLOCK_ID_CHARS =
/[^\\\/:\!\#\^\|\[\]^\n]+/i
REGEX_LABEL_CHARS =
/(.+?)(?=\]{2}[^\]])/i
/(?<link-type-txt>#{REGEX_LINK_TYPE_CHARS})/i
REGEX_FILENAME =
/(?<filename>#{REGEX_FILENAME_CHARS})/i
REGEX_HEADER_TXT =
/(?<header-txt>#{REGEX_HEADER_CHARS})/i
REGEX_BLOCK_ID_TXT =
/(?<block-id>#{REGEX_BLOCK_ID_CHARS})/i
REGEX_LABEL_TXT =
/(?<label-txt>#{REGEX_LABEL_CHARS})/i
REGEX_ATX_HEADER =

target markdown text (headers, lists, and blocks) kramdown regexes atx header: github.com/gettalong/kramdown/blob/master/lib/kramdown/parser/kramdown/header.rb#L29

/^\#{1,6}[\t ]*([^ \t].*)\n/i
REGEX_SETEXT_HEADER =
/^\s{0,3}([^ \t].*)\n[-=][-=]*[ \t\r\f\v]*\n/i
REGEX_BULLET =
/(?<bullet>[+*-])/i
REGEX_BLOCK =

markdown-style block-reference

/.*\s\^#{REGEX_BLOCK_ID_TXT}/i
%r{                     # capture indeces
  (#{REGEX_LINK_EMBED})?                          # 0
  (#{REGEX_LINK_TYPE_TXT}#{REGEX_LINK_TYPE})?     # 1
  #{REGEX_LINK_LEFT}
    #{REGEX_FILENAME}                             # 2
    (#{REGEX_LINK_HEADER}#{REGEX_HEADER_TXT})?    # 3
    (#{REGEX_LINK_BLOCK}#{REGEX_BLOCK_ID_TXT})?   # 4
    (#{REGEX_LINK_LABEL}#{REGEX_LABEL_TXT})?      # 5
  #{REGEX_LINK_RIGHT}
}x
REGEX_SINGLE =

block single

/#{REGEX_LINK_LEFT}#{REGEX_FILENAME_CHARS}#{REGEX_LINK_RIGHT}/i
REGEX_LIST_COMMA =

list (comma is responsible for catching the single case)

/((?:\s*#{REGEX_SINGLE}\s*)(?:,\s*#{REGEX_SINGLE}\s*)*)/i
REGEX_LIST_MKDN =
/((?<=\n)\s{0,3}#{REGEX_BULLET}\s#{REGEX_SINGLE}\s*)+/i
REGEX_BLOCK_TYPES =

process

/((?<!\n)(?:#{REGEX_LIST_COMMA})|#{REGEX_LIST_MKDN})/i
/^\s{0,3}#{REGEX_LINK_TYPE_TXT}#{REGEX_LINK_TYPE}(?:\s*|\G)(?<items>#{REGEX_BLOCK_TYPES})\n/i