AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   Help with code snippets in a readme? (https://forums.alliedmods.net/showthread.php?t=338466)

SandrilaFriman 07-07-2022 02:00

Help with code snippets in a readme?
 
Not a dev, but a teacher who is teaching javascript/react. I am creating a readme file in vscode, and inside of it I am including some example code (it is a tutorial for students to follow along). Is there a way I can make the code look like it would if it was in a file?

By this I mean you can't really differentiate between the text in the readme and the code snippets? It would look much better if they could see the code snippets with colour (and importantly it will look similar echatspin to what they end up typing in their own projects)

Hoping someone can help.

fysiks 07-07-2022 23:31

Re: Help with code snippets in a readme?
 
This site is not the best place to ask about this type of question and it probably belongs in the Off-Topic forum if you insist on posting here. This is a forum for writing plugins for Half-Life games.

A readme is typically a plain text file which cannot have color. If you're using some sort of markup language in your readme then you have to see what your parser supports. If you're using Markdown you can look here. The VSCode Markdown preview feature (make sure your file is set as Markdown) supports syntax highlighting. If you're using GitHub, I assume that they also support it also but you can easily find that out in GitHub's documentation.


All times are GMT -4. The time now is 18:37.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.