mirror of
https://github.com/lleene/hugo-site.git
synced 2025-07-27 10:12:17 +02:00
force use LF file endings
This commit is contained in:
@ -3,12 +3,12 @@ title: "Hugo Integration 🧭"
|
||||
date: 2021-10-30T15:42:22+02:00
|
||||
draft: true
|
||||
toc: false
|
||||
images:
|
||||
pyscript: true
|
||||
tags:
|
||||
- untagged
|
||||
---
|
||||
|
||||
## This is Word in Progress
|
||||
## This is Work in Progress
|
||||
|
||||
The hope here is that we can call a predefined go procedure that parses
|
||||
some section of markdown source code and instantiates the corresponding svg file
|
||||
@ -17,3 +17,36 @@ under our static folder that is then referenced.
|
||||
``` go
|
||||
{{/* a comment */}}
|
||||
```
|
||||
|
||||
## Using Python Script
|
||||
|
||||
Example using standard output from a python script.
|
||||
|
||||
{{< pyscript >}}
|
||||
print("test string")
|
||||
{{< /pyscript >}}
|
||||
|
||||
Example using matplotlib to generate a simple graph.
|
||||
|
||||
{{< pyplot >}}
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
x = np.arange(-10,10)
|
||||
y = x ** 2
|
||||
fig, ax = plt.subplots()
|
||||
ax.plot(x, y)
|
||||
fig
|
||||
{{< /pyplot >}}
|
||||
|
||||
|
||||
Example using matplotlib to generate a scatter plot.
|
||||
|
||||
{{< pyplot >}}
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
x = np.random.randn(25)
|
||||
y = np.random.randn(25)
|
||||
fig, ax = plt.subplots()
|
||||
ax.scatter(x, y)
|
||||
fig
|
||||
{{< /pyplot >}}
|
||||
|
@ -65,9 +65,9 @@ tags:
|
||||
|
||||
|
||||
``` go
|
||||
{< python-svg dest="/images/posts/test.svg" title="This is a pyuthon-svg exmaple." >}
|
||||
{{</* python-svg dest="/images/posts/test.svg" title="This is a pyuthon-svg exmaple." */>}}
|
||||
railroad.Diagram("foo", railroad.Choice(0, "bar", "baz"), css=style)
|
||||
{< /python-svg >}
|
||||
{{</* /python-svg */>}}
|
||||
```
|
||||
|
||||
{{< python-svg dest="/images/posts/test.svg" title="This is a python-svg exmaple." >}}
|
||||
|
Reference in New Issue
Block a user