I wanted to setup a developers blog using Umbraco. The articles in this blog would have code written in various languages, with C#, XML, JSON and Javascript being the main ones.
I would like to know if there were any blog packages that would support formatting & rendering of programming languages as code. Something on the lines of these examples:
I can't provide a definite answer to your question, but if the blog uses the grid content data type, then it shouldn't prove too difficult to adjust to your needs.
The grid provides the built-in ability to apply a css class to a row or a column within the row. the simplest option would be to utilise the built in css class option on a row or column within the row.
So you could then alter the styling or apply a jquery plugin, etc to render the output as desired.
This will provide syntax highlighting on the front end of your website, and you'll just need to follow the particular markup when you write your posts in Umbraco:
<pre><code class="language-css">p { color: red }</code></pre>
I tend to do this by hand on my blog, but sure it would be possible to implement something via a Macro where you picked the language and pasted the code example.
Or there appears to be a TinyMCE plugin that works with Prism...
Programmers/Developers blog using Umbraco
Hi All!!
I wanted to setup a developers blog using Umbraco. The articles in this blog would have code written in various languages, with C#, XML, JSON and Javascript being the main ones.
I would like to know if there were any blog packages that would support formatting & rendering of programming languages as code. Something on the lines of these examples:
https://hassantariqblog.wordpress.com/2017/02/20/asp-net-core-step-by-step-guide-to-access-appsettings-json-in-web-project-and-class-library/
https://blog.elmah.io/appsettings-in-aspnetcore/
https://andrewlock.net/sharing-appsettings-json-configuration-files-between-projects-in-asp-net-core/
Thanks in advance. Noel
Hi Noel
I can't provide a definite answer to your question, but if the blog uses the grid content data type, then it shouldn't prove too difficult to adjust to your needs.
The grid provides the built-in ability to apply a css class to a row or a column within the row. the simplest option would be to utilise the built in css class option on a row or column within the row.
So you could then alter the styling or apply a jquery plugin, etc to render the output as desired.
Hope this helps.
Nigel
Hi Noel
Have a look at prism.js
https://prismjs.com/
This will provide syntax highlighting on the front end of your website, and you'll just need to follow the particular markup when you write your posts in Umbraco:
I tend to do this by hand on my blog, but sure it would be possible to implement something via a Macro where you picked the language and pasted the code example.
Or there appears to be a TinyMCE plugin that works with Prism...
https://www.tiny.cloud/docs/plugins/codesample/
(but I never tried setting it up via /config/tinymce.config)
regards
Marc
Hi Marc,
Thank you very much for your response.
I have had a look at prismjs and found it very easy to integrate into a sample view. As you mentioned, I can always handle the markup manually.
Once again....Thanks for your recommendation.
Regards Noel
is working on a reply...