monome / docs

monome.org/docs

Home Page:https://monome.org/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code isn't syntax highlighted - thoughts on embedded Github gists?

mwilliams opened this issue · comments

Just got my DIY Norns (assembled quickly and works flawlessly by the way, fantastic kit!) as I started going through the studies. I noticed a missing space on line 16 of the many tomorrow code sample from https://monome.org/docs/norns/study-1/:

octave =1

Wanted to fix it quickly but requiring a pull request approval etc etc and presumably a re-deployment of the website for a 1 space fix is a lot of work (and it's just aesthetics, the code is still functional). Would Monome be up for using embedded Github gists (<script src="https://gist.github.com/mwilliams/79fa4fe7835755d291c739582fc15ca8.js"></script> for example which would render out on the Studies page a very nice code sample) for all the code samples? People could fork them if they wanted (the more complex ones), you get syntax color highlighting for free, along with line numbers etc etc. Seems like there's a lot of upside. And if you need to fix any code examples, you just need to update the Gist and not the entire website.

I'd be up for potentially porting over all of the Norns code samples as I go through its Studies, is this an effort that's worthwhile and would be welcomed?

hi matt! glad the kit worked so easily.

we have the repo set up so it auto-redeploys with each new merge--- since the docs are hosted on github pages. i know it's a hassle to PR each little fix.

better syntax highlighting would be great--- any ideas how we might get that within the pages framework?

i'd be up for using gists for the big code blocks--- it has the added bonus of being easily downloadable. but i think it'd be pertinent to centralize them to the community repo for group edit-ability--- on quick glance are gists just for personal accounts?

Ah, I definitely over complicated things and the structure of the way things are deployed is great!

With markdown you can simply add the language name after the triple ticks and get instant highlighting.

Example:

-- many tomorrows
-- norns study 1

engine.name = "TestSine"

function init()
  print("the end and the beginning they are the same.")
end

Perhaps as I go through the Norns studies, I’ll update all the Lua code blocks and get PRs up as I move along. As long as the change is welcome, I’ll issue PRs as I go along!

(And hello from the Hudson Valley! Definitely not the most active Norns user here!)

i'm wondering if our jekyll theme properly supports syntax highlighting. the studies predate the move to gh-pages--- previously we hosted our own server. i'll do a quick test.


indeed we need to have a upstate gathering someday. bunch of us are nearby!

sadly something is either up with the jekyll plugin or stylesheet

7f678a9

i don't have bandwidth for this immediately, hopefully someone can jump in

Not sure if something changed with the gh-pages options but this does appear to be working now for the code blocks that have the lua tag, which is a fair number of them. Most of the rest are in #260.

image