PHP code example of jormin / md-convert

1. Go to this page and download the library: Download jormin/md-convert 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/ */

    

jormin / md-convert example snippets


/**
 * 转换Html
 *
 * @param string $mdFile Markdown源文件绝对路径,需要可读
 * @param string $savePath 转换后文件存储目录,需要可读可写,为空默认使用源文件目录
 * @param array $saveName 转换后文件名称,为空默认使用源文件名称
 * @return array
 */
$mdConvert->toHtml($mdFile, [$savePath=null, $saveName=null]);

/**
 * 转换PDF
 *
 * @param string $mdFile Markdown源文件绝对路径,需要可读
 * @param string $savePath 转换后文件存储目录,需要可读可写,为空默认使用源文件目录
 * @param array $saveName 转换后文件名称,为空默认使用源文件名称
 * @return array
 */
$mdConvert->toPDF($mdFile, [$savePath=null, $saveName=null]);
 php
$mdConvert = \Jormin\MDConvert\MDConvert::load();