{"id":3502,"date":"2026-08-27T18:31:12","date_gmt":"2026-08-27T16:31:12","guid":{"rendered":"https:\/\/digitalia.culturanuova.net\/blog\/?p=3502"},"modified":"2026-08-27T18:35:23","modified_gmt":"2026-08-27T16:35:23","slug":"add-an-external-md-file-to-a-php-page","status":"publish","type":"post","link":"https:\/\/digitalia.culturanuova.net\/blog\/?p=3502","title":{"rendered":"add an external md file to a php page"},"content":{"rendered":"\n<p>&#8230; and, of course see it as html, with the same graphical appearance of any other web text.<\/p>\n\n\n\n<p>A way can be use a very light javascript, <a href=\"https:\/\/md-block.verou.me\/\">md-block.js<\/a>, di Lea Verou.<\/p>\n\n\n\n<p>Then you can add a function to your php website, like the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/* to call a file Markdown from a given folder *\/\n\nfunction scheda_md($file)\n{\n    global $yourwebsite;\n\n    $file = basename($file);\n\n    return '&lt;md-block src=\"' .\n           $yourwebsite .\n           '\/the-path\/where-are-md-files\/from-yourwebsite-root' .\n           htmlspecialchars($file, ENT_QUOTES, 'UTF-8') .\n           '\"&gt;&lt;\/md-block&gt;';\n}\n?&gt;<\/code><\/pre>\n\n\n\n<p>And in the page where you want to show that md file you can use this code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?= scheda_md('the-md-name.md') ?&gt;<\/code><\/pre>\n\n\n\n<p><br><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8230; and, of course see it as html, with the same graphical appearance of any other web text. A way can be use a very light javascript, md-block.js, di Lea Verou. Then you can add a function to your php website, like the following: And in the page where you want to show that md &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/digitalia.culturanuova.net\/blog\/?p=3502\" class=\"more-link\">Leggi tutto<span class=\"screen-reader-text\"> &#8220;add an external md file to a php page&#8221;<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[885,747,828,829,751,566],"tags":[17,435],"class_list":["post-3502","post","type-post","status-publish","format-standard","hentry","category-code","category-javascript","category-markdown","category-markdown-office","category-php","category-webmaster","tag-php","tag-php-include-file-remoto"],"_links":{"self":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3502"}],"version-history":[{"count":3,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3502\/revisions"}],"predecessor-version":[{"id":3507,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3502\/revisions\/3507"}],"wp:attachment":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}