WordPress PHP short code to parse markdown

Requirements to include a markdown file from elsewhere emerged when I decide to auto update my blog with github readme page.

Since markdown itself cannot include another markdown file, I come up with a work around to parse the github raw on the air.

The following example requires wp-githuber-md - since I am already using it anyway. Any equivalent will do.

/*====== parse_md shortcode ======*/
function parse_md($atts = [])
{
    $src = $atts['src'];
    $md = file_get_contents($src);

    if ($md === false)
    {
        $html = "Could not load $src";
    }
    else
    {
        require_once $_SERVER['DOCUMENT_ROOT'] . "/wp-content/plugins/wp-githuber-md/src/Modules/MarkdownParser.php";
        $markdownParser = new Githuber\Module\MarkdownParser;
        $html = $markdownParser->transform($md);
    }

    return $html;
}
add_shortcode( 'parse_md', 'parse_md' );

Usage

[parse_md src="<url>]