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

Embedding external resources (CSS, JS) by default #925

Closed
darkdragon-001 opened this issue May 4, 2020 · 8 comments
Closed

Embedding external resources (CSS, JS) by default #925

darkdragon-001 opened this issue May 4, 2020 · 8 comments
Labels
S: wontfix The issue will not be fixed for the stated reasons.

Comments

@darkdragon-001
Copy link

darkdragon-001 commented May 4, 2020

I suggest embedding external resources needed for the extension to work to be automatically embedded by default. Add an option to disable it in case that the user wants to embed it himself. See markdown-katex for an example on how I suggest it to work.

This would also avoid many issues posted by users who are confused at first why this extension is not working:

@gir-bot gir-bot added the S: triage Issue needs triage. label May 4, 2020
@facelessuser
Copy link
Owner

Styles vary from site to site. Python Markdown does not render a full HTML, simply the partial with the content. Both styles and scripts should be managed by the user not the extensions.

@gir-bot remove S: triage
@gir-bot add S: wontfix

@gir-bot gir-bot added S: wontfix The issue will not be fixed for the stated reasons. and removed S: triage Issue needs triage. labels May 4, 2020
@darkdragon-001
Copy link
Author

darkdragon-001 commented May 4, 2020

In my case, the user has only control over which plugins to load, not to configure them. So these plugins just don't work. Providing a default often makes sense. In case the user want to customize it, one should be able to deactivate it with an option or simply overwrite the few parts which need modification. Most people probably just copy your examples from the docs anyway...

@facelessuser
Copy link
Owner

None of the extensions, in either the default extensions or this extension pack provide any styling or scripts. On rate occasion they provide some inline styling through style attributes, but generally styling and scripting are done by the user. You should set up your environment accordingly.

I will not manage versions of MathJax and user configs for such libraries or general subjective styling requests. Users should be responsible for setting up their environment the way they like it. I provide general examples and users should do as they like.

@facelessuser
Copy link
Owner

Again, your environment can inject styles as needed, but these extensions will not. You can provide defaults with your own extension if you desire, but no styling is provided by any if these on purpose. That should be in your HTML template in which the HTML partial are inserted in.

@darkdragon-001
Copy link
Author

darkdragon-001 commented May 4, 2020

For me it's a preview. I don't care how it looks, it just has to work. Further, it's shipped as an extension to another product (gedit text editor in my case), so the end-user usually doesn't even know what python-markdown or even HTML/CSS/JS is. Further, 3rd-party extensions like yours are not enabled by default. Enabling them should just be as easy as adding the extension name to the config. This way, they can look at your awesome documentation, think Oh this extension looks nice! I want it! and then add the extension name to the config.

My template looks like this:

<head>
  <link href="https://sindresorhus.com/github-markdown-css/github-markdown.css" rel="stylesheet"></link>
</head>
<body class="markdown-body">
%s
</body>

I cannot provide styling for all possible python-markdown extensions available in the internet. Sad that many of your great plugins unfortunately are no options because of the lack of skills for many of my users 😞

@facelessuser
Copy link
Owner

I give example CSS that can generally be copied and pasted. You can copy that into a style block to get the behavior you desire. Some tweaking may be required.

When I started these extensions I had limited HTML, CSS, and JavaScript knowledge. I am not a web developer, but often with programming, you have to dig into unfamiliar areas and learn a bit more along the way.

You can join the discord channel and ask general questions as you dig into this further, as I have time I can answer. If you find that some of the example CSS needs improvements, I can help improve that.

@darkdragon-001
Copy link
Author

darkdragon-001 commented May 4, 2020

The hurdle is just very high - especially when you never programmed before. Most people just don't use it because it is nice to have but not a requirement. Same for me: I enabled all your extensions, tried them with the first example and removed the ones which didn't work.

Based on the issues I linked, other people also expect things to behave like this.

And starting from a working default is a lot easier than starting with something which is not working and you have to figure out why.

@facelessuser
Copy link
Owner

If there is a problem with the examples, you can ask questions and we can help. I am open to helping people work through the examples I've given and improve documentation if necessary. If you are having a specific issue, you can post questions. But this is the way it has been for years, and many projects have used it just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: wontfix The issue will not be fixed for the stated reasons.
Projects
None yet
Development

No branches or pull requests

3 participants