Download the PHP package stanislas-poisson/kmark without Composer

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

KMark

[![CI][ci-badge]][ci] [![Release][release-badge]][releases] [![Packagist][packagist-badge]][packagist] [![PHP][php-badge]][packagist] [![License][license-badge]][license] [![Docs][docs-badge]][docs]

A Markdown to HTML converter written in PHP. It follows the original Markdown (with the usual GitHub extensions: tables, fenced code, strikethrough), and adds one thing to it: an id and CSS classes can be attached to an element, for example # Title {#myId .class1 .class2}. It is made for the web: the output is HTML.

Status: stable, 2.0.0. KMark was written in 2013 with a syntax of its own (bold with *x*, italic with -x-, links as [x]:(url), code between two lines of ~~). It now follows the Markdown that everybody writes, so a text written for Markdown renders as expected (#34). That is a breaking change: see Upgrading from 1.x.

Documentation

The [documentation site][docs] has this guide and the reference of every class, read from the source, for each released version (selector at the top right, next is main). Build it with cd docs && npm ci && npm run dev.

Requirements

PHP 8.3 or higher. There is no dependency.

Usage

Install it with Composer:

The same with an instance:

A Convert object never changes: withText() and convert() return a new one.

Output:

The blocks of the output are separated by a line break, and the HTML is the one of the usual converters (<p>, <ul>, <pre><code class="language-php">…).

Syntax

Element Input Output
Heading ## Title, or Title then a line of = (level 1) or - (level 2) <h2>Title</h2>
Paragraph text, separated by a blank line <p>text</p>
Line break two spaces or a backslash at the end of a line <br>
Italic *foo* or _foo_ <i>foo</i>
Bold **foo** or __foo__ <b>foo</b>
Strikethrough --foo-- or ~~foo~~ <del>foo</del>
Underline ++foo++ <u>foo</u>
Code `foo` | <code>foo</code>
Code block lines between two lines of three backticks (or tildes), or lines indented by four spaces <pre><code>…</code></pre>
Quote > text <blockquote>…</blockquote>
Bulleted list - one, * one or + one <ul><li>one</li>…</ul>
Numbered list 1. one or 1) one <ol><li>one</li>…</ol>
Rule ---, *** or ___ alone on a line <hr>
Table \| A \| B, a line of dashes, then rows <table>…</table>
Link [text](https://example.com "Title") <a href="https://example.com" title="Title">text</a>
Image ![alt](https://example.com/a.png "Title") <img src="https://example.com/a.png" alt="alt" title="Title">
Bare URL https://example.com <a href="https://example.com">https://example.com</a>

Headings

# to ######, with closing # if you like (## Title ##). A # needs a space after it: #hashtag is text. A heading can also be underlined, as in the original Markdown:

Text styles

Style Markdown Default output Key of the option tags
Bold **bold** or __bold__ <b>bold</b> bold
Italic *italic* or _italic_ <i>italic</i> italic
Underline ++underline++ <u>underline</u> underline
Strikethrough --strike-- or ~~strike~~ <del>strike</del> strike

***both*** is bold and italic. Bold and italic are the ones of the original Markdown, the strikethrough ~~x~~ comes from GitHub, and --x-- and the underline are KMark's (Markdown has none). An underscore inside a word is not a marker, so snake_case_name stays as it is, and C++ is not an underline.

The default elements are the plain HTML ones: <b>, <i>, <u> and <del>. If you want other elements (<strong>, <em>, <ins>, <s>) or classes (<span class="b">), set them with the option tags, see Options.

Code

A code span is between backticks. The same number of backticks opens and closes it, so a code can hold backticks: . The text is escaped, and nothing is read inside it.

A code block is between two lines of three backticks or more (or three tildes or more). The word after the opening line is the language, written as a class:

`

gives

Lines indented by four spaces (or one tab) are a code block too.

Quotes

A quote holds blocks: headings, lists, code, other quotes. A line of text without > right after a line of text goes on with it, as in the original Markdown.

Lists

A list is nested by indenting its items, with four spaces, or two under a bullet, or a tab. A list is loose when a blank line separates its items or the blocks of an item: its text is then in paragraphs. Otherwise the text is written without <p>. A numbered list starts at the number of its first item (<ol start="3">). Two kinds of bullets next to each other are two lists.

Tables

As on GitHub: a line of headers, a line of dashes whose colons align the columns, then the rows. The cells can hold emphasis, code and links, and \| writes a bar inside a cell.

:--- is left, ---: is right and :---: is the centre (style="text-align: …").

Links and images

Inline: [text](url "title"). By reference, with the definition on a line of its own, anywhere in the text:

<https://example.com> and <[email protected]> are links, and so are the bare http:// and https:// URLs (see the option autoLinks). A final ., ,, ;, :, !, ? or a closing parenthesis that the URL did not open is left outside the link.

Escapes

A backslash before a punctuation character writes it as it is: \*not emphasis\*. Before anything else the backslash stays: C:\Users.

Id and classes

This is what KMark adds to Markdown. Write {#id .class1 .class2}:

$options = new Options( autoLinks: false, allowedSchemes: ['https', 'mailto'], tags: ['bold' => new Tag('span', ['bold'])], );

echo Convert::toHtml('hello https://example.com', $options); //

hello https://example.com

sh make install make hooks # the Git hooks make quality # Pint, PHPStan, Rector, PHP Insights and PHPUnit



`make help` lists every command. See [CONTRIBUTING.md](CONTRIBUTING.md) for the details.

## Roadmap

1. Fix the known bugs and clean the application ([#2](https://github.com/Stanislas-Poisson/KMark/issues/2)): done.
2. Add the missing features ([#3](https://github.com/Stanislas-Poisson/KMark/issues/3)): done.
3. Turn KMark into a Composer package with a configuration ([#4](https://github.com/Stanislas-Poisson/KMark/issues/4)): done, released as `1.0.0`.
4. Follow the original Markdown and keep the id and class rules ([#34](https://github.com/Stanislas-Poisson/KMark/issues/34)): done, released as `2.0.0`.

## Statistics

![Statistics of KMark][stats-card]

## License

[MIT](LICENSE). Copyright (c) 2013 Stanislas Poisson.

[ci-badge]: https://img.shields.io/github/actions/workflow/status/Stanislas-Poisson/KMark/ci.yml?branch=main&label=CI
[ci]: https://github.com/Stanislas-Poisson/KMark/actions/workflows/ci.yml
[release-badge]: https://img.shields.io/github/v/release/Stanislas-Poisson/KMark
[releases]: https://github.com/Stanislas-Poisson/KMark/releases
[packagist-badge]: https://img.shields.io/packagist/v/stanislas-poisson/kmark
[packagist]: https://packagist.org/packages/stanislas-poisson/kmark
[php-badge]: https://img.shields.io/packagist/dependency-v/stanislas-poisson/kmark/php
[license-badge]: https://img.shields.io/github/license/Stanislas-Poisson/KMark
[license]: LICENSE
[docs-badge]: https://img.shields.io/badge/docs-online-blue
[docs]: https://stanislas-poisson.github.io/KMark/
[stats-card]: https://raw.githubusercontent.com/Stanislas-Poisson/Stanislas-Poisson/main/assets/projects/kmark.svg

All versions of kmark with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
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 stanislas-poisson/kmark contains the following files

Loading the files please wait ...