marp-team / marp-vscode

Marp for VS Code: Create slide deck written in Marp Markdown on VS Code
https://marketplace.visualstudio.com/items?itemName=marp-team.marp-vscode
MIT License
1.55k stars 72 forks source link

Line numbers in the code block using Marp in VSC #413

Closed icecloud-dcp closed 1 year ago

icecloud-dcp commented 1 year ago

I tried to add the line numbers in the code block with Marp md. I tried to change theme and/or marp theme css settings. But it doesn't display the line number. Is Marp extension in VSC supported?

icecloud-dcp commented 1 year ago

This is a sample md file:

marp: true theme: gaia line-numbers: true

def test():
    a=10
    return a+10
print(test(10))
yhatt commented 1 year ago

The answers are all in https://github.com/marp-team/marp/discussions/164. In short, you always have to use Marp CLI instead of Marp for VS Code because it requires customization the Markdown conversion engine.

Marp has never supported the line-numbers directive officially, so you are probably trying to use some different Markdown flavor.