Download the PHP package markup-carve/symfony-carve without Composer

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

symfony-carve

CI PHP

Symfony bundle that renders Carve markup to HTML using carve-php.

Carve is "Djot minus the footguns": a lightweight markup language with consistent, unambiguous syntax.

Installation

Register the bundle (Symfony Flex does this automatically; otherwise add it to config/bundles.php):

Usage

Service

Twig

Only the HTML output from carve is marked safe, so Twig does not double-escape it. The carve_text and carve_markdown filters are not HTML and Twig escapes them normally. Safe mode only affects HTML rendering; profiles apply to all three output formats.

Configuration

Key Type Default Description
safe_mode bool true Enable HTML sanitization. Keep this on for untrusted input.
raw_html enum strip How raw HTML is handled when safe_mode is on: strip, escape, allow.
profile enum|null null Restrict markup features using full, article, comment, or minimal.
diagrams string[] [] Diagram fenced-block presets to enable (see below). Off by default.

Setting safe_mode: false disables sanitization entirely. Only do this for fully trusted input. Safe mode only affects HTML output. Profiles restrict available constructs for HTML, plain-text, and Markdown output; null leaves all constructs available.

Diagrams

By default a fenced block like plantuml yaml

config/packages/carve.yaml

carve: diagrams: ['plantuml', 'mermaid'] ` renders as

...
and mermaid ```` as
...
`, ready for a browser library to pick up.

Preset Fence word(s) Output
mermaid mermaid <pre class="mermaid">
plantuml plantuml, puml <pre class="plantuml">
d2 d2 <pre class="d2">
graphviz dot, graphviz <pre class="graphviz">
wavedrom wavedrom <pre class="wavedrom">
vega_lite vega-lite <div class="vega-lite"><script type="application/json">
chart chart <div class="chart"><script type="application/json">
abc abc <pre class="abc">

The bundle only emits the markup - it does not ship or load any renderer. You supply the client side:

Unknown names in the whitelist are rejected by config validation; the accepted values are exactly the presets above.

Demo

A full runnable demo app lives at symfony-carve-demo: the Twig filter and function, the CarveRenderer service, a live editor, a safe-mode comparison, and a syntax gallery.

symfony-carve demo

License

MIT


All versions of symfony-carve with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
markup-carve/carve-php Version ^0.1.5
symfony/config Version ^6.4 || ^7.0
symfony/dependency-injection Version ^6.4 || ^7.0
symfony/http-kernel Version ^6.4 || ^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 markup-carve/symfony-carve contains the following files

Loading the files please wait ...