PHP Classes

File: fwphp/glomodul/mkd/showhtml.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/glomodul/mkd/showhtml.php  >  Download  
File: fwphp/glomodul/mkd/showhtml.php
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change: ver 7.0.1 mnu, msg, mkd FUNCTIONAL namespaces, CRUD PDO trait, pretty URL-s
Date: 3 months ago
Size: 2,737 bytes


Class file image Download
    * f n m d 2 h t m ( ) : P a r s e d o w n displays .txt or .md or .mkd as html
    * http://dev1:8083/fwphp/www4/glomodul/mkd/?Home/md2htm/J:\awww\www/
    * CALLS (extern) Parsedown to display txt from content subfolder

require $pp1->wsroot_path.'vendor/erusev/parsedown/Parsedown.php';
$pdown = new \Parsedown; // Parsedown cls has no namespace

$fle_displ_url = '?i/edit/path/'. $fle_to_displ_path ;
$colored_fle_displ_url = '/zinc/showsource.php?file='. realpath($fle_to_displ_path)
'&line=55&prev=10000&next=10000' ;

<!DOCTYPE html><html lang="hr">
       <link rel="stylesheet" href="/zinc/themes/mini3.css">
       <!--link rel="stylesheet" href="/vendor/highlight_js/styles/default.css"-->
       <!--Ugly, no lines in tbls -->
       <!--script src="/vendor/highlight_js/highlight.pack.js"></script-->
          document.addEventListener('DOMContentLoaded', (event) => {
            document.querySelectorAll('pre code').forEach((block) => {

          </head> <body>
    //ob_start(); // this shows html below
WYSIWYG md editor SimpleMDE or use some desktop markdown text editor
        &nbsp; &nbsp;<a href="index.php" title="index.php">Home</a>

      &nbsp; &nbsp;[<a href=""
          title="html2markdown"> html2markdown </a>]

      <br /><b>Markdown txt <?=$fle_to_displ_path?> Parsedown-ed to HTML.</b>
        &nbsp; &nbsp;[<a href="<?=$fle_displ_url?>"
            title="SimpleMDE edit : <?=isset($_GET['edit'])?rtrim($_GET['edit'],'/'):''?>"
          ><b> Edit text</b>

        &nbsp; &nbsp;[<a href="<?=$colored_fle_displ_url?>"
            title="Higligted code <?=isset($_GET['edit'])?rtrim($_GET['edit'],'/'):''?>"
          ><b> Colored text</b>

//$top_toolbar = ob_get_contents();

    //echo $pdown->text($top_toolbar);

    //Warning: file_get_contents(?home/md2htm/J:): failed to open stream
$mkdowntxt = file_get_contents($fle_to_displ_path) ;
$htmltxt = $pdown->text($mkdowntxt) ;
$pdown->text($htmltxt) ;


For more information send a message to info at phpclasses dot org.