CSS' syntax - grammar editor/corrector
Demetrius Pinheiro last edited by
Hi @PeterJones ! Very nice answer. Thank you!
Unfortunately, today I can’t test your suggestion. But I will test it soon. And I will be back to you with the result.
I don’t really care if the CSS’ validator is online or offline. But I would like a solution inside NP++. Yeah, no problem to connect NP++ online, or to bind NP++ to a SomeCssChecker.exe. But in any case, I do prefer something automatic happening inside my NP++, a kind of real-time CSS’ validator (online/offline) checking my CSS’ scripts while I write them at NP++.
Honestly, if I need to open a browser or a SomeCssChecker.exe to validate my CSS’ script (wrote at NP++), and if I need to work in another screen/software… in this case I will prefer to use another solution. In my ignorance, I believe that’s the reason why I was looking for a “NP++ plugin”. If no one here has a plugin to recommend me, perhaps I will try to downgrade my NP++ to an older version, in order to try old plugins.
But in any case, I will test you solution during the next week.
if I need to open a browser or a SomeCssChecker.exe to validate my CSS’ script (wrote at NP++), and if I need to work in another screen/software… in this case I will prefer to use another solution
If this can be made to work as Peter suggests, I think you will like it and you won’t “prefer to use another solution”.
Meta Chuh last edited by Meta Chuh
it uses notepad++ and an offline tool called “css (cse) html validator” which is very, very powerful, highly configurable, has a lot of integration apis and is completely scriptable and command line capable.
all css/html test reports will be shown directly inside a notepad++ tab.
displaying your complete validation results, with clear text explanations of every warning, suggestion or error, and most important, a summary at the top 👍
(see last screenshot of this guide)
all css and html checks will be accompanied by an audible “tadaaaa” result on success, or a “ploinkk” if errors are found (customisable).
if you wish, you can display the report results graphically and categorised, inside a separate css/cse html validator window.
here’s a short step by step guide:
(including screenshots, so that you can have a look at all the results first, to see whether you like it, or you are still missing some features)
installing css cse html validator:
go to the
CSS HTML Validator for Windowswebsite: https://www.htmlvalidator.com/download/
scroll down and download the free
CSE HTML Validator Standard for Personal Use
(direct link for cse-html-validator-170501personal-setup.exe at download-cnet-com >>> here <<<)
install cse-html-validator-170501personal-setup.exe using default settings.
- add the following 2 lines anywhere in your notepad++ shortcuts.xml, at the <UserDefinedCommands> section.
(now that’s simple, as you already know where your’s is, and these paths are already your real paths 😉 so you can use them straight away)
<Command name="Open with CSS CSE HTML Validator" Ctrl="no" Alt="no" Shift="no" Key="0">"%ProgramFiles(x86)%\HTMLValidator170\cmdlineprocessor.exe" -o "$(FULL_CURRENT_PATH)"</Command> <Command name="Validate with CSS CSE HTML Validator" Ctrl="no" Alt="no" Shift="no" Key="0">"%ProgramFiles(x86)%\HTMLValidator170\cmdlineprocessor.exe" -v "$(FULL_CURRENT_PATH)"</Command>
- your shortcuts.xml should now look like this screenshot (plus the modifications you already have):
css/cse html validator preparation:
restart notepad++ and open any .css file (or html file, etc) for testing.
go to the menu
run > Open with CSS CSE HTML Validatoras seen at the screenshot below:
- at the css/cse html validator, go to the menu
validate options > default validation modeand select
fullas seen at the screenshot below:
- now hit validate to make a test run on your css.
the categorical result page now looks like this:
- now go to the menu
validate options > validator engine optionsas seen here:
- at the validator engine options, go to
accessibility > classicand set the output viewer by browsing and selecting your notepad++.exe
(in your case it’s
C:\Program Files\Notepad++\notepad++.exe, as seen in your log)
screenshot of the validator engine options window:
save nowbefore you press
okor your settings will be lost.
close the css/cse html validator window.
we’re done now with the setup.
- open a .css or any other file you want to analyse and go to
run > Validate with CSS CSE HTML Validatorto run a test on it.
- a new notepad++ tab will open, displaying your complete validation results, with clear text explanations of every warning, understandable suggestions on what to corrector, and much more 👍:
currently you have to save your file, before you run a validation test, but this can be done automatically in the future, using the functions @PeterJones posted above, eg. by using macros (one click save and run validate) or nppexec (save and run validate, or, a bit tricky: run validate on every save).
the report results can be colour highlighted in the future by creating a custom user defined language (udl), if you like what you see until now.
sidenote to @Alan-Kilborn
I think you will like it and you won’t “prefer to use another solution”.
i think you’re right again 😂
Wow. Above and beyond, Meta-Chuh, above and beyond…
thanks, i guess i just had a little “claudianic” attack to dig into something i never used and probably will never use myself, just to try out how it could be done, and also triggered by a high level of participation of the original poster towards regulars. (i think it’s more fun and worth it, if we get that much response, especially if it is as readable and clear as in this case 👍)
btw trigger: i’m currently listening to this triggered by your post 😉👍
Demetrius Pinheiro last edited by
@Meta-Chuh … wowwwww, impressive presentation and explanation… I don’t know how to thank you, but thank you!
I’ll try to test it ASAP during the next week, and I will be back to you with the result.
Based on the images and explanations you posted, I will say that this solution (team effort with @Eko-palypse and @PeterJones) seems to be 80% what I was looking for (where 80% is excellent). It seems to be a very usable solution, with a very powerful validator. Also, it seems to work inside NP++ as I wanted.
So, what do I need for the 100%?.. answer: the real-time validator. It is very handy to have a real-time validator, which corrects and makes suggestions in real-time. I have this at Stylus (extension), so will love to have the same at NP++. Today I was in contact with a Dev through GitHub, and he said that will try to build a real-time CSS’ editor plugin for NP++. It is not a promise, but at least it will be a good try. And if he can build that, it will be for the benefit of all NP++’ users. Anyway, until then, I certainly will test your solution.
Once again, thank you and congratulations for such nice presentation and explanation.
i guess we’re looking forward to hear if it stays at 80% or if it slowly decreases while testing 😉
regarding realtime validation:
from a coding perspective, it should be possible for your dev, without creating an own engine, if he uses css/cse validator, or any other integrable validation engine, and the plugin basically just acts as a real time communication bridge between the validation engine and the editor and cursor, with it’s highlighting and overlays.
maybe following api docs are of use to him, if he wants to try this specific engine, as it is very well documented.
fast cgi integration:
side note: i’m not affiliated with htmlvalidator.com in any ways, and today was the first day i’ve visited their page and used one of their products.
Eko palypse last edited by
wow … just … WOW :-)
Demetrius Pinheiro last edited by Demetrius Pinheiro
Hi @Meta-Chuh ,
I tested your solution and my final verdict is: WOW (again)! THANK YOU! (again).
First, if any newbie is reading this, he should know that @Meta-Chuh ’ tutorial is impeccable, almost impossible to fail. So newbie don’t feel intimidated, just follow @Meta-Chuh ’ step-by-step, it will take less than 10 minutes (including downloads, installations and tests etc), and at the end @Meta-Chuh ’ tutorial will work like a charm.
Third, bad news, the Dev I contacted at GitHub after evaluating the possibility of building a “CSS’ validator for NP++”, he quit. In his own words, he quits not because is impossible, but because it will take lot of work, and now he has not the time for that.
My final conclusion is:
For programmers, NP++ today without plugins, is not the best CSS’ editor (and in my opinion it never will be the best CSS’ editor).
However, for users like me, that like to play around with CSS in many different platforms (Stylus extension, online and offline CSS’ editors, pastebin etc)… NP++ with @Meta-Chuh ’ solution is an additional excellent tool (very handy, for example, when you are writing a text in one tab, and in other tab you are working at a CSS’ script; this nicely can be done through NPP+ with @Meta-Chuh ’ solution).
thank you for your kind words @Demetrius-Pinheiro .
it’s very nice to hear.
you’re always welcome to visit us from time to time if you have any questions and ideas.
(disclaimer: with no promise that we can solve everything, and no promise that we always react that fast 😉 )
I told you you’d like what the team here would come up with! :)
NP++ today without plugins, is not the best CSS’ editor (and in my opinion it never will be the best CSS’ editor).
N++ doesn’t TRY to be this…not sure why you think it should be. There are much more specialized tools for this, or really any other non-general purpose text editing task, that can and will do better.