Open-Assistant
Open-Assistant copied to clipboard
Reminder to enter programming language
If someone needs to write code in the response then after typing ``` should be reminder to enter the programming language so that the colored syntax of the programming language can work.
If no specific programming language is given after the ```, could the language automatically be detected? Unlike spelling corrections, syntax highlighting should never affect the conversation, so automating this is pretty safe. (unless the conversion starts referring to specific terms in the code by color...)
It'd be pretty tough and depend on the context more than anything. Lots of languages are based on C and so look pretty similar, there are tells but the context of the thread is probably the best way to tell.
That's something that could be included in the guidelines. If there's no downside to specifying the language and it makes the reply more readable, we should urge users to include them.
If no specific programming language is given after the ```, could the language automatically be detected? Unlike spelling corrections, syntax highlighting should never affect the conversation, so automating this is pretty safe. (unless the conversion starts referring to specific terms in the code by color...)
Having the correct programming language in the dataset is much better than detecting it on the fly in my opinion. However, maybe we could use a programming language detector and suggest a specific language to the user.
Sometimes people don't know what markdown abbreviation to use for the language specifier, so I think some form of suggestion might give the best results.
Sometimes people don't know what markdown abbreviation to use for the language specifier, so I think some form of suggestion might give the best results.
I added a link to a document of the supported languages both in the task and the guidelines. Hopefully it's enough to motivate anyone who sees it to include the specifier.
We have the comment in the guidelines, which I think is enough.
The problem is that it is totally valid markdown if you don't put the language, which makes it ambiguous. I will close this now, feel free to re-open if you think this could be better solved.