Download the PHP package develate/commonmark-customtags without Composer

On this page you can find all versions of the php package develate/commonmark-customtags. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package commonmark-customtags

commonmark-customtags

A league/commonmark v2 extension for inline custom tags such as:

The extension parses the content between the delimiters, uses the first token as a tag identifier, supports quoted argument values, URL-decodes the remaining arguments, and delegates rendering to your own Customtag classes.

Installation

Requirements:

Basic Usage

Register the extension on a CommonMark environment and add one or more tags:

Output:

Tag Syntax

The default delimiters are {{ and }}.

Inside the delimiters:

For example:

is passed to the matching tag as:

If a tag identifier is not registered, the inner text is rendered unchanged and the delimiters are removed.

Custom tags are intended for plain command-style text. Put the tag name first, provide at least one token, and wrap argument values that contain spaces in double quotes. URL-encoded values are still supported for compatibility.

Creating Tags

Create a class that extends Develate\CommonmarkCustomtags\Customtag.

Register it with the extension:

Then use it in Markdown:

Normalizing Arguments

Override makeArguments() when a tag should validate or normalize its arguments before rendering:

Markdown:

Shared Globals

Pass shared context into the extension constructor. The same value is provided to every tag's render() method as $globals.

Use it inside a tag:

$globals can be an array, object, service container, or any other value your tags know how to consume.

Custom Delimiters

You can change the opening and closing delimiters:

Markdown:

Delimiter rules:

These rules come from the way league/commonmark delimiter processors match character runs.

Registering Tags in the Constructor

Tags can also be passed directly to the constructor. The array keys must be the tag identifiers:

Using addTag() is usually simpler because it keys the tag by identifier() for you.

Escaping and Security

Rendered tag output is returned directly to CommonMark. Escape any user-controlled values yourself before returning HTML.

Recommended helpers:

If a tag should not render anything, return null or an empty string from render().

Full Example


All versions of commonmark-customtags with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
league/commonmark Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package develate/commonmark-customtags contains the following files

Loading the files please wait ...