Changeset 66 in code


Ignore:
Timestamp:
May 8, 2023, 9:10:36 PM (2 years ago)
Author:
Izuru Yakumo
Message:

Add support for bfchroma syntax highlighting

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/README.md

    r65 r66  
    1212* Works well for blogs and generic static websites (landing pages etc)
    1313* Easy to learn
     14* Code highlighting with [bfchroma](https://github.com/Depado/bfchroma)
    1415* Fast (duh!)
    1516
  • trunk/cmd/aya/main.go

    r65 r66  
    1 // $TheSupernovaDuo: cmd/aya/main.go,v 0.5.x 2023/5/7 10:57:10 yakumo_izuru Exp $
     1// $TheSupernovaDuo: cmd/aya/main.go,v 0.5.x 2023/5/8 18:6:18 yakumo_izuru Exp $
    22package main
    33
     
    2020        "github.com/eknkc/amber"
    2121        "github.com/yosssi/gcss"
     22        "github.com/Depado/bfchroma/v2"
    2223)
    2324
     
    186187                return err
    187188        }
    188         v["content"] = string(blackfriday.Run(
    189                 []byte(content),
    190                 blackfriday.WithExtensions(blackfriday.CommonExtensions|blackfriday.AutoHeadingIDs),
     189        v["content"] = string(blackfriday.Run([]byte(content),
     190                blackfriday.WithExtensions(blackfriday.CommonExtensions|blackfriday.AutoHeadingIDs),blackfriday.WithRenderer(bfchroma.NewRenderer()),
    191191        ))
    192192        if w == nil {
  • trunk/go.mod

    r60 r66  
    44
    55require (
     6        github.com/Depado/bfchroma/v2 v2.0.0
    67        github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385
    78        github.com/russross/blackfriday/v2 v2.1.0
     
    1112)
    1213
    13 require golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
     14require (
     15        github.com/alecthomas/chroma/v2 v2.2.0 // indirect
     16        github.com/dlclark/regexp2 v1.4.0 // indirect
     17        golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
     18)
  • trunk/go.sum

    r60 r66  
     1github.com/Depado/bfchroma/v2 v2.0.0 h1:IRpN9BPkNwEpR6w1ectIcNWOuhDSLx+8f1pn83fzxx8=
     2github.com/Depado/bfchroma/v2 v2.0.0/go.mod h1:wFwW/Pw8Tnd0irzgO9Zxtxgzp3aPS8qBWlyadxujxmw=
     3github.com/alecthomas/chroma/v2 v2.2.0 h1:Aten8jfQwUqEdadVFFjNyjx7HTexhKP0XuqBG67mRDY=
     4github.com/alecthomas/chroma/v2 v2.2.0/go.mod h1:vf4zrexSH54oEjJ7EdB65tGNHmH3pGZmVkgTP5RHvAs=
     5github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae h1:zzGwJfFlFGD94CyyYwCJeSuD32Gj9GTaSi5y9hoVzdY=
     6github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8=
    17github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
    28github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
    39github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
     10github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
     11github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
    412github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o=
    513github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM=
Note: See TracChangeset for help on using the changeset viewer.