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

Chroma doesn't output highlighting in a table #3915

Closed
mckern opened this issue Sep 27, 2017 · 9 comments · Fixed by #3964
Closed

Chroma doesn't output highlighting in a table #3915

mckern opened this issue Sep 27, 2017 · 9 comments · Fixed by #3964

Comments

@mckern
Copy link

mckern commented Sep 27, 2017

I've been using the highlighting shortcode (eg {{< highlight ini "linenos=table" >}}) to output line numbers into one column and code into another, so I can style numbers separately. Is this feature gone forever unless I fallback to Pygments?

@moorereason
Copy link
Contributor

I don't know that it's "gone forever", but it's not supported currently. Keep in mind that Chroma is brand new, as in, 4 months old. I think the Hugo team only heard about it a few weeks ago. Give Alec and the community time to add features, and we'll see how this plays out.

@moorereason
Copy link
Contributor

@mckern, please see Alec's comment: alecthomas/chroma#45 (comment).

@moorereason
Copy link
Contributor

@mckern, if you set pygmentsUseClasses = true in your site config, you should get something like this that you can style:

<div class="highlight"><pre class="chroma"><code class="language-text" data-lang="text"><span class="ln">1</span>interface Tunnel0
<span class="ln">2</span>description GRE tunnel to other location
<span class="ln">3</span>ip address 192.168.254.1 255.255.255.252
<span class="ln">4</span>tunnel source FastEthernet0/0
<span class="ln">5</span>tunnel destination 172.31.254.1
<span class="ln">6</span>crypto map tunnel-ipsec-map</code></pre>
</div>

@mckern
Copy link
Author

mckern commented Sep 27, 2017

Thank you for the suggestion. I tried that but it doesn't work for what I specifically want. Here's an example of what I'm doing -- I use the linenos=table the table has the benefit that line numbers are not copied into the buffer if someone copies lines out of a code block. I can keep using Pygments -- the speed isn't a problem for me. But the incompleteness of the Chroma paired with it being the new default (opt-out instead of it being an opt-in) is frustrating.

@moorereason
Copy link
Contributor

@mckern,
Can you use the user-select: none style to accomplish the same thing?

@alecthomas
Copy link

@mckern I do want to add table support, for the exact reason that copy+pasting is much more convenient. It's on The List™.

@bep bep added the Upstream label Sep 27, 2017
@bep
Copy link
Member

bep commented Sep 27, 2017

Also note that I kept the options syntax identical between Chrome and Pygments (for several reasons), but that also means that you should just transparently and eventually "get more".

@bep bep added this to the v0.30 milestone Oct 7, 2017
bep added a commit to bep/hugo that referenced this issue Oct 13, 2017
bep added a commit to bep/hugo that referenced this issue Oct 13, 2017
bep added a commit to bep/hugo that referenced this issue Oct 13, 2017
bep added a commit to bep/hugo that referenced this issue Oct 14, 2017
bep added a commit to bep/hugo that referenced this issue Oct 14, 2017
bep added a commit to bep/hugo that referenced this issue Oct 14, 2017
bep added a commit to bep/hugo that referenced this issue Oct 14, 2017
@bep bep closed this as completed in #3964 Oct 14, 2017
bep added a commit that referenced this issue Oct 14, 2017
@mckern
Copy link
Author

mckern commented Oct 17, 2017

Hey, just chiming in to say thanks for this. The constant iteration and improvement on Hugo is so impressive, and turning around something like this in less than a month? It's amazing. Thanks again.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants