Download the PHP package k-community/markdown-field without Composer

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

Markdown Field for Kirby

Enhanced, extensible Markdown field for Kirby CMS. Now available in version 2!

Features:

💡 TL;DR: The Markdown field, you all have been waiting for!

Screenshot of the editor field

Overview

This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, please consider ❤️ sponsoring me for securing the continued development of the plugin.

Table of Contents


1. Installation

This version of the plugin requires PHP 8.1 and Kirby 4.0.0 or higher. The recommended way of installing is by using Composer:

Alternatively, download and copy this repository to /site/plugins/markdown-field

2. Setup

This field can replace any textarea field you have set up and works out of the box with as little config as:

3. Options

3.1. Available options

You have access to the very same options as the textarea field, and a few more:

Option Type Required Default Description
font string false monospace Sets the font family (sans-serif or monospace)
pages Object false see below Sets a custom query for the page selector dialog
size String false small Sets the empty height of the Markdown field

3.2. Font settings

You can choose between monospace (monospace) and sans-serif (sans) font. The monospace font offers a more sophisticated layout with indentation for multiline list elements, headings, and blockquote – things, which would be much harder to implement (and slower to calculate) for a proportional font.

While the sans-serif might be more appealing to non-technical writers at first, the monospace should be the preferred version in most cases.

3.3. Buttons

This field is packing the usual textarea buttons and many more.

headlines can contain the whole range of headings from h1 to h6, and therefore accepts an array of allowed levels (default is h1, h2, h3). Use headlines as key in this case:

You also have access to additional buttons:

If you don't need it, you can hide the toolbar. This will also disable the keyboard shortcuts for all formats.

The full list of available buttons. As you can see, some buttons can also have configuration options. Take the bold button for example. Markdown allows different syntaxes for bold text, i.e. __bold__ and **bold**. The editor’s syntax highlighter will always recognize both, but you can adjust, what the editor will use when you click the toolbar button or by hitting the respective keyboard shortcut.

For the link and pagelink buttons, you can specify whether these should insert markdown or kirbytext markup. By default, this will be determined by the kirbytext option by default but can be overridden on a per-button basis.

All button configuration is optional, you can always use - ul instead of ul: -, if you want to stick to the default settings.

3.4. Keyboard Shortcuts

ℹ️ Keyboard shortcuts are only available for those buttons/heading levels enabled in the toolbar.

Block Formats

Format Mac/iOS Linux/Windows
Heading 1 ⌥⌃1 Alt+Shift+1
Heading 2 ⌥⌃2 Alt+Shift+2
Heading 3 ⌥⌃3 Alt+Shift+3
Heading 4 ⌥⌃4 Alt+Shift+4
Heading 5 ⌥⌃5 Alt+Shift+5
Heading 6 ⌥⌃6 Alt+Shift+6
Quote ⌥⌃q Alt+Shift+q
Bullet List ⌥⌃U Alt+Shift+u
Ordered List ⌥⌃O Alt+Shift+o

Inline Formats

Format Mac/iOS Linux/Windows
Bold ⌘B Ctrl+b
Italic ⌘I Ctrl+i
Link ⌘K Ctrl+k
Strikethrough ⌥⌃D Alt+Shift+d
Code ⌥⌃X Alt+Shift+x
Footnote ⌥⌃F Alt+Shift+f

Other

Format Mac/iOS Linux/Windows
Show Whitespace ⌥⌃I Alt+Shift+i
Open clicked URL in new tab ⌘+Click Ctrl+Click

URLs

3.5. Pages

You can limit the options shown in the Pagelink dialog, by setting the pages option with a query (if unset, you'll be able to browse the entire website tree)

You can also set the pages option to an object with other properties from the pages field such as info and text

3.6. Size

You can define the height of the field when empty. The default is two-lines, which mimics the textarea's default empty height.

If you want the field to mimic a text field but with some markdown highlighting on top of it, set the size to one-line and buttons: false.

All predefined sizes are:

Note that you can make the default height any height you want with some custom panel CSS. First, set the size option to any string you'd like:

Then in your panel.css:

4. Extension API

The API has changed from version 1, old plugins are not compatible anymore and require a few adjustments. See extension-examples folder.

There are two types of extensions, which allow you to extend the editor to adjust it better to your specific needs:

4.1 Custom options for pages, files, and uploads

Your extension can use a special endpoint to extend the base options for pages, files, and uploads with parameters set in the button configuration. See an example in the extension-examples/custom-pagelink folder.

The end user can configure options for your extension as part of the button configuration:

5. Development

You must run the build process before pushing the repo, or else the hot-reload code will prevent it from working in any install.

7. Migrating from Version 1

8. Known Issues

9. What’s not supported (and never will be)

The way Markdown is used nowadays has changed since its inception, especially since GFM ("GitHub-Flavored Markdown") became popular and added some elements to the language.

10. License

MIT (but you are highly encouraged to ❤️ sponsor me if this piece of software helps you to pay your bills).

11. Credits

Text editor:

Contributors:

@fabianmichael, @sylvainjule, @medienbaecker, @mtsknn, @nsteiner, @rasteiner, @thomasfahrland, @johannschopplich

Inspired by:


All versions of markdown-field with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.2
php Version >=8.1.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 k-community/markdown-field contains the following files

Loading the files please wait ....