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

Doc improvement for style selection #35

Open
suterma opened this issue Sep 11, 2022 · 2 comments
Open

Doc improvement for style selection #35

suterma opened this issue Sep 11, 2022 · 2 comments

Comments

@suterma
Copy link

suterma commented Sep 11, 2022

The readme lacks guidance on selecting a CSS. Although it's shown with a code line here https://github.com/highlightjs/vue-plugin#using-the-pre-built-libraries and also somewhere further down, a separate paragraph on this would be helpful, especially for users that directly come to this vue-plugin, and never used the highlight-js package beforehand.

I suggest the paragraph along something like this:


Selecting a style sheet

The underlying highlight.js offers some ready-made stylesheets that can be used with this vue-plugin. Styles can be found in the node module at highlight.js/styles/...

You can import a suitable stylesheet either by directly linking to it (replace the placeholders):

//index.html
<link rel="stylesheet" href="/path/to/styles/default.css">

or, if you are using ES6, you can just import it (replace "default"):

//main.js or main.ts
import 'highlight.js/styles/default.css';
@joshgoebel
Copy link
Member

In reading the README just now I personally feel this (how to pick a theme) is already quite well covered in the two different usage examples.

If this is more about "hey there are lots of themes!" I'm not sure that makes sense to document in every single plugin (rather than in the core Highlight.js docs). Curious to hear others thoughts though.

@suterma
Copy link
Author

suterma commented Sep 11, 2022

Maybe it's just me but I had not immediately figured out where to get and how to actually include the CSS in my Vue app (as a first-time highlight.js user). I assumed that there was some colorful default theme and was initially turned down when I saw the classes there but the code still looked boring. (It's working now and really looking nice!)

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

No branches or pull requests

2 participants