Skip to content
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

Support the Markdown extension for Quotebacks #3460

Conversation

devilgate
Copy link
Contributor

Pull Request Checklist

  • I’ve read the guidelines for contributing.
  • I updated AUTHORS.txt and CHANGES.txt (if the change is non-trivial) and documentation (if applicable).
  • I tested my changes.

Description

Quotebacks is a recently-developed JavaScript library for applying a standard styling to blockquotes on web pages. As released, it also includes a browser plugin for Chrome, that helps with capturing the quotes and applying the correct HTML.

However, if you don't use Chrome, and/or you prefer to write in Markdown, it's not ideal.

Luckily Matt Webb has written an extension for Python-Markdown which allows the writer to activate the Quotebacks styling using simple Markdown.

This change incorporates that extension into Nikola.

To use it you'll have to have the quotebacks.js file installed, and have suitable code in your template to ensure that it's referenced in posts. Or just suitable code to import it from the CDN.

@Kwpolska
Copy link
Member

I don’t think this should be built into Nikola, especially in a partially functional form — and I don’t think we should add this to default themes. Please make this an independent plugin and make a PR against getnikola/plugins.

@Kwpolska Kwpolska closed this Sep 16, 2020
@devilgate
Copy link
Contributor Author

While I take your point, it raises two questions for me:

  1. Can one make a plugin that installs a .py file into a particular directory, as is needed here? And if so, how?
  2. Do you think it might be better not to instantly close a PR like this one? Instead, maybe leave it open for a day or two, to give other people a chance to see it and possibly comment? Opinions might differ.

@Kwpolska
Copy link
Member

  1. It’s not needed. If the plugin is correctly categorized (subclass of MarkdownExtension + compiler=markdown in .plugin), Nikola should load it from site/plugins just fine. If it does not, report a bug or make a PR to fix this (but there is
  2. If you want to discuss a new feature for Nikola core, please create an issue. As a maintainer, I decided to reject this PR, because new plugins in core are not something that should be added without significant benefits to users. I believe that maintainers should have the right to make decisions about the future path of the project, even if some people do not agree with them, especially if those changes would add more work for the maintainers.

To properly implement Quotebacks in core, you would need to:

  1. Add it to the default templates and npm_assets
  2. But since not everyone wants it, would that require adding a new config setting, or a dynamic template variable like “page_uses_quotebacks”?
  3. And wouldn’t it be better as a general thing, like a shortcode, or at least a similar reST extension?

There are too many questions, drawbacks, added maintenance and requirements for adding this. Because of this, I decided to reject this pull request. As I mentioned before, feel free to open a PR against getnikola/plugins, where none of the issues apply, and which is the correct place for extra functionality that may interest some users (but not a majority of them).

Does this mean that Nikola core won’t get any new features? No. But features in core must be useful for a large group of users, without breaking existing sites (what if someone is using this quoting style on their site — it’s not that uncommon, and now they get some fancy HTML, and possibly a third-party library if steps 1/2/3 were implemented — and now the quotes look weird?), and the more maintenance work they require, the more “useful” it should be to users. And yes, this can be subjective metric, but Quotebacks does not meet it IMO.

Also, while Quotebacks doesn’t seem to depend on an external service (and in fact, seems to just add some fancy CSS? Why would you need JS for this? and I’m not the only one wondering what it even does), but if it was, what if the service closed down? We already went through this with annotations, which just closed down one day and we had to live with a mostly blank annotations_helper.tmpl, which is also why I would prefer not to introduce a new third-party thing.

@devilgate
Copy link
Contributor Author

Thanks for that, Chris, and sorry for causing problems. When I suggested keeping this open for discussion, I was forgetting that it is a pull request, not an issue. Of course I should have opened an issue first.

Regarding what Quotebacks are and why people would use them: I was confused myself at first, and I'm still not totally convinced about them. But I think the idea is to have a common form for blockquotes that might become as commonplace and recognisable as embedded tweets. And using a JS library when you could just do it with CSS? Dropping a library in is just easier than hacking around with CSS, I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants