Sh4yy / selfhosthq

A community-driven and open-source project to create a list of comprehensive guides and best practices for self-hosting services.
https://selfhosthq.com
MIT License
147 stars 9 forks source link

Request: Code language options. #8

Open joshmanders opened 1 week ago

joshmanders commented 1 week ago

Not sure if the title is the best way to describe it, so I'll go into it more here. Essentially when I was reading your section on Deploying a SQLite database with ws4sqlite, I noticed in the Creating a table section you use Python, which is fine, but to appeal to a wider range of people and make understanding the documents a bit better, we should look into how we can make it so that you can define different language options, so like "this is how you would do it in Python and Ruby" by just selecting which option the block has a codeblock for. Then we as contributors can expand on sections if we have experience in doing that thing in PHP or Python or Ruby, etc.

joshmanders commented 1 week ago

Could probably even take it a step further and remember language choice and always show that for every block and fallback to the default block if that language isn't available for it.

Sh4yy commented 1 week ago

My main concern is whether something like that would increase the complexity of creating and maintaining the posts.

It sounds like a good idea, and is fairly simple to implement inside MDX, but I'm not sure whether it's worth it.

Also, I think most of the posts will revolve around infra? So, it'll be less language specific code.

sahithyandev commented 1 week ago

If the aim is to teach beginners about self hosting (as well as others), code examples in multiple languages are better.

joshmanders commented 1 week ago

I agree with @Sh4yy that most probably won't revolve around this, so will we actually need it is unsure. But I agree that it's good for beginners.

Can keep the idea on the backburner and look into doing it if it comes down to needing it.