dlang / D-Blog-Theme

WordPress theme for dlang.org/blog
3 stars 3 forks source link

D syntax highlighting for code snippets #12

Closed wilzbach closed 8 years ago

wilzbach commented 8 years ago

Afaik highlightjs, and prism support D via plug-ins. There is probably no need to load a full-blown editor for code snippets?

mdparker commented 8 years ago

It's not a full-blown editor. It's a plugin with several options, several themes, easy to configure, easy to use in the post editor and, more importantly, has no external dependencies. I use it on one of my other posts and love it. Iv'e got all of the fancy options turned off, but I love the line numbers.

wilzbach commented 8 years ago

It's not a full-blown editor. It's a plugin with several options, several themes, easy to configure, easy to use in the post editor and, more importantly, has no external dependencies.

Are you sure? Afaict it's uses the ACE editor:

image

I don't know anything about WP, but is there an easy way to at least turn syntax highlighting for D on?

mdparker commented 8 years ago

Well, that must be what they're using for integration with the admin interface. It's really easy to use there. I didn't realize they were using it for display, too. But it works. Must be why there are no external dependencies.

The only way to syntax highlight any code is with a plugin.

wilzbach commented 8 years ago

The only way to syntax highlight any code is with a plugin.

That sucks :/ @JackStouffer I have never used WordPress before. Is there a way around loading 340kB of JS on the frontend pages? It seems a bit wasted if no code (on most pages) or only highlighting is needed. Also e.g. Highlight.js which does support D syntax only has 10% of the size.

mdparker commented 8 years ago

I don't intend to drop the plugin. I'm quite happy with it, so I'm going to close this. If the file size becomes a problem, then I'll reconsider.