Skip to content

How to use snippets to show code? #1921

Answered by facelessuser
ssbarnea asked this question in Q&A
Discussion options

You must be logged in to vote

As there has been no response back, I'll give my official statement. You must configure Snippets with a base path. Python Markdown has no concept of file location as it only deals with a text buffer. The file information, assuming there even is one associated with the buffer, is not tracked in Python Markdown. For this reason, a base path is needed. If you give it one or more base paths, the specified snippet path will be compared relatively against each base path until it finds the file. All of this is covered in the documentation: https://facelessuser.github.io/pymdown-extensions/extensions/snippets/.

If you have a specific question about something in the documentation, please feel free…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ssbarnea
Comment options

@facelessuser
Comment options

Answer selected by facelessuser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants