DEV Community

Discussion on: Pug in 5 minutes

Collapse
 
marcusatlocalhost profile image
Marcus • Edited

I love pug (since jade days) and especially the markdown filter is neat for simple content that might need some more complex html.

pugjs.org/language/filters.html

:markdown-it(linkify langPrefix='highlight-')
  # Markdown

  Markdown document with http://links.com and

  ` ` ` js
  var codeBlocks;
  ` ` `
script
  :coffee-script
    console.log 'This is coffee script'
Enter fullscreen mode Exit fullscreen mode

someone wrote an article about it here: dev.to/patarapolw/pug-with-markdow...

PS: I'm using the php pug port :D which is a bit weird, but works well.

Collapse
 
jsn1nj4 profile image
Elliot Derhay

Is the port weird or is using it in PHP weird?

Collapse
 
marcusatlocalhost profile image
Marcus

It was weird that the php port comes with the full node package - in case node is available (if I remember right) and it's weird because the handling of variables was not 100% consistent. Sometimes you had to write $var['key'] - but maybe these problems are solved now, haven't installed it for quite some time.

But else, it rocks.

Thread Thread
 
jsn1nj4 profile image
Elliot Derhay • Edited

Oh so it still requires Node to run and provides a $var array for variables? That is weird. ๐Ÿ˜•

Thread Thread
 
marcusatlocalhost profile image
Marcus

No no, it doesn't require Node at all! The information I gave was probably old or misleading.
I know their goal was to make it 100% compatible with the Node version, so I'm sure everything in the Node version, works in the php version.
github.com/pug-php/pug

Collapse
 
jh3y profile image
Jhey Tompkins

Yeah, me too! ๐Ÿ˜…

I've never really used filtering though. I'll definitely give it a look ๐Ÿ‘

I was unaware of some of the ports and packages that have come out. Yet to try out the React integration ๐Ÿ˜Ž