Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It works with pretty much any markup, doesn’t depend on any framework and has automatic language detection.
Project on Github
Assume that you installed our blogging module called 'SunBlogNuke'
Built blog instance with offical guideline and enter Dashboadr/Customize/Style Editor section.
From the right section, you should be able choose any theme view to be apply with Highlight.js. For example, the BasicView.ascx is for every item of the default post list when first loading blog page.
choose it and copy the following coding below to register Highlight.js into this view:
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %> <dnn:DnnJsInclude runat="server" ID="jshighlight" FilePath="~/DesktopModules/SunBlog/libs/highlight/highlight.pack.js" Priority="100" />
yes, you feel free to replace CDN-hosted package, like that:
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %> <dnn:DnnJsInclude runat="server" ID="jshighlight" FilePath="http://cdn.bootcss.com/highlight.js/9.5.0/highlight.min.js" Priority="100" />`</pre>
click "save chanegs".
Click the customized.js to add any javascript, now we want to init Highlight.js to make it work:
jQuery(document).ready(function () { if (typeof hljs=== 'undefined'){} else hljs.initHighlightingOnLoad(); });
In the last, just make sure that you also register Highlight.js style, there is lots of way to complete, such as in the dnn skin or module style or dnn blog theme style. The core simplicity theme includes Highlight.js style in default, you may have a try.
BTW, the current post is exactly written by Markdown and live demo for this JavaScript syntax highlighter :)
Senior developer for dnn solution & founder of ultimate dnn blog module - SunBlogNuke, which is the best publishing tool for DotNetNuke (DNN) websites, with a focus on simplicity, ease of extensibility, web standards and usability. It includes a great suite of modules for blogging on your DNN site.
Re: DNN7 Blog Integrated with ModuleSearchBase
B- please FIX the bugs...driving me nuts!!!! Error: Edit blog entry is currently unavailable. DotNet...
-- kkuhns
Re: Fighting DNN Bugs Ⅱ: Why Can't Remove Google Analytics
Thanks a lot for your reference and it should be helpful for community guys. :)
-- Baldwin
please ensure you log any bugs to http://support.dnnsoftware.com - i searched and couldnt see this one...
-- Cathal
Re: Build DNN Rotator with GalleryPlus
How do you place the gallery within a blog entry. I saw in the below demo that a token was used ([SL...
-- Mary
Re: Enhance DNN Article Footers with Author Profiles
Please make sure that the bio field of this current host user is visual to public(you should find it...
I'm trying to get the bio to show up for a host user but it comes up blank. Can you replicate this issue...
-- Lucas
Re: [Kudos]DotNetNuke Blog Module In Depth Review
Yes, the latest package is absolutely compatible well with DNN7 and the performance was enhanced a lot...
Is it compatible with DNN 7
-- swayam
Re: SunBlogNuke 6.0 Technology Preview
No, actually the v6.0 had been available to downlaod for upgrade - http://www.sunblognuke.com/blog/entryid...
this article says that version 6.0 is not for production use. the article is from may 2013... is sun...
-- pekai
The opinions expressed here in are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2009 - 2024