src/Theme.php
public static function toHTML(array $embed, bool $inlineStyle=false): string
    {
        static $css_done;
        $css = '';

        // use object dimension as dimension reference
        $d = &$embed['dimension'];

        // link to the stylesheet on first run
        if ($inlineStyle && !isset($css_done)) {
            $css = '<style>' . Theme::style() .  '</style>';
            $css_done = true;
        }

        ob_start();
        include __DIR__ . '/Theme/theme.tpl.php';
        $codeblock = ob_get_contents();
        ob_end_clean();
        return preg_replace('/[\t ]*[\r\n]+[\t ]*/', ' ', $css.$codeblock);
    }
public static function toHTML(array $embed, bool $inlineStyle=false): string
    {
        static $css_done;
        $css = '';

        // use object dimension as dimension reference
        $d = &$embed['dimension'];

        // link to the stylesheet on first run
        if ($inlineStyle && !isset($css_done)) {
            $css = '<style>' . Theme::style() .  '</style>';
            $css_done = true;
        }

        ob_start();
        include __DIR__ . '/Theme/theme.tpl.php';
        $codeblock = ob_get_contents();
        ob_end_clean();
        return preg_replace('/[\t ]*[\r\n]+[\t ]*/', ' ', $css.$codeblock);
    }
public static function toHTML ( array $ embed , bool $ inlineStyle = false ) : string { static $ css_done ; $ css = '' ; // use object dimension as dimension reference $ d = & $ embed [ 'dimension' ] ; // link to the stylesheet on first run if ( $ inlineStyle && ! isset ( $ css_done ) ) { $ css = '<style>' . Theme :: style ( ) . '</style>' ; $ css_done = true ; } ob_start ( ) ; include __DIR__ . '/Theme/theme.tpl.php' ; $ codeblock = ob_get_contents ( ) ; ob_end_clean ( ) ; return preg_replace ( '/[\t ]*[\r\n]+[\t ]*/' , ' ' , $ css . $ codeblock ) ; }
Theme the given embed information array into HTML string

@param array   $embed       Embed information produced by
Core::translate function.
@param boolean $inlineStyle Whether the returned string should include default
stylesheet. Default to be false.

@return string
Theme the given embed information array into HTML string