src/utils/Html.php
public static function md($path, $data = [])
		{
			// find file
			$abspath = preg_match('%^(/|[a-z]:)%i', $path) === 1
				? $path
				: \View::getFinder()->find($path);

			// get contents
			$contents = file_get_contents($abspath);

			// update values
			$data['route'] = app(SketchpadConfig::class)->route;
			foreach ($data as $key => $value)
			{
				$contents = preg_replace('/\{\{\s*' .$key. '\s*\}\}/', $value, $contents);
			}

			// return
			return '<div data-format="markdown">' .$contents. '</div>';
		}
public static function md($path, $data = [])
		{
			// find file
			$abspath = preg_match('%^(/|[a-z]:)%i', $path) === 1
				? $path
				: \View::getFinder()->find($path);

			// get contents
			$contents = file_get_contents($abspath);

			// update values
			$data['route'] = app(SketchpadConfig::class)->route;
			foreach ($data as $key => $value)
			{
				$contents = preg_replace('/\{\{\s*' .$key. '\s*\}\}/', $value, $contents);
			}

			// return
			return '<div data-format="markdown">' .$contents. '</div>';
		}
public static function md ( $ path , $ data = [ ] ) { // find file $ abspath = preg_match ( '%^(/|[a-z]:)%i' , $ path ) === 1 ? $ path : \ View :: getFinder ( ) -> find ( $ path ) ; // get contents $ contents = file_get_contents ( $ abspath ) ; // update values $ data [ 'route' ] = app ( SketchpadConfig :: class ) -> route ; foreach ( $ data as $ key => $ value ) { $ contents = preg_replace ( '/\{\{\s*' . $ key . '\s*\}\}/' , $ value , $ contents ) ; } // return return '<div data-format="markdown">' . $ contents . '</div>' ; }
Loads a Markdown file, and instructs Sketchpad to transform it in the front end

@param   string  $path An absolute or relative file reference
@param   array   $data
@return  string
Loads a Markdown file and instructs Sketchpad to transform it in the front end