r/learnpython • • Oct 23 '26

I'm building a markup language renderer in Python using Tkinter

Hey everyone! I'm working on a personal project called RML, a markup language I'm creating from scratch using Python.

I'm building a renderer with Tkinter that can display titles, text, clickable links, and images from .rml files.

Here's an example of what RML looks like:

RML 0.0.2;

Create.title1 ("My Website");
Create.text ("Hello World!");
Create.image ("image.png");
Create.link ("https://example.com");

Create.script name=("main")
    Display.Text ("Hello from SJ!")

I'm also developing a small scripting language called SJ that runs inside RML documents.

The project is still in its early stages, and I'm working on improving the renderer and expanding the language.

I'm sharing this because I'd love to hear feedback, especially about the Python implementation, code structure, and what I could improve.

Thanks for reading!

0 Upvotes

21 comments sorted by

2

u/woooee Oct 24 '26
Create.text ("Hello World!");

Do you have a way to put thus text, or widgets, at a given location on the screen?

1

u/aguythatcodesforfun Oct 24 '26

I will try to implement it!

1

u/aguythatcodesforfun Oct 24 '26

I implemented it, now i'm just going to update the github repository.

RML 0.0.3;

Create.text ("LEFT") at=(20, 50);

Create.text ("MIDDLE") at=(400, 50);

Create.text ("FAR RIGHT") at=(750, 50);

Create.text ("VERY FAR RIGHT") at=(1100, 50);

1

u/JamzTyson Oct 24 '26

Why not:

Create.text ("LEFT", at=(20, 50));

or perhaps better

 Display.text ("LEFT", at=(20, 50));

Which gives you a syntax that can be extended if you wish:

 Display.text ("LEFT", at=(20, 50), bold, 24pt);

But more fundamentally, why are you using imperative language for Markup? Markup is a declarative annotation of content.

1

u/JamzTyson Oct 24 '26

I'm sharing this because I'd love to hear feedback, especially about the Python implementation, code structure, and what I could improve.

You forgot something.

1

u/aguythatcodesforfun Oct 24 '26

What did i forget?

2

u/JamzTyson 29d ago

The Python code.

1

u/aguythatcodesforfun 29d ago

I forgot to reply, the code is in the github repository

2

u/JamzTyson 29d ago edited 29d ago

Which github repository?

3

u/riklaunim Oct 23 '26

It can be a fun learning project. From the practical side, why are you making such a thing?

2

u/supergnaw Oct 23 '26

Obligatory 927 reference.

2

u/TheRNGuy Oct 24 '26

Make it more like React — it has better syntax for UI.