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 · 8 comments

Comments

Projects
None yet
4 participants
@mckern

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

This comment has been minimized.

Show comment
Hide comment
@moorereason

moorereason Sep 27, 2017

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.

Contributor

moorereason commented Sep 27, 2017

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

This comment has been minimized.

Show comment
Hide comment
@moorereason

moorereason Sep 27, 2017

Contributor

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

Contributor

moorereason commented Sep 27, 2017

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

@moorereason

This comment has been minimized.

Show comment
Hide comment
@moorereason

moorereason Sep 27, 2017

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>
Contributor

moorereason commented Sep 27, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@mckern

mckern 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.

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

This comment has been minimized.

Show comment
Hide comment
@moorereason

moorereason Sep 27, 2017

Contributor

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

Contributor

moorereason commented Sep 27, 2017

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

@alecthomas

This comment has been minimized.

Show comment
Hide comment
@alecthomas

alecthomas Sep 27, 2017

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

alecthomas commented Sep 27, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Sep 27, 2017

Member

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".

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 in #3964 Oct 14, 2017

bep added a commit that referenced this issue Oct 14, 2017

@mckern

This comment has been minimized.

Show comment
Hide comment
@mckern

mckern 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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment