Download the PHP package mistralys/markdown-renderer without Composer

On this page you can find all versions of the php package mistralys/markdown-renderer. 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 markdown-renderer

Markdown Renderer

CommonMark Markdown renderer for PHP with the capability to define pre- and post-processors with custom syntax.

Usage

From a Markdown string

From a Markdown file

Adding a processor

Any number of processors can be added with the addProcessor() method. They are executed in the order that they are added.

Example: Adding the bundled video processor.

Custom syntax

The library is based on a simple syntax for defining custom commands, which follow the following scheme with pseudo HTML attributes:

The parsing of these commands is handled automatically by the library, and the attributes can easily be accessed via a helper class when rendering the matching content.

Adding a custom processor

If you want to do your own syntax parsing, create a class based on BaseProcessor. Use the BaseCommandBasedProcessor class if you want to use the library's command syntax (easiest to implement). Simply implement all abstract methods, and you're good to go.

Every abstract method has documentation on what you are supposed to do.

You can create your processor class anywhere in your project, and add it to the renderer with the addProcessor() method.

Origin

I had created similar Markdown filters in several of my personal and professional projects. Each project had different enough requirements for syntax and content, and were easy enough to implement, so for a long time I did not take the step to move the common functionality to a separate library.

Another recent project made me take the step. As is often the case, I was annoyed enough by having to create regexes to parse the commands that I decided to do it right.

Philosophy

I have read quite a few discussions on what kind of information should be included in a Markdown file. Image widths are one thing that the community is divided on. I agree that the width of an image is layout information, not content. The requirement is real however, and appears often enough for me to take a pragmatic approach.

My philosophy is that as long as the Markdown content stays easily readable, and that the added syntax does not interfere with reading the document, I don't mind.


All versions of markdown-renderer with dependencies

PHP Build Version
Package Version
Requires mistralys/application-utils-core Version >=2.2.4
mistralys/application-localization Version >=1.4.1
league/commonmark Version >=2.4.1
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 mistralys/markdown-renderer contains the following files

Loading the files please wait ....