HTML processor, linting and validation, SSG
Guys I have a few questions about the mentioned topic. ik these are pretty much adv but why not to have a look at them.
1. HTML Processor: I saw that instead or processor we can use react. as react have all the features that a processor can have. so, it isnt worth to learn about processors these days. am i right?
2. Linting and validation: there are vs code extension that does the same work so, what i think is we don't have to install any other linting and validation tool like HTMLHint.
right??
3. Static site generator: Idk much about this. I just know it makes HTML with the help of given template code. But i don't think these are even used these days. I like to write my HTML manually.
am i right about all this? and if i am wrong somewhere plz correct me.
30 Replies
html preprocessors are still used a lot. PHP is a html preprocessor, technically. And you could consider most template languages to be html preprocessors. React is a frontend framework, so it does vaguely the same thing, but no single solution is ever going to cover all use cases
Linting and validation outside of vs code shine when you use them in a team. You can run them in pre-commit hooks, or run tests on them on the server. For a solo dev, vs code can theoretically be enough, but I personally really like running prettier on save. It's nice to write messy, unformatted code that you'll know will snap into place when you hit ctrl+s.
SSG is still super popular too. Basically any time you have a site that is infrequently updated, or has a fixed HTML/JS/CSS structure but uses external data, you can use SSG. It makes it so that your server can just serve the necessary files and be done, instead of having to do calculations for each page request
basically what I'm reading from your question is that you're looking at solutions to problems, and assuming there has to be only one that is the best. That's pretty much never the case in IT. A dozen different solutions can exist in parallel, each with slightly different advantages and disadvantages.
Okay I get it now. Learning new things will introduce me to processors like PHP.
Umm...about SSG. if they are pretty useful then I have to dig in deeper.:mac:
As i thought SSG are useless.
web dev is a broad field
surely it is
btw thnx..🫂
static site generators are absolutely fantastic for:
- blogs
- documentation
- small websites you change very infrequently
- live demos for your project
umm...I kept searching for SSG but cant really find a source.
is there any?
what are you trying to find?
Kind of like what is it?
how is it even used...until now I only know the theoreitical part like you guys told and some reference from AI
it's a tool that generates all the html files for the site, including links between the files
and the files can all have a basic structure with the same elements, like a menu or sidebars or footer
all this without you having to change 1000 files by hand each time you need to change something
wow then it is pretty useful
it is
and since it is just html files, you can put it on github pages or gitlab pages or other hosts
I see.
now i get it why Its there
it doesn't need php or node or anything, making it incredibly fast as well
That's cool.
i found a source video which was pretty old to be able to understand anything or extract something out of it.
I will try finding more resources now
i don't have any resources, but you can look into astro, jeckyll, hugo and a few others
sveltekit has an SSG mode too
Okay I will search for specific ones
i always forget about sveltekit
whats that?
sveltekit is a fullstack framework for svelte
kinda like next for react
I see.
I just searched it.
I will post some resources here for SSG after I find one
Thnx to both of you:thumbup:
you're welcome
the web dev world is a huge web of tools
Yes it is. I get to hear a new term everyday😭
there's way too many terms to learn, so, go slow
omg...Alright slow walk
A note about eslint (one of the linters available for js) the extension by itself will not provide syntax/error highlighting in vs code.
You will also need to install the npm package with npm install
Check the extension page instructions for whatever linter you use. Maybe another extension provides the package for you
I'm a bit late to the party, so i'm only gonna add onto what Jochem and Epyc said.
- you can see html processors as compilers that turns text that is easy for a human to read and write into html (usually with static js or css on the side to provide interactivity and style but it's not required, think Bootstrap or any other UI library you might know about). Most of the time html processors take code that looks a lot like plain text and turn it into HTML that a browser can render, the most often the source files are written in Markdown (the same language you can use to add formatting to discord messages) but other languages exist like Pug or JSX depending on the use case (if you have a lot of content with little formatting or not much content but with a lot of different formats you might chose different languages). HTML processors can also be called Templating Languages depending on the context.
- for linting and validation, as Jochem pointed out, it's especially useful when you are working with other people that might not use the same code editor as you (VSCode, Intellij, Visual Studio, Vim, Emac...) and when you work with a lot of people like is the case for Open Source projects where there might be hundreds or thousands of individual contributors it makes it possible to have all the tools pre-configured and ready to work when you clone the repository and install the dependencies. On top of that, such external tools make it possible to run the validation, linting and formatting on the hosting service side (GitHub, GitLab...) to make sure the code respects the style defined or preferred by the project maintainer, which in turn make it easier to understand said code as all parts of the project are arranged and formatted the same way.
- I don't have much to add regarding SSG it's one of many ways of creating websites and it has its pros and cons as pointed by the others already.
it helps. Thanks a lot I will soon upload some resources here. 🫂
Why upload resources?
umm just so that another person searching for this would be able to read about