The Code Linter (Your suggestions)

Hello! Every one I have created a code linter as you know all it does is add colors to your c++ code so that it looks good on your website.
How it works:
1- Add the linter.css given in here to your project.
2- Type the cpp code in the text area and click the lint button. You will see the demo of your code and also the HTML code below.
3- Copy that HTML code and paste it into your HTML file. Voila now, your code will look more beautiful.

This idea comes into my mind when I did the Technical Documentation Project the code I wrote for examples were looking meh so I build this linter to make my work easy. I am sharing it with you guys maybe it can help you someday.

Note that this linter is desk checked so errors are expected also if you find issues you can raise issue on GitHub there is a link for the repo on the page or you can reply here.
Also if you guys find it helpful I will try to make Linters for other languages such as Python, JS, HTML and CSS. Your help is appreciated.

The Linter

I think you need to check the color contrast as I can’t read some of the colorized code produced on the page. For example, the for in a for loop is a dark blue on black background and is basically unreadable for me.

Not sure how far you are on this project but I think you need more colors as well. For example, comments appear to use the same color as other parts of the code (such as function names, strings). I would think that most people want comments to be a unique color.

1 Like

Ah thanks for your suggestions and yes I will change the color for the comments and strings.

How about adding inputs so the user can change the colors, or just have some premade themes. If you use custom properties for the colors it might be easier. I might also look into generating a CSS file so the user can download the customized version.

BTW, a linter is a static code analysis tool used for error checking. This is a code highlighter. I would rename it as such.

CSS generation is a nice idea I will add this one into it and also thanks for the clarification on the linter👍🏻

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.