Download the PHP package phpsoftbox/markdown without Composer

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

PhpSoftBox Markdown

Компонент безопасного рендера Markdown-документов.

Пакет дает framework-level API поверх Markdown parser и YAML parser. Он умеет разбирать Markdown source, front matter, строить HTML, TOC, heading anchors, обрабатывать расширения синтаксиса и возвращать diagnostics без привязки к тому, где именно используется результат: в документации, админке, CMS, письмах или другом app-layer.

Возможности

Front Matter

Если YAML невалидный, компонент вернет diagnostic front_matter.invalid, но тело документа останется доступным.

TOC И Anchors

Заголовки получают стабильные id:

Результат:

Диапазон TOC настраивается:

Links И Assets

Renderer не знает файловую структуру, правила роутинга и публичные URL приложения. Для этого передается resolver:

Если resolver не смог найти цель, он возвращает MarkdownResolvedLink::unresolved() или MarkdownResolvedAsset::unresolved(). Renderer добавит diagnostics link.unresolved или asset.unresolved.

Code Blocks

Поддерживается title в info string:

`

В HTML появятся data-language, data-title и подпись блока.

Если задан allowedCodeLanguages, неизвестный язык попадет в diagnostic code.language_unknown.

Admonitions

Поддержанные типы:

Неизвестный тип возвращает diagnostic admonition.unknown.

Tabs

Tabs-блок задается контейнером :::tabs и секциями @tab:

js console.log('ok'); `

Renderer вернет статичный HTML:

Компонент не навязывает JS-поведение. Приложение может подключить собственный скрипт/React-компонент поверх классов markdown-tabs* и data-tab.

Некорректный блок возвращает diagnostic tabs.invalid.

HTML Safety

По умолчанию raw HTML экранируется:

Доступные политики:

Даже при разрешенном HTML renderer блокирует опасные URL schemes: javascript:, vbscript:, data:.

MarkdownHtmlPolicy::Allow — только для доверенного контента: renderer не санитизирует HTML, <script>, <iframe> и атрибуты-обработчики (onerror, onclick) попадают в результат как есть. Для пользовательского ввода используйте Escape или Strip.

Для внешних ссылок можно включить target/rel:

Diagnostics

Минимальные коды:

Лицензия

MIT


All versions of markdown with dependencies

PHP Build Version
Package Version
Requires league/commonmark Version ^2.7
php Version ^8.5
symfony/yaml Version ^7.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 phpsoftbox/markdown contains the following files

Loading the files please wait ...