maaslalani / slides

Terminal based presentation tool
http://maaslalani.com/slides/
MIT License
9.44k stars 259 forks source link

Runtime-configurable custom languages for execution #122

Open remexre opened 2 years ago

remexre commented 2 years ago

Is your feature request related to a problem? Please describe.

I'd like to be able to use a variety of languages that I don't think it's worth the effort to upstream.

Describe the solution you'd like

A configuration file, command line options, or some pragma in the Markdown file (not sure which is the best one) can be used to add additional languages.

Describe alternatives you've considered

Upstream 4 or 5 languages for execution, some of which have <1k users globally.

cuducos commented 2 years ago

Hi, @remexre! I was reading your post and I am not sure what you mean by custom language. (Disclaimer: I'm not the maintainer). Would you mind clarifying?

What I have in mind is that the parts that Slides create are already customizable. For example, I am Brazilian and in Brazil we can call a slide a página (just a silly example, in Portuguese we call it slide too hahaha… página is page), and we use date in the DD/MM/YYYY format. I can currently customize this with:

---
theme: ./path/to/theme.json
author: Cuducos
date: 02/01/2006
paging: Página %d de %d
---

However… you might be thinking of other custom language changes, such as left-to-right or right-to-left support, for example. Is that the case?

maaslalani commented 2 years ago

@remexre Just out of curiosity what are the 4-5 languages you want to support? Some of them are probably reasonable to upstream, especially if they have highlighting support via the package we use for syntax highlighting.

I can try and think of a way to add custom commands, are the languages interpreted?

My initial thinking is something like this possibly:

```custom-language --flags %F
foo bar() {
  baz("hello world")
}


Which, when executed would run the custom command and replace the directive with the path to the file.
cuducos commented 2 years ago

Ow… programming languages! I feel so dumb now 🤦 hahahaha…

maaslalani commented 2 years ago

Hahahaha all good @cuducos, definitely would have made the same mistake if I didn't see the "for execution" part in the title. I appreciate your response ❤️

remexre commented 2 years ago
```custom-language --flags %F

This looks good to me!

Just out of curiosity what are the 4-5 languages you want to support?

For languages that lots of people use:

For languages where this isn't the case: