Markdown::Parser::Document - Markdown Document Element
my $doc = Markdown::Parser::Document->new; # or my $parser = Markdown::Parser->new; my $doc = $parser->create_document;
v0.2.0
This class represents a markdown document. It is used by Markdown::Parser and inherits from Markdown::Parser::Element
This is the top element used and created by the parser.
Boolean that affects how "get_abbreviation" works. If set to true, then abbreviations will be case sensitives, otherwise case will not matter. Default is to be case insensitive.
Provided with an css stylesheet URI, and this will add it to the document.
It returns an error if the url is not a valid url.
If the url has already been set, it will be ignored, so as to avoid duplicates.
It returns the current document object for chaining.
Provided with some javascript code, and this will add it to the stack stored in "js_data".
If it was already provided, it will be ignore so as to avoid duplicates.
Provided with an javascript URI, and this will add it to the document.
Provided with a Markdown::Parser::Element object and this will add it to its list of objects for this document in the special hash "objects" using the object id retrieved with "object_id" in Markdown::Parser::Element
Returns the document as markdown
Returns the document as pod
Returns the parsed document structure as html, possibly including inline css rules
Sets or gets an hash reference of bolds values.
A shared CSS::Object object, instantiated by Markdown::Parser and shared with modules that may require the use of css, such as Markdown::Parser::Table
This method is called by as_string to add the necessary inline css rules in the head fo the resulting html document.
Sets or gets an array reference of css links.
It returns a Module::Generic::Array objects.
Sets or gets the default email address to use for email obfuscation.
It could be something that should not exist like dave.null@example.com
dave.null@example.com
An alias for "dictionary"
This is a Module::Generic::Hash object containing key-value pairs for term definition.
The css class to use when obfuscating email address.
See "as_string" in Markdown::Parser::Link
The fake host to use when performing email obfuscation.
The fake user to use when performing email obfuscation.
Sets or gets an hash reference of key-value paris used for emphasis.
This returns a Module::Generic::Hash object.
Sets or gets an array reference of footnotes.
This returns a Module::Generic::Array object.
Sets or gets a dictionary hash of footnotes to their definition.
Given a term, this will return its corresponding Markdown::Parser::Abbr object
If "abbreviation_case_sensitive" is set to a true value, the terms will be case sensitive.
Provided a footnote reference like 1 or thisRef and this will return the corresponding Markdown::Parser::Footnote object, if any.
1
thisRef
Provided a link id, and this returns the corresponding Markdown::Parser::Link object, if any.
Sets or gets a boolean value whether the email obfuscation is enabled.
Sets or gets a boolean value whether katex is enabled.
See the Katex website for more information
Sets or gets a boolean value whether mermaid is enabled.
Mermaid is a nifty tool used for generating flowchart effortlessly.
See the Mermaid website for more information
Sets or gets the array reference object of javascript code to be used in this document.
Sets or gets the array reference object of javascript links to be used in this document.
Sets or gets the array reference object of possible katex delimiters.
This defaults to:
['$$','$$','$','$','\[','\]','\(','\)']
Sets or gets the hash object containing link name and definition pairs.
The hash object is a Module::Generic::Hash object.
Sets or gets the hash object of Markdown::Parser::Elements ids to their corresponding object.
This is a repository used internally and not to be messed up with.
It returns a Module::Generic::Hash
Provided an Markdown::Parser::Abbr object, and this add the abbreviation to the list of known abbreviations.
Provided an Markdown::Parser::Footnote object, and this add the footnote with its id to the list of known footnotes.
Provided with a a Markdown::Parser::LinkDefinition object, and this adds it to the hash object for future reference.
Returns the current document object.
If "is_email_obfuscation_setup" is enabled and based on the "email_obfuscate_class" class defined, and this will use CSS::Object to find all matches and implement obfuscation for each match found.
This is based on a novel idea from https://stackoverflow.com/a/21421949/4814971
If "is_katex_setup" is enabled, this will add all the necessary css and javascript resource to transform markdown mathematic typesettings into visual ones .
If "is_mermaid_setup" is enabled, this will add all the necessary css and javascript resource to transform markdown flowcharts into visual flowcharts.
Markdown original author reference on emphasis: https://daringfireball.net/projects/markdown/syntax#link
Jacques Deguest <jack@deguest.jp>
Copyright (c) 2020 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.
To install Markdown::Parser, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Markdown::Parser
CPAN shell
perl -MCPAN -e shell install Markdown::Parser
For more information on module installation, please visit the detailed CPAN module installation guide.