1. Go to this page and download the library: Download cassarco/markdown-tools library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cassarco / markdown-tools example snippets
return [
/*
|--------------------------------------------------------------------------
| Schemes
|--------------------------------------------------------------------------
|
| Configure as many "schemes" as you like. Each scheme should contain a
| path to a single markdown file or a folder containing markdown files.
|
*/
'schemes' => [
// Give each scheme a name for your own organisation.
'markdown' => [
// Give the path to a folder of markdown files or a single markdown file.
'path' => resource_path('markdown'),
// Specify the validation rules for front-matter properties.
'rules' => [
// 'title' => ' 'symbol' => '#',
'html_class' => '',
'aria_hidden' => false,
'id_prefix' => '',
'fragment_prefix' => '',
],
'table_of_contents' => [
'html_class' => 'table-of-contents',
'position' => 'top',
'style' => 'bullet',
'min_heading_level' => 1,
'max_heading_level' => 6,
'normalize' => 'relative',
'placeholder' => null,
],
'wikilinks' => [],
'front-matter' => [
'yaml-parse-flags' => Yaml::PARSE_DATETIME
]
],
];
use function Laravel\Prompts\info;
return [
'schemes' => [
'markdown' => [
'path' => resource_path('markdown'),
'rules' => [
'title' => '
use function Laravel\Prompts\info;
// Get the markdown for the markdown file.
$file->markdown()
// Get the front matter as a php array
$file->frontMatter()
// Get the html for the markdown file without a table of contents.
$file->html()
// Get the html table of contents.
$file->toc()
// Get the markdown file as html with the table of contents embedded.
$file->htmlWithToc()
// Get the pathname for the markdown file
$file->pathname()