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

Missing code and/or documentation when using custom layout #49

Open
AustinGil opened this issue Jan 16, 2022 · 2 comments
Open

Missing code and/or documentation when using custom layout #49

AustinGil opened this issue Jan 16, 2022 · 2 comments

Comments

@AustinGil
Copy link

Something in a recent version changed and broke how the custom layouts work. I've found the problem and wanted to document the solution here:

First, one of the critical steps for prismjs to work is to have a .language- class present on the page. In the default layout, there is .language.vue. When providing a custom layout, I think the editor slot should have that, but it does not. So the solution I found is to wrap the editor slot with a div with the class language-vue. This allows prismjs styles to be applied.

Secondly, it looks like the inclusion of critical assets has been changed. The prism theme and prism editor CSS are no longer included by default when you provide a custom layout. I looked at the default layout Vue file to find my solution which was to include those assets in my custom layout

<script>
import "prismjs/themes/prism-okaidia.css";
import "vue-prism-editor/dist/prismeditor.min.css";
</script>

If I get the chance, I'll see about opening a PR for this. In the meantime, I wanted to document these issues here in case others run into them and need a solution.

For the fix, does it make more sense to fix the issue in the code, or was this a deliberate design? If so, then I can just add more documentation around it.

@elevatebart
Copy link
Member

Thank you Austin for the report.

Did you check what version made that change?

PS: I am happy to see you are still using vue-live. I have left it alone for way too long. Working on fixing that.

@AustinGil
Copy link
Author

Yeah, well it's gotten me this far :)

I hope you dont feel any pressure for my sake to work on this. I just worked through it and thought it'd be good to document it.

I'm sorry, but I'm not sure what version broke. It was a long time since I had upgraded.

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