cribbersix / pygame-markdown Goto Github PK
View Code? Open in Web Editor NEWPackage to parse and render the contents of a markdown file with customizable styling onto a pygame surface.
License: MIT License
Package to parse and render the contents of a markdown file with customizable styling onto a pygame surface.
License: MIT License
In my code the markdown text is already a str
. So to render it with MarkdownRenderer
, I currently have to do this:
with tempfile.NamedTemporaryFile("w") as tmp_file:
tmp_file.write(markdown_text)
tmp_file.flush()
md.set_markdown(tmp_file.name)
This is super inefficient, so please add a method to set the markdown directly as a str
.
Thanks in advance!
While discussing pygbag use with teachers i came to an idea:
When rendering markup with python code inside would it be possible
to know if a ``` py
```` code block is clicked and also get an ordered list of previous code blocks ?
my idea is to edit/run on click the concatenation of previous blocks up the one clicked in document :
import pygame
pygame.init()
# some init code
init blah -blah
#some pygame example code
An exception occurs when running sample code from a README.md
TypeError: MarkdownRenderer.set_area() got an unexpected keyword argument 'offset_X'
Change code
md.set_area(surface, offset_X, offset_Y, width=-1, height=-1)
- surface - the pygame surface which the text is blitted on
- offset_X - the offset of the text from the surface's left sided border
- offset_Y- the offset of the text from the surface's top border
to
md.set_area(surface, offset_x, offset_y, width=-1, height=-1, margin=10)
- surface - the pygame surface which the text is blitted on
- offset_x- the offset of the text from the surface's left sided border
- offset_y- the offset of the text from the surface's top border
And code
md.set_area(surface=surface, offset_X=50, offset_Y=20, width=500, height=500)
to
md.set_area(surface=surface, offset_x=50, offset_y=20, width=500, height=500)
You can also add a description for the margin argument.
Code blocks and inline code should be in a monospaced font.
pip gives this error when installing this.
ERROR: Could not find a version that satisfies the requirement pygame==1.9.6 (from pygame-markdown)
ERROR: No matching distribution found for pygame==1.9.6
Edit: pip install pygame-markdown --no-dependencies
works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.