-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would like API to determine the language a file will be rendered as #374
Comments
>> GitHub::Markup.renderer("foo.md").class.name
=> "GitHub::Markup::Markdown" Is that sufficient? I've actually been thinking about this lately and wondering if this would make sense to push the render selection into linguist. There's not currently a huge need for it, but PRs like #343 and #252 made me think that this could be a linguist concern. /cc @github/languages |
It'd be a shame to bust github.com's caches just because you decided to refactor your code. (Alternatively, it would be a shame to have to treat your class names as API, since you couldn't change them.) I think something more explicit would be better. |
Fair enough. What about adding >> GitHub::Markup.renderer("foo.md").name
=> "markdown" |
That works! |
It would be nice to have an API like:
This would be useful for including in cache keys on github.com so we can make sure to re-render a file whenever its language changes. Right now we have to use the file's name instead as a proxy for this. But if something changes in GitHub::Markup's language-detection logic the cache won't get busted. Including the actual detected language in the cache key would fix this.
The text was updated successfully, but these errors were encountered: