loikein / hugo-tufte

Content centric Hugo blogging theme styled with Tufte-CSS
https://hugo-tufte.netlify.app
MIT License
59 stars 14 forks source link

Code highlighting #17

Open aiden-huffman opened 3 months ago

aiden-huffman commented 3 months ago

Is your feature request related to a problem? Please describe. Code highlighting isn't enabled and makes more complicated blocks of code difficult to read

Describe the solution you'd like It would be great to come up with a nice way to implement code highlighting which is still "Tufte" at heart.

Describe alternatives you've considered

A small modification to code-highlight.scss makes this possible, in conjunction with changes to the configuration yaml

markup:
  highlight:
      anchorLineNos: true
      codeFences: true
      guessSyntax: false
      hl_Lines: ""
      hl_inline: false
      lineAnchors: ""
      lineNoStart: 1
      lineNos: false
      lineNumbersInTable: true
      noClasses: true
      noHl: false
      style: catppuccin-latte
      tabWidth: 4
#code-highlight.scss
    width: 50%;
    overflow-x: scroll;
    // border-radius: $ht-code-border-radius;
    margin-top: 1.4em;
    margin-bottom: 1.4em;
    margin-right: 1%;
    margin-left: 1%;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-left: 1%;
    padding-right: 1%;
    box-shadow: 1px 1px 5px;
    border-radius: $ht-code-border-radius !important;
    background-color: #eff1f5;

Additional context Obviously this would be better if it wasn't theme dependent. I know next to nothing about scss however.