Download the PHP package markup-carve/tempest-highlight-carve without Composer

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

Carve for tempest/highlight

CI Latest Stable Version Total Downloads PHPStan PHP Version

Server-side syntax highlighting for Carve, a lightweight markup language for documents and the web, as a language for tempest/highlight.

Usage

Register the language on a highlighter and parse with carve or crv:

Styling comes from tempest/highlight's own themes, so an existing stylesheet needs no change, with one exception: CSV and TSV separators are emitted as hl-operator, and the stock highlight-tempest.css has no rule for that class, so they render uncolored. Add one:

Code fence body lines are wrapped in a carve-code span with no stock rule, so they render as plain text. Style that class if code should stand out.

To highlight .crv blocks inside Markdown rendered through the CommonMark extension, register the language on the highlighter you hand to that extension; nothing else differs.

What it highlights

Headings, thematic breaks, lists (unordered, ordered, the letter dialects, the auto-numbering . form and every task state), definition lists, blockquotes and their continuation markers, tables with their alignment axes, captions, code and colon fences, comments in all three spellings, attribute blocks, links, images, spans, autolinks, cross-references, footnotes, includes, math, CriticMarkup, mentions and tags, smart typography, and the full emphasis set.

Carve is not Markdown, and the grammar knows it

Most of the work here is in what does not get highlighted. Carve's emphasis uses single delimiters, so the Markdown doubles are ordinary text:

Written Carve reads it as
/italic/ *bold* _underline_ ~strike~ =highlight= emphasis
**bold** ~~strike~~ literal text
{^sup^} {,sub,} superscript, subscript
^sup^ ,sub, literal text

A highlighter that does not know this does not leave the construct alone - it reads it as whatever its own syntax spells, and tells the reader the opposite of what the document does. The same trap catches snake_case_name, key=value, and any bare URL, which is dense in exactly the characters Carve marks emphasis with. Each of those is pinned by a test.

Pattern order is the mechanism. tempest/highlight applies patterns in the order CarveLanguage::getPatterns() returns them, so every construct that may contain a delimiter is listed before the emphasis patterns. Moving one up turns a URL into an italic, silently, which is why the ordering carries a comment in the source rather than only here.

Limits

tempest/highlight matches a flat list of regular expressions with no parser state, which is the right trade for a highlighter but does bound what is reachable:

For editor-grade highlighting that tracks state, use the TextMate grammar in carve-grammars or the tree-sitter grammar.

Contributing

Every pattern carries #[PatternTest] attributes, and tests/PatternAttributesTest.php runs them - upstream's runner globs its own tree, so these would otherwise never execute. A pattern with no case fails the suite. Use output: null to pin what must not match; those cases are the ones that catch a Markdown habit reaching into a Carve grammar.


All versions of tempest-highlight-carve with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
tempest/highlight Version ^2.28
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/tempest-highlight-carve contains the following files

Loading the files please wait ...