Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

for example, I have docs/static/python/world.py as such:

print("hello world")
print("hello again")

Can I embed the code from this file somewhere else? An example:

code:

```python:docs/static/python/world.py
 
```

preview:

print("hello world")
print("hello again")

Possibly with line selector too?

code:

```python:docs/static/python/world.py[1:2]
 
```

preview:

print("hello world")

Something like so I can have multiple pages reference the same file without having to maintain multiple copies.

You must be logged in to vote

Replies: 1 comment · 1 reply

Comment options

Code SNippet

You must be logged in to vote
1 reply
@Ravencentric
Comment options

I missed it because I was only looking into the code blocks section. Thank you

Answer selected by Ravencentric
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.