public function yamlParse($text)
    {
        if (function_exists("yaml_parse")) {
            // Prefer php5-yaml extension
            $parsed = yaml_parse($text);

            if ($parsed === false) {
                throw new Exception("Failed parsing YAML frontmatter.");
            }

            return $parsed;
        }

        if (method_exists("Symfony\Component\Yaml\Yaml", "parse")) {
            // symfony/yaml
            $parsed = \Symfony\Component\Yaml\Yaml::parse($text);
            return $parsed;
        }

        if (function_exists("spyc_load")) {
            // mustangostang/spyc
            $parsed = spyc_load($text);
            return $parsed;
        }

        throw new Exception("Could not find support for YAML.");
    }