How to display ELM code snippets in a WordPress blog? - wordpress

I'm looking for a WordPress Plugin, or any other way to display ELM code in my blog. I tried to use Crayon, but since it has no special support for elm, the code is colored wrong.
How can I do so?

This https://runelm.io/new provides a way to embed runnable snippets of Elm code on an Elm website. I don't know how easy to do this is because I haven't tested it but the example they give looks promising.

Related

Use a bootstrap theme with blogdown

I currently have a website which was created using the rmarkdown default site generator. I used a bootstrap theme and I like the look of it and I am familiar with it. I am wanting to change the site over to a blogdown website, but do not want to change the look. I know it is possible to use a bootstrap theme with blogdown/hugo, but I have not found very much information on how this can be done. I am very new to website development, so my understanding is very basic. I do know that there is not just a simple answer to this. I am more looking for suggestions for how I should go about this, or resources that I might be able to use in order to accomplish this goal. If you are interested in seeing the site it is https://jamescuster.github.io/
To anybody that is interested in this, I found this blog post which helps turn any existing static website to hugo. I haven't completely gotten it all figured out, but it seems to working well so far and with a little tweaking I think I will be able to turn the bootstrap theme into a hugo theme.
I would still be interested to hear additional solutions.

Where to create gutenberg block

This Gutenberg update looks sweet, but it's immediately frustrating trying to follow any of the documentation.
I started with the very simple looking tutorial that is the first result on Google. It has code that looks to make sense for what I'm trying to do here. Great.
Except it says nothing about where to put this code to make it work.
Other tutorials are all about "download our plugin and we'll create one for you" - but I don't want to add that huge nest of code when what I'm really looking for is a fairly simple static block of code I can have users drop into a page.
Back in the day we'd just register a short code in the functions.php file and call it a day.
Can someone explain to me:
Where to put this registration code?
Where to put this JS code it references?
If I'm somehow going about this with a huge misunderstanding of how Gutenberg works?
Thanks
To actually solve this properly would need a couple of chapters of a book... but here's the very condensed answer.
Taking a very quick look at the link you shared, the code should be put in a plugin as there are calls to the function plugins_url(). So you need to first create a plugin. It's not difficult to build a simple plugin but it does take a bit of time getting used to how things need to be registered and how everything is glued together (that's why I said that a proper answer would take a couple of chapters of a book :D).
Once you have the plugin, the code should be within the plugin (or in any PHP file that is included by the plugin) and the JS file should go inside the plugin directory in a folder called step-01
There's a git repo from WordPress with some Gutenberg examples. I haven't looked to hard at them, but It might be a good idea to follow the code in there with the tutorial of how to build a plugin (and the WordPress code reference site opened too :D). If you are going to be developing things for WP, I recommend you to get Zeal or Dash to be able to browse the documentation in an easy and fast way.
Edit
I just found that you can create the scaffolding with wp cli. Wordpress has a tutorial on how to use the wp scaffold block command here.

How do you write code on wordpress?

I have just started experimenting with WordPress, but I have not been able to figure out how to write any code whatsoever. All it gives me is built in blog stuff, and I don't want that. How do I write code on WordPress?
Well, what do you want to achieve?
Are you trying to write code that performs a function that the WordPress core doesn't provide? If so, then you should start by reading Writing a Plugin.
If however you'd like to design your own look and feel, then you'd need to create a theme. The best way to do this would be to write a child theme. Start by reading about Child Themes.

Formatting Java code in WordPress posts, like in Eclipse

I am about to write some posts which has some Java code, and I would like to format it properly by coloring the Java keywords. Like in Eclipse.
I am looking for some recommendation for a theme / plugin to use.
It looks like it's rather standard nowadays:
[code language="css"]
Your code here
[/code]
As described here by WordPress itself.
The Chili code formatter is a good WordPress plugin to do that.
Alternative link: WP Chili
You could have some other plugins with this page or this other one.
However, it has not been updated for since 2010. Maybe you should use much recent one like the WP Code plugin.
It seems new versions of WordPress have already included the support of code posting. It is very interesting for me too, LOL.

how to show code snippet on ASP.NET page with color formatting

I want to show code in asp.net page , how to show code snippet that it will look in same colors as it looks in visual studio , best examlple i can give is this stackoverflow.com itself we can put code fragment in our question which looks well colored giving better user exprience
i have just no clue ? also how to store code snippets when user enters them ?
You probably want to start with Google Prettify which is the same code coloring tool used here on Stack Overflow.
StackOverflow uses Prettify for syntax highlighting.
What do you mean by how to store code snippets? You might want to post that as a separate question with a little more detail.
The solution you're looking for is called syntax highlighting.
Prettify is a popular one, but I've used SyntaxHighlighter before and it is quite nice.
SyntaxHighlighter helps developers to
display code on their website.
Also, Syntax Highlighter recently added a hosted syntax highlighter "service."
About Syntax Highlighter
Hosted Version of Syntax Highlighter
Extra: Shanselman Speaks on Syntax Highlighting

Resources