mirror of
https://github.com/imfing/hextra.git
synced 2025-06-19 10:24:16 -04:00
feat: support link in code block title (#523)
* feat: support link in code block title * refactor: simplify code block filename link implementation * docs: update syntax-highlighting.md * chore: rename `filename_uri_base` to `base_url` [skip ci] * refactor: use `base_url` int code block implementation --------- Co-authored-by: Xin <xin@imfing.com>
This commit is contained in:
@ -40,6 +40,22 @@ def say_hello():
|
||||
print("Hello!")
|
||||
```
|
||||
|
||||
### Link to File
|
||||
|
||||
You can use the `base_url` attribute to provide a base URL that will be combined with the file name to generate a link.
|
||||
|
||||
The file name can include a relative path if it specifies the file's location within the base path.
|
||||
|
||||
````markdown {filename="Markdown"}
|
||||
```go {base_url="https://github.com/imfing/hextra/blob/main/",filename="exampleSite/hugo.work"}
|
||||
go 1.20
|
||||
```
|
||||
````
|
||||
|
||||
```go {base_url="https://github.com/imfing/hextra/blob/main/",filename="exampleSite/hugo.work"}
|
||||
go 1.20
|
||||
```
|
||||
|
||||
### Line Numbers
|
||||
|
||||
To set line numbers, set attribute `linenos` to `table` and optionally set `linenostart` to the starting line number:
|
||||
|
Reference in New Issue
Block a user