How to create a pretty Julia post on Blogger.com

I want to create a few posts about my success stories w/ Julia on www.blogger.com.
I’m having some trouble with:

  1. writing math
    I can get display mode to work, but inline mode does not
  2. Julia code boxes

Has anyone here had success making pretty blog posts w/ both math & Julia code snips on www.blogger.com or elsewhere?
Can you please point me to good source?

2 Likes

I found this: Make your Julia package in 10 minutes · Zlatan's Journal
it has both pretty math (inline mode) & Julia code boxes.
It ain’t on Blogger unfortunately…

1 Like

Yea his site was made with Franklin.jl which is definitely a good option for setting up your own site if you want math and code to display nicely.

Any reason it must be on Blogger? I’d imagine they could be less full-featured in these areas but I wouldn’t know for sure.

2 Likes

I already created a website & I ended up not using Franklin: Research - Home
I feel like it’d be easier to share on social media w/ a link to Blogger…

Quick peek looks like you are using Jekyll. There should definitely be good support for LaTeX display on Jekyll. Google turned up this jekyll - How to support latex in GitHub-pages? - Stack Overflow

I’d bet there is good code display as well, but not sure about correct syntax highlighting. I know it has been pushed to the wild because the team was trying to get StackOverflow to have it, but not sure what the status is.

But! I’ll just throw out there that I think about half of the people blogging about Julia are doing so on Franklin.jl sites :wink:

2 Likes

I think I’m gonna end up making the post on my own website.
https://azev77.github.io/Simpson_OVB.html

Does anyone know how to make Julia code blocks in HTML?
My current code blocks are ugly w/o syntax highlighting …
@tlienart

What about weave.jl and publishing to html?

2 Likes

I’ve been making stats notes using weave.jl and saving output as .tex to play around in LaTeX and make nice pdfs. Sure you could do the same and convert to html with pandoc. Or just publish straight to html if that’s easier for you.

1 Like

You can use highlight.js for instance it has good Julia highlighting :slight_smile:

1 Like

Guys, sorry I know almost nothing about making websites.
Can someone please show me sample html code for Julia code box?

In that case the Weave.jl suggestion above is probably the best because you’ll get stand-alone HTML pages that you could link to and won’t need to deal with Javascript and CSS stuff.

2 Likes

I don’t even know how to use weave.jl, I used a template powered by Jekyll & Academic pages.
I tried using Franklin.jl but wasn’t getting much action so the template looked like the path of least resistance…

<head>
...
<link rel="stylesheet" href="YYY/github.min.css">
...
</head>
<body>
...
<pre><code class="language-julia">
THE CODE HERE
</code></pre>
...
<script src="XXX/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();hljs.configure({tabReplace: '    '});</script>
</body>

where you would have to appropriately fill XXX and YYY. You could also use another stylesheet than GitHub; if you download the stuff from highlight.js you will see how to pick other stylesheets.

If this still seems too obscure, I’d reiterate what others have said before; generators try to make this stuff easier for you for a reason :slight_smile:

Maybe you will be interested in my research homepage hosted by Jekyll: it both math and Julia intensive. The source code is here: GitHub - liuyxpp/liuyxpp.github.io: Homepage for my research group as an example of LYX Jekyll Theme.. And the page online is here: http://www.yxliu.group/

3 Likes

Perhaps you are interested in blogging in Hugo, the static site generator noted for its build speed. I wrote a template github repo to blog Markdown and syntax highlighting as well as KaTeX math. GitHub and Gitlab CI/CD are included to automatic build / publish upon pushing changes.

I’m (very) far from an expert. But saving the following as a julia markdown file example.jmd

# Here is my website

I'm going to use **LaTex** and **Julia**.


### Here's some maths

$ f(x,y) = x^{x} + \frac{y}{x} $

### And some code

```julia

f(x,y) = x^x + y/x

f(2,3)```

And running weave(example.jmd)

produces

1 Like

I ended up doing it in markdown:

Not ideal, but good enough…

1 Like