Download the PHP package conde-nast-international/copilot-markdown-generator without Composer
On this page you can find all versions of the php package conde-nast-international/copilot-markdown-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download conde-nast-international/copilot-markdown-generator
More information about conde-nast-international/copilot-markdown-generator
Files in conde-nast-international/copilot-markdown-generator
Package copilot-markdown-generator
Short Description Generator classes for Copilot-flavored Markdown tags.
License MIT
Homepage https://github.com/conde-nast-international/copilot-markdown-generator-php
Informations about the package copilot-markdown-generator
copilot-markdown-generator (PHP)
Generator classes for Copilot-flavored Markdown tags.
This is a utility library for generating Copilot-flavored Markdown, created for use in PHP implementations of the Flyway Integration API.
Install
Using Composer:
Basic usage
See the example implementation, which shows how the library can be used to convert custom XML content.
Contributing
See the Contributing document for guidance on making contributions to the project.
API
This library is a collection of simple Markdown generator classes namespaced in
CopilotTags
(e.g. CopilotTags\Paragraph
).
Several of the generators take a text parameter. The given text value can contain any valid Copilot-flavored Markdown, which allows for tags to be nested.
NOTE: You need to escape any Markdown characters in the
source content that should not be treated as Markdown:
CopilotTag
Interface for tag generator classes.
-
CopilotTag->render()
Render tag object as beautified Copilot-flavored Markdown string.
Return: string (Markdown)
Text
Generator for unformatted text.
new Text($text)
text: string (Markdown)
Heading
Generator for ATX headings.
new Heading($text[, $level])
text: string (Markdown)
level: int (default:2
) (min:2
) (max:4
)
Paragraph
Generator for paragraphs.
new Paragraph($text)
text: string (Markdown)
InlineText
Generator for inline text tags: emphasis, strong and delete.
new InlineText($text[, $delimiter])
text: string (Markdown)
delimiter: string (InlineTextDelimiter
) (default:""
)
InlineTextDelimiter
Class Constant | Value | Also known as |
---|---|---|
EMPHASIS |
* |
Italic, em |
STRONG |
** |
Bold |
DELETE |
~~ |
Strikethrough, strike, del |
Link
Generator for links.
new Link([$text, $href, $attributes])
text: string (Markdown) (default:""
)
href: string (default:""
)
attributes: array (default:[]
)
Blockquote
Generator for block quotes.
new Blockquote($text)
text: string (Markdown)
ListTag
Generator for lists.
new ListTag($items[, $ordered])
items: array (Markdown)
ordered: boolean (default:FALSE
)
Embed
Generator for embeds.
new Embed($uri[, $subtype, $caption])
uri: string
subtype: string (default:EmbedSubtype::IFRAME
)
caption: string (default:""
)
EmbedSubtype
Class constants for valid embed subtypes. See the source file for reference.