Line numbers in code blocks

Viewed 14

It would be nice to support something along the lines of

class Square:
    def __init__(self, ...

python is already recognised of course, and that's great! Pandoc has support of that through a verbose syntax

```{#mycode .haskell .numberLines startFrom="100"}
2 Answers

Thanks for the suggestion. Marked uses Highlight.js for syntax highlighting, and it doesn't provide line numbers. There's a plugin that hasn't been updated for years that I'd be willing to try, but it's not as simple as what Pandoc does with actual inline highlighting.

Update: Marked 3.2.12 will include the option to turn on line numbers across the board (as long as syntax highlighting is enabled), and will accept:

```ruby linenums
def hello
  puts “Hello, world!"
end
```

With "linenums" as a class to selectively enable line numbers. I can't presently enable full Pandoc syntax, but may add that to Apex in the future (and Apex will eventually become the only built-in processor option).

I see, thanks. It's rather low priority for the record.