Using HAML or Slim outside Ruby environment with Grunt? - haml

I am a front-end developer who works with PHP developers mainly, lately I was thinking about using HAML or Slim to write the HTML templates I handle to them instead of Pure HTML.
But I know that they need Ruby/Node to be able to use them, so my question is how "if possible" can I use them with Grunt & take advantage of Loops, conditionals, etc.. without being in a Ruby environment?

There are several HAML compilers for all kins of languages. For PHP, I can recommand you to check out MtHaml, works really great, twig if you want etc.

Related

How to implement partials using HAML

We are testing HAML and SASS on a recent project to speed up our development flow.
We built the static front-end, and from here, will be integrating the source into a Wordpress build. HAML isn't going to be used in the WP integration; we only used it to rapidly build the static front-end. However, not that it matters for this question, but we're using SASS throughout the entire build and into the WP integration. We're using Prepros as the preprocessor.
So, when building in PHP, it's pretty simple to use partials to make the front-end build more organized and efficient. No problem.
But we're using HAML on this project -- as an HTML generator -- and would love to integrate the language in all future builds if we can figure everything out. And we're trying everything possible to avoid having to expand into learning Ruby and/or configuring a complex development environment.
Anyways, using the overview above, is it possible to use partials to construct layouts in HAML without over-complexing the build? I've seen many answers relating to yes--and the answers are there--but the background information and semi-documentation just happens to never be there.
If anyone could point me in the right direction, that would be absolutely amazing. Please know that I appreciate any effort and advice from the community!
Thanks again,
B

Difference between Markdown and Haml?

I am a web designer trying to improve... These last few days I had decided to study Haml and SCSS and other things, but I just discovered Markdown and now I don't understand the difference between Markdown and Haml. Do they serve the same purpose? Which of the two is better? I've read they can be combined... Maybe should I learn both tools?
Thanks in advance.
Markdown
From Markdown's syntax page.
Markdown’s syntax is intended for one purpose: to be used as a format
for writing for the web.
Markdown is not a replacement for HTML, or even close to it. ...
It is useful for writing purposes only. A fitting example is Stackoverflow. You can easily format your questions to include some basics such as a list, a header or a quote.
HAML
HAML on the other hand is used for developing websites. It provides everything HTML does in a cleaner way. This includes all HTML attributes (such as ID's & classes) and embedded Ruby code. They have a great tutorial to get a brief overview.
My experience with HAML has been great. It's clearer and simpler to use than normal HTML. I'd definitely give it a try ;)

Client-Side MVC: how to best handle same templates in different engines

I've been recently experimenting with one of the widely recommended MVC client-side frameworks (Backbone, in this case). I find it quite nice, but I have an issue with it: suppose I'm building a list of contents, which I want to present on browsers using client-side rendering, but also want to make available for search engines, which do not run javascript. That means, I'll also have to render stuff on the server-side. Now, let's say I'm using Handlebars.js, whose template language is inherited from mustache. All is well. But on the server, I'm using ERB (or HAML, whatever). That means, I'll have to support more than one version of the same template. Which is just unmaintainable, for cases where your templates going beyond the list-element 4 lines of code. How are the big platforms working around this issue?

Non-PHP CGI toolkits that support PHP-like CGI syntax?

I have some websites that use extJS with a PHP backend, and we're trying to move away from PHP entirely after a few security incidents. Due to extJS's license, there are concerns if we'd have to release the server-side code if we modified the javascript, so I'm looking instead to replace the back-end instead.
The calling syntax I'm mostly looking at is how PHP handles arrays. You might see something like:
?array[]=item1;array[]=item2;array=item3[]
rather than say, with perl's CGI.pm:
?array=item1;array=item2;array=item3
Are there CGI libraries for other languages that support this array syntax natively, or should I just hack something together myself?
(it's actually older extJS ... back when they claimed it was released under LGPL, before they posted their take on what LGPL was, which sounded nothing like what I was aware of, but we're not willing to go the legal route, I just haven't had the time to switch to some other JS library)

API for parse/update UNIX configuration files

Unix configuration files come in all shapes and forms. I know that Webmin has a Perl API that makes it easy to parse and modify most common configuration programmatically, while preserving changes that might have been made by hand.
Are there any other libraries that has similar functionality, perhaps for other languages (Python, Ruby, C, C++, etc)?
At least for Python there are numerous libraries that intends to simplify parsing. One of the simplest might be picoparse (http://github.com/brehaut/picoparse) which is constructed to provide straight forward parsing without the need of regexps.
Another one worth a look might be funcparselib (http://code.google.com/p/funcparserlib/) also for python.
If you intend to use C the most common tools for building parsers are Yacc and Flex. These tools are rather complex and has a rather high threshold before being usable.
Ajenti, an alternative for Webmin written in Python uses reconfigure.
It is not as mature and complete as Webmin and it's API, but reconfigure looks like as good an answer to this question as I am able to find.