All Projects → NoisyWinds → Laravel Smartmd

NoisyWinds / Laravel Smartmd

Licence: mit
🎯 A simple markdown editor compatible most markdown parse,You can choose any parse methods on server or client,like Mathematical formula、flowchart、upload image...

Projects that are alternatives of or similar to Laravel Smartmd

Proton
A stand-alone application to quickly preview and edit Markdown files using Electron.
Stars: ✭ 140 (+84.21%)
Mutual labels:  markdown, markdown-parser, markdown-editor
Markitdown
📱 A React app to preview and edit Markdown✍. You can also export it as HTML.
Stars: ✭ 26 (-65.79%)
Mutual labels:  markdown, markdown-parser, markdown-editor
Editor.md
The open source embeddable online markdown editor (component).
Stars: ✭ 11,741 (+15348.68%)
Mutual labels:  markdown, markdown-editor, flowchart
Jekyll Spaceship
🚀 A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, mermaid, emoji, video, audio, youtube, vimeo, dailymotion, soundcloud, spotify, etc.
Stars: ✭ 196 (+157.89%)
Mutual labels:  markdown, latex, emoji
Marcdown
👻 Lightweight realtime markdown viewer and editor - Simple, clean and beautiful https://liyasthomas.github.io/marcdown
Stars: ✭ 345 (+353.95%)
Mutual labels:  markdown, markdown-parser, markdown-editor
Mditor
📝 [ M ] arkdown + E [ ditor ] = Mditor
Stars: ✭ 523 (+588.16%)
Mutual labels:  markdown, markdown-parser, markdown-editor
Marktext
📝A simple and elegant markdown editor, available for Linux, macOS and Windows.
Stars: ✭ 22,894 (+30023.68%)
Mutual labels:  markdown, latex, emoji
Markdown Latex
A markdown parser for converting markdown to LaTeX written in PHP.
Stars: ✭ 40 (-47.37%)
Mutual labels:  markdown, latex, markdown-parser
Readme2tex
Renders TeXy Math for Github Readmes
Stars: ✭ 826 (+986.84%)
Mutual labels:  markdown, latex
Cocalc
CoCalc: Collaborative Calculation in the Cloud
Stars: ✭ 888 (+1068.42%)
Mutual labels:  markdown, latex
Foliant
Comprehensive markdown-based documentation toolkit
Stars: ✭ 74 (-2.63%)
Mutual labels:  markdown, latex
Rdiscount
Discount (For Ruby) Implementation of John Gruber's Markdown
Stars: ✭ 756 (+894.74%)
Mutual labels:  markdown, markdown-parser
Stackedit.js
Add StackEdit to any website
Stars: ✭ 724 (+852.63%)
Mutual labels:  markdown, markdown-editor
Macdown
Open source Markdown editor for macOS.
Stars: ✭ 8,855 (+11551.32%)
Mutual labels:  markdown, markdown-editor
Electron Markdownify
📕 A minimal Markdown editor desktop app
Stars: ✭ 700 (+821.05%)
Mutual labels:  markdown, emoji
Rich
Rich is a Python library for rich text and beautiful formatting in the terminal.
Stars: ✭ 31,664 (+41563.16%)
Mutual labels:  markdown, emoji
Markdown
A super fast, highly extensible markdown parser for PHP
Stars: ✭ 945 (+1143.42%)
Mutual labels:  markdown, markdown-parser
Richtextview
iOS Text View (UIView) that Properly Displays LaTeX, HTML, Markdown, and YouTube/Vimeo Links
Stars: ✭ 953 (+1153.95%)
Mutual labels:  markdown, latex
Blankup Electron
Markdown editor with clarity +1, as a desktop application.
Stars: ✭ 37 (-51.32%)
Mutual labels:  markdown, markdown-editor
Pandoc Plantuml Filter
Pandoc filter for PlantUML code blocks
Stars: ✭ 51 (-32.89%)
Mutual labels:  markdown, latex

Laravel-smartmd

Documentation | 中文文档

Software License Software License packagist

A simple markdown editor compatible most markdown parse,You can choose any parse methods on server or client,like Mathematical formula、flowchart、upload image... this program is a plugin for laravel 5.4 and php 7.1 upper.more feature develop now...

Screenshots

editor demo: Demo
js render page Demo
php render page Demo

Reference:

  • CodeMirror link
  • Simplemde-markdown link
  • markdown-it (markdown render) link
  • mermaid (flowchart) link
  • intervention (image handling) link

requirements

  • PHP >= 7.1.0
  • Laravel >= 5.4.0

Installation

First, install package.

composer require noisywinds/laravel-smartmd

Then run these commands to publish assets and config:

php artisan vendor:publish --provider="NoisyWinds\Smartmd\SmartmdServiceProvider"

make test view router:

Route::group(['namespace' => 'Smartmd', 'prefix' => 'editor'], function () {
    Route::post('/upload', '[email protected]');
    Route::get('/write', function () {
        return view('vendor/smartmd/write');
    });
    Route::get('/php-show','[email protected]');
    Route::get('/js-show',function(){
        return view('vendor/smartmd/js-show');
    });
});

Rewrite UploadController or config/smartmd.php to change upload path:

<?php
return [
    "image" => [
        /*
         * like filesystem, Where do you like to place pictures?
         */
        "root" => storage_path('app/public/images'),
        /*
         * return public image path
         */
        "url" => env('APP_URL').'/storage/images',
    ],
];
  • notice: uploda image will optimize and resize in the UploadController

Some shortcode

  1. Bold (Ctrl + b)
  2. Italic (Ctrl + I)
  3. Insert Image (Ctrl + Alt + I)
  4. Insert Math (Ctrl + m)
  5. Insert flowchart (Ctrl + Alt + m)
  6. more... (mac command the same with ctrl)

editor options

new Smartmd({
   // editor element {string} 
   el: "#editor",
   
   // editor wrapper layout {string or number}
   height: "400px",
   width: "100%",
   
   // autosave 
   autoSave: {
     // uuid is required {string or number}
     uuid: 1,
     // {number}
     delay: 5000
   },
   
   // init state {boolean}
   isFullScreen: true, // default false
   isPreviewActive: true // default false
});

parse markdown

I don't need editor:

// require in your view meta
@include('Smartmd::js-parse')
<script>
    // create Parsemd object use javascript parse markdown
    var parse = new Parsemd();
    var html = parse.render(document.getElementById("editor").value.replace(/^\s+|\s+$/g, ''));
    document.getElementById("content").innerHTML = html;
</script>

I need editor:

<script>
    var smartmd = new Smartmd();
    smartmd.markdown("# hello world");
</script>

I want php render:

  • only render Formula、Flowchart、Code highlight use JavaScript
// require in your view meta
@include('Smartmd::php-parse')

ParseController.php

use NoisyWinds\Smartmd\Markdown;

$parse = new Markdown();
$text = "# Your markdown text";
$html = $parse->text($text);
return view('Smartmd::php-show',['content'=>$html]);

How to expand

editor

markdown render

  • markdown-it (markdown render) link

issue

Welcome to ask questions or what features you want to be compatible with.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].