rouge-ruby / rouge

A pure Ruby code highlighter that is compatible with Pygments
https://rouge.jneen.net/
Other
3.32k stars 731 forks source link

Tab indentation width #1823

Closed konsolebox closed 1 year ago

konsolebox commented 2 years ago

Hello, is there a way to customize the displayed width of tabs to 4 spaces? If not, where is the best place to add the custom behavior?

tancnle commented 2 years ago

@konsolebox Sorry I don't really get the context of your question 🙏🏼 Could you elaborate a bit more?

konsolebox commented 2 years ago

Thanks for the reply. I utilize Jekyll to generate pages with highlighting enabled. Tabs in highlighted code become displayed in browsers with a width of 8 spaces but I want to reduce it to 4, like having a .editorconfig with indent_size = 4 in a github repository so code with tabs are rendered in 4-spaced indents.

I can write a Jekyll plugin which extends Rouge if Rouge doesn't have this feature yet but I'll need basic directions.

konsolebox commented 1 year ago

It turns out Github simply uses tab-size. It's pretty odd how I missed it. I'll just close this.