-
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
Add #name to renderers #377
Conversation
Shouldn't the name for AsciiDoc files be "asciidoc" instead of "asciidoctor" to follow the pattern? |
I think asciidoctor makes sense, with analogy to textile/redcloth. |
I had the same question myself. Initially I wrote it to be the name of the format. The original motivation in #374 is for a name to use in cache keys. In that case, I think it makes sense to use the name of the library instead of the format. |
I can see arguments in either direction. Given the currently proposed API ( @bkeepers Are there any renderers that handle multiple languages currently? If so then returning language names would probably be better. This is all a bit hypothetical, but say you had a renderer that handles both Markdown and Textile documents. If we put the renderer's name (not the document's language) in the cache key, we wouldn't re-render when you renamed a file from |
Nope. They might handle multiple file extensions, but their behavior doesn't change if the file extension changes (e.g. |
@@ -44,6 +44,10 @@ def render(content) | |||
@renderer.call(content) | |||
end | |||
|
|||
def name | |||
"markdown" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should return the name of the gem that will be used for rendering? Presumably the different gems produce different rendering for at least some documents.
@aroben is this still needed? |
It would still be useful to have. We have a workaround for it currently as described in #374. The situation hasn't changed since I filed that issue. |
* origin/master: (57 commits) tweaks Call out CSS issues Fix link to linguist Release 1.3.3 The command is POSIX, not Posix Release 1.3.2 Spruce up old tests Add empty `a` to support contents with sectnums Add comments to describe these calls No longer true Restore "test" as the default rake task point to other places before creating issues Extconf hack no longer necessary Don't test jdk7 Fallback on open3 if posix-spawn is unavailable. Define CommandImplementation#execute conditional on presence of Posix::Spawn Get html_equal tests running with minitest Updated deprecated .exists? in markup.rb Added the link to Pod::Simple on CPAN. Fix pod output ... Conflicts: lib/github/markup.rb test/markup_test.rb
Closes #374
From the tests:
/cc @aroben @github/user-content