jekyll / jekyll

:globe_with_meridians: Jekyll is a blog-aware static site generator in Ruby
https://jekyllrb.com
MIT License
49.24k stars 9.98k forks source link

plugin to create custom tag #192

Closed salex closed 14 years ago

salex commented 14 years ago

This is just a question.

I am probably bitting off more than I can chew but it seemed to me that it would not be that hard to create an ultraviolent code highlighter using a plugin. I could get the sample plugin on the wiki to work fine. Not being a ruby expert I then tried to go beyond my knowledge with trying to define:

{% uvhighlight %>
    code
{% enduvhighlight %>

First thing that it bulks at is it does not know what enduvhighlight tag is. Experimenting, I register that tag and clear up that error, but I have no earthly idea on how to get the code between the tags.

Trying to study the jekyll code soon gets me losts in super calls, etc. I can't seem to see how the parser get the text between highlight and endhighlight.

If you can point me in the right directions I'll go and read some more.

Steve

salex commented 14 years ago

As usual after a post seeking help, I found my own answer in that I was creating a block, not a tag. Anyhow I have a plugin for Ultraviolet working, although I don't know if it is good Ruby code.

There is a gist on github.