Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting is broken #279

Closed
vindarel opened this issue Oct 17, 2019 · 15 comments
Closed

Syntax highlighting is broken #279

vindarel opened this issue Oct 17, 2019 · 15 comments

Comments

@vindarel
Copy link
Contributor

Hello guys,

The syntax highlighting is broken. It worked today on my out-of-date gh-pages branch, and it doesn't anymore that I rebased on master.

@pnathan
Copy link
Member

pnathan commented Oct 17, 2019

Not good.

ed: Want me to dig into this? I think we're using a fairly antiquated themeing system, but I havn't dug into it.

@vindarel
Copy link
Contributor Author

Well any idea is welcome. I just tried locally witht jekyll serve and I have syntax highlighting. Same output in the browser console.

@sheepduke
Copy link
Collaborator

I tested the latest master branch (4a8e828) on my machine with the following command:

bundle update
bundle exec jekyll serve

And it does not work.

@sheepduke
Copy link
Collaborator

By the way, just some random thoughts - I am using Hugo for my personal blog. It works well with both Markdown and Org. Yes, I can write Org file which will be rendered properly. And it is much faster.

I am not sure if you are interested with it...

@goranmoomin
Copy link

@sheepduke While I’m also a big fan of org mode (which allows consistent technical documentation easier), the only platform org works is in Emacs. People not using Emacs shouldn’t be a second-class user/contributor.
Markdown has a much universal support.

@sheepduke
Copy link
Collaborator

sheepduke commented Dec 2, 2019 via email

@vindarel
Copy link
Contributor Author

vindarel commented Dec 2, 2019

Referring to the issue itself, it might because of missing highlight.js
file?

Is it missing?? It shouldn't be, it was included before.

thanks for the report.

It's true that Hugo is much faster. I'd be in favor of this change (specially if we improve the look and feel in the process?).

@sheepduke
Copy link
Collaborator

sheepduke commented Dec 3, 2019 via email

@vindarel
Copy link
Contributor Author

I could reproduce and break my local syntax highlighting by updating the gems (I had to delete Gem.lock and google a bit).

Now it seems that the generated HTML changed a bit. Code blocks are:

<pre class="lisp"
  <code>

it's <pre> that gets the class, not <code>.

HighlightLisp wants <code>s:

	this.highlight_auto = function(options)
	{
		options || (options = {});
		var classname = options.className ? options.className : 'lisp';
		var codes = document.getElementsByTagName('code');
		for(var i = 0, n = codes.length; i < n; i++)
		{
			var code = codes[i];
			if(code.className.match(classname))
			{
				this.highlight_element(code);
			}
		}
	},

A couple attempts of mine only messed things worst so far.

It's said that Jekyll supports CL highlighting with "fenced blocks" (aka triple backquotes), but I can't make them work either.

@vindarel
Copy link
Contributor Author

vindarel commented Feb 24, 2020

I pinned Jekyll to 3.6.3, it works locally with bundle exe, but it doesn't when pushed to gh-pages.

It seems that Jekyll 3.6.8 does the syntax highlighting of our code snippets, thus transforming them into inner html nodes, and as a consequence HighlightLisp cannot find strings to replace.

gh-pages don't seem to obey the Gem file. edit no they don't.

I think we have to disable the syntax highlighting, but I didn't find how.
https://jekyllrb.com/docs/configuration/default/

@arademaker
Copy link

Can’t we use another lisp static site generator?

@vindarel
Copy link
Contributor Author

I guess we can.

(https://github.com/coleslaw-org/coleslaw)

@vindarel
Copy link
Contributor Author

@vindarel
Copy link
Contributor Author

fixed by 61180f1

The highlighting is less good than HighlightLisp though.

@vindarel
Copy link
Contributor Author

We're back with the good syntax highlighting.

vindarel added a commit that referenced this issue Feb 26, 2020
for #279

> The page build completed successfully, but returned the following warning for the `gh-pages` branch:

> You are attempting to use the 'none' highlighter, which is currently unsupported on GitHub Pages. Your site will use 'rouge' for highlighting instead. To suppress this warning, change the 'highlighter' value to 'rouge' in your '_config.yml' and ensure the 'pygments' key is unset. For more information, see https://help.github.com/en/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites#fixing-highlighting-errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants