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

Author's Guide: Switch to Highlight #51

Closed
tajmone opened this issue Aug 13, 2019 · 3 comments
Closed

Author's Guide: Switch to Highlight #51

tajmone opened this issue Aug 13, 2019 · 3 comments
Assignees
Labels
📖 Author's Guide Issue relating to "The Alan Author's Guide" 🕑 pending decision Issue requires decisions by one or more maintainers 👑 HTML Format Issues with conversion to HTML format 🔨 Highlight Tool: Highlight (syntax highlighter) ⭐ syntax highlighting Topic: Syntax Highlighting

Comments

@tajmone
Copy link
Collaborator

tajmone commented Aug 13, 2019

Currently the are no impediments for not using Highlight for the Alan Author's Guide, for it doesn't it uses callouts anywhere (these being what prevents using Highlight with Asciidoctor — See #36 on this).

So, since this book is still in the making, the question really boils down to whether we are planning to use callouts or not in it! Callouts are indeed a cool feature, especially in these type of documents which contain lots of code examples, for they introduce a nice notes-like system for source code.

Eventually, the Highlight extension will support callouts, but right now it doesn't. Should we just keep using Highlight.js, and enjoy callouts? Or should we rather switch to Highlight and postpone using callouts in the book until they are supported?

It's a matter of choosing which one should get the priority: the highlighter toolchain or the callouts feature?

Since this is Thomas's book, the choise belongs to him really...

IMPORTANT! — See also proposal #107 to switch to Rouge instead!

@tajmone tajmone added 👑 HTML Format Issues with conversion to HTML format ⭐ syntax highlighting Topic: Syntax Highlighting 🔨 Highlight Tool: Highlight (syntax highlighter) 📖 Author's Guide Issue relating to "The Alan Author's Guide" labels Aug 13, 2019
@tajmone tajmone added this to the Highlight Integration milestone Aug 13, 2019
@tajmone tajmone added this to To do in HTML Backend via automation Aug 13, 2019
@tajmone tajmone mentioned this issue Aug 13, 2019
3 tasks
@tajmone tajmone added the 🕑 pending decision Issue requires decisions by one or more maintainers label Aug 13, 2019
@thoni56
Copy link
Contributor

thoni56 commented Aug 13, 2019

So, what are the drawbacks of using Highlight.js? From your comments I presume there are some.

@tajmone
Copy link
Collaborator Author

tajmone commented Aug 14, 2019

So, what are the drawbacks of using Highlight.js?

I prefer Highlight for various reasons, the main one being that syntax highlighting is done during the conversion stage, so no JavaScript is actually needed in the final document.

There are means to achieve this also with highlight.js, but it involves additional Asciidoctor extensions and using the Node.js version of Asciidoctor instead of Ruby.

Also, the Alan syntax for Highlight is more polished and I find it easier to work with Highlight syntaxes in general.

Last but not least, Highlight supports many other output formats beside HTML, so it might be useful for other ebook types too.

But, at the end of the day, both highlighters do their job well, but I'd prefer to use only one to avoid having to maintain multiple stylesheets in Sass. Right now the Beginner's Guide is the only document using Highlight, so in a way I've already placed my self in the double-standard situation.

If only I managed to write that Asciidoctor extension for Highlight, using the new API, then Highlight would support call-outs too. I really like call-outs, and the thought of having to do without them really annoys me. But my knowledge of Ruby is too weak for that task, for I can't figure out how to interface to the Asciidoctor API, even after having gone through the code multiple times.

@tajmone
Copy link
Collaborator Author

tajmone commented Jul 30, 2021

Rouge Unsupported!

Unfortunately, this document will also have to use Highlight instead of Rouge, because it uses highlight marking inside code blocks, which is currently not supported with Rouge.

This means you won't be able to use callouts (not in highlighted code blocks, at least).

I've added thin info in its README, an tweaked the build script to use Highlight instead of highlight.js.

HTML Backend automation moved this from To do to Done Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 Author's Guide Issue relating to "The Alan Author's Guide" 🕑 pending decision Issue requires decisions by one or more maintainers 👑 HTML Format Issues with conversion to HTML format 🔨 Highlight Tool: Highlight (syntax highlighter) ⭐ syntax highlighting Topic: Syntax Highlighting
Projects
HTML Backend
  
Done
Development

No branches or pull requests

2 participants