Herb is a new command-line tool and Rust library designed to improve the developer experience of working with ERB (Embedded Ruby) templates. It focuses on accurate and efficient parsing of HTML-aware ERB, addressing issues like incorrect syntax highlighting and code completion in existing tools. Herb offers features such as syntax highlighting, formatting, linting (with custom rules), and symbolic renaming within ERB templates, enabling more productive development and refactoring of complex view logic. By understanding the underlying HTML structure, Herb can provide more contextually relevant results and prevent issues common in tools that treat ERB as plain text or simple HTML. It aims to become an essential tool for Ruby on Rails developers and anyone working extensively with ERB.
The author is seeking recommendations for a Markdown to PDF conversion tool that handles complex formatting well, specifically callouts (like admonitions), diagrams using Mermaid or PlantUML, and math using LaTeX or KaTeX. They require a command-line interface for automation and prefer open-source solutions or at least freely available ones for non-commercial use. Existing tools like Pandoc are falling short in areas like callout styling and consistent rendering across different environments. Ideally, the tool would offer a high degree of customizability and produce clean, visually appealing PDFs suitable for documentation.
The Hacker News comments discuss various Markdown to PDF conversion tools, focusing on the original poster's requirements of handling code blocks, math, and images well while being ideally open-source and CLI-based. Pandoc is overwhelmingly recommended as the most powerful and flexible option, though some users caution about its complexity. Several commenters suggest simpler alternatives like md-to-pdf
, glow
, and Typora for less demanding use cases. Some discussion revolves around specific features, like LaTeX integration for math rendering and the challenges of perfectly replicating web-based Markdown rendering in a PDF. A few users mention using custom scripts or web services, while others highlight the benefits of tools like Marked 2 for macOS. The overall consensus seems to be that while a perfect solution might not exist, Pandoc with custom templates or simpler dedicated tools can often meet specific needs.
BritCSS is a humorous CSS framework that replaces American English spellings in CSS properties and values with their British English equivalents. It aims to provide a more "civilised" (British English spelling) styling experience, swapping terms like color
for colour
and center
for centre
. While functionally identical to standard CSS, it serves primarily as a lighthearted commentary on the dominance of American English in web development.
Hacker News users generally found BritCSS humorous, but impractical. Several commenters pointed out the inherent problems with trying to localize CSS, given its global nature and the established convention of using American English. Some suggested it would fragment the community and create unnecessary complexity in workflows. One commenter jokingly suggested expanding the idea to include other localized CSS versions, like Australian English, further highlighting the absurdity of the project. Others questioned the motivation behind targeting American English specifically, suggesting it stemmed from a place of anti-American sentiment. There's also discussion about the technical limitations and challenges of such an undertaking, like handling existing libraries and frameworks. While some appreciated the satire, the consensus was that BritCSS wasn't a serious proposal.
The arXiv LaTeX Cleaner is a tool that automatically cleans up LaTeX source code for submission to arXiv, improving compliance and reducing potential processing errors. It addresses common issues like removing disallowed commands, fixing figure path problems, and converting EPS figures to PDF. The cleaner also standardizes fonts, removes unnecessary packages, and reduces file sizes, ultimately streamlining the arXiv submission process and promoting wider paper accessibility.
Hacker News users generally praised the arXiv LaTeX cleaner for its potential to improve the consistency and readability of submitted papers. Several commenters highlighted the tool's ability to strip unnecessary packages and commands, leading to smaller file sizes and faster processing. Some expressed hope that this would become a standard pre-submission step, while others were more cautious, pointing to the possibility of unintended consequences like breaking custom formatting or introducing subtle errors. The ability to remove comments was also a point of discussion, with some finding it useful for cleaning up draft versions before submission, while others worried about losing valuable context. A few commenters suggested additional features, like converting EPS figures to PDF and adding a DOI badge to the title page. Overall, the reception was positive, with many seeing the tool as a valuable contribution to the academic writing process.
Summary of Comments ( 3 )
https://news.ycombinator.com/item?id=43704853
Hacker News users generally praised Herb for its innovative approach to templating, particularly its HTML-awareness and the potential for improved refactoring capabilities. Some expressed excitement about its ability to parse and manipulate ERB templates more effectively than existing tools. A few commenters questioned the long-term viability of the project given its reliance on Tree-sitter, citing potential maintenance challenges and parser bugs. Others were curious about specific use cases and integration with existing Ruby tooling. Performance concerns and the overhead introduced by parsing were also mentioned, but overall the reception was positive, with many expressing interest in trying out Herb.
The Hacker News post titled "Herb: Powerful and seamless HTML-aware ERB parsing and tooling" has generated several comments discussing the merits and potential drawbacks of the Herb tool.
Several commenters express enthusiasm for the project, praising its ability to address the challenges of working with ERB templates, particularly within complex HTML structures. One user highlights the difficulty of refactoring ERB and how Herb seems to offer a solution to this long-standing problem. Another appreciates the ability to rename components and the potential time savings this feature offers. The clean and appealing design of the website is also mentioned positively.
Some users raise concerns and questions. One commenter questions the performance implications of parsing HTML and ERB simultaneously, expressing a preference for precompiling ERB to avoid runtime parsing overhead. This sparks a discussion about the performance characteristics of various templating approaches, with another user suggesting that the performance concerns might be negligible in many real-world scenarios. The maintainability of generated code is also raised as a potential issue.
Another thread of discussion revolves around the choice of Ruby as the implementation language for Herb. One commenter expresses a desire for similar tooling in other languages, specifically mentioning Elixir. This leads to a brief discussion about the availability (or lack thereof) of comparable tools in different ecosystems.
A few users share their personal experiences and workflows related to templating languages, offering alternative approaches and suggesting potential integrations with other tools. One user mentions using a custom DSL for templates, highlighting the benefits of a domain-specific approach.
Overall, the comments reflect a generally positive reception of Herb, acknowledging its potential to improve the developer experience when working with ERB templates. However, some pragmatic concerns regarding performance and the broader applicability of the tool are also voiced.