Giter Club home page Giter Club logo

Comments (3)

natikgadzhi avatar natikgadzhi commented on August 22, 2024

@ethan-kusters that should probably also be in docc-render? I think it's relatively easy to do, too.

from swift-docc.

natikgadzhi avatar natikgadzhi commented on August 22, 2024

I'm taking a look ;) So the good news is CodeListing can show line numbers.

We just need to figure out how to best tell it to show line numbers, and what level of flexibility we want. If I read the code correctly, it looks for contentNode.showLineNumbers for contentNodes that are codeListing.

So hypothetically, we could do a few things here:

  1. Add an option like @CodeListingsShowLineNumbers(true) or similar. Options are usually scoped to the current page / article, and it feels janky.
  2. See if we can change how we parse the ``` code block syntax to accept something like ``` showLineNumbers, similar to https://rehype-pretty-code.netlify.app/ on a level of a specific code block. That will be more involved, likely require some hacking in swift-markdown, BUT that will allow others to use that, too.
  3. Make site-wide setting and pass it in an env variable or a build flag. That's probably a crappy option because those are obscure, and it will be difficult to document.

I feel like option 2 is what's generally expected with markdown-base documentation systems.

from swift-docc.

Anthony-Eid avatar Anthony-Eid commented on August 22, 2024

Would this be a good second issue for me to take a look at? I'm trying to learn more about this code base and would love to have something to do while I'm waiting on feedback from my pull request.

Admittedly, I'm probably going to need some guidence with attacking this issue, but I'm eager to give it my best shot. 😀

from swift-docc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.