July 23rd, 2024

Show HN: Preprocessor I've been working 4 years now

Pretty Markup is a new HTML preprocessor that enhances readability with a human-friendly syntax, eliminating angle brackets. It allows clean code writing, is open for contributions, and is licensed under MIT.

Read original articleLink Icon
Show HN: Preprocessor I've been working 4 years now

Pretty Markup is a new preprocessor for HTML, similar to how Sass functions for CSS or TypeScript for JavaScript. It aims to enhance the writing of HTML by adopting a more human-friendly syntax that eliminates the need for angle brackets, thereby improving readability and developer productivity. The tool emphasizes semantic best practices, allowing developers to focus on the meaning of their content while ensuring that the resulting HTML is both aesthetically pleasing and machine-readable. Pretty Markup acts as a superset of standard HTML, enabling users to write clean and concise code that is automatically converted into browser-compatible HTML.

To get started with Pretty Markup, users need to create a folder named ./src and add files with the .pm extension. The preprocessor can be run using the command `pm`, which requires global installation or can be executed via npx. Additionally, there is a syntax highlighter available for Visual Studio Code, which can be installed by searching for "Pretty Markup" in the extensions marketplace.

The project is open for contributions, and users can report issues or suggest improvements on its GitHub repository. Pretty Markup is licensed under the MIT License and has recently been published with version 1.0.13, which has garnered 348 weekly downloads.

Link Icon 10 comments
By @Denvercoder9 - 5 months
I suggest putting a code sample of a page written in Pretty Markup that shows off its features in the README. The documentation is currently somewhat devoid of information about the language itself.
By @sethherr - 5 months
What is the difference between this and Haml or slim?
By @highmastdon - 5 months
I’ve used something similar quite a long time ago called Jade. Seems to be renamed to Pug. Here’s a nice writeup with some examples (not mine, found the webpage missing examples): https://www.sitepoint.com/jade-tutorial-for-beginners/
By @29athrowaway - 5 months
How does it differ from pug (jade), which has existed for about 14 years?
By @remram - 5 months
Literally how would anyone get started? No docs or even usage examples, for a new language?
By @doublerebel - 5 months
If you use indentation for nesting, the closing tags are superfluous. That’s just one of the reasons so many html/xml template langs have chosen that format.
By @reconvene1290 - 5 months
I like the closing tags (others don’t seem to) as they help with visual scanning and auto formatting. Nice project, well done!
By @efilife - 5 months
I don't need it, but upvoting just because of your dedication to the project. It also looks very nice, and the extension is a cherry on top
By @throw156754228 - 5 months
Honestly I always had a soft spot for haml. If someone wrote a haml plugin for React I would be in heaven. It's JSX that is an ugly hot mess in mature codebases, not html.