Categorygithub.com/OhYee/goldmark-python
modulepackage
0.0.5
Repository: https://github.com/ohyee/goldmark-python.git
Documentation: pkg.go.dev

# README

goldmark-python

Sync to Gitee w
orkflow state codecov version

goldmark-python is an extension for goldmark.

You can use python to build svg image or output data in your markdown like mume

It will auto replace import matplotlib.pyplot as plt to output svg in markdown.

screenshot

There are two demo(using ' instead of ′ in the code block)

  1. default config

Demo1 Output1

'''python
print("Hello World")
'''

  1. using python-output and goldmark-highlighting extension

Demo2 Output2

'''python
import matplotlib.pyplot as plt
import matplotlib
import sys

matplotlib.use("svg")

y = [1, 2, 3, 4, 5]
x = [5, 4, 3, 2, 1]

plt.plot(x, y)
plt.savefig(sys.stdout)
'''

'''python-output
import matplotlib.pyplot as plt
import matplotlib
import sys

matplotlib.use("svg")

y = [1, 2, 3, 4, 5]
x = [5, 4, 3, 2, 1]

plt.plot(x, y)
plt.savefig(sys.stdout)
'''

Installation

go get -u github.com/OhYee/goldmark-python

License

MIT

# Packages

No description provided by the author

# Functions

NewPython initial a Python struct.
NewPythonExtension return the goldmark.Extender.
RenderMap return the goldmark-fenced_codeblock_extension.RenderMap.

# Variables

Default Python extension when there is no other fencedCodeBlock goldmark render extensions.

# Structs

Python render struct.