So, I found this today, and it is awesome. I wanted it in Bluecloth so I could use it in Mephisto. Here’s how.
First, I needed to make it so I could still do normal images, but turn on coolness if I want. Here’s the goal I came up with for the grammar:
[](imageurl.jpg "Scrolly Text at top" "photoslice")
Here’s the first test, with a single image:
And now a set with a namespace:
I did it by simply modifying the regex and image url parsing function in BlueCloth like so:
InlineLinkRegex = %r{\( # Literal paren
[ ]* # Zero or more spaces
<?(.+?)>? # URI = $1
[ ]* # Zero or more spaces
(?: # title
([\"\']) # Opening quote char = $2
(.*?) # Title = $3
\2 # Matching quote char
)? # Title is optional
[ ]* # Zero or more spaces
(?: # rel
([\"\']) # Opening quote char = $2
(.*?) # rel = $5
\4 # Matching quote char
)? # rel is optional
\)}x# and later...# ...or for an inline style second partelsif@scanner.scan( InlineLinkRegex )
url = @scanner[1]
title = @scanner[3]
rel = @scanner[5]
@log.debug " Found an inline link to %p" % url
text += %{<a href="%s"} % escape_md( url )
if title
title.gsub!( /"/, """ )
text += %{ title="%s"} % escape_md( title )
endif rel
rel.gsub!( /"/, """ )
text += %{ rel="%s"} % escape_md( rel )
end
I also added the following to my Mephisto theme layout, in the head section:
I decided today that I wanted to track my calories burned per day on a nice line graph. I did it, and I think I will continue. The total is automatically calculated by the PHP data source. This was made using my Mephisto Plugin for Open Flash Charts.
Today I found a nice ping list for Wordpress. I decided to put it into my copy of the Mephisto Post Pinger plugin. I’m not sure if it works yet, but this post will give it a good test.
So I made this awesome filter for Mephisto that allows you to easily embed flash videos in your post. May require tweaking if using a non-standard URL root.
So, the post pinger plugin was pretty awesome, but it was pinging RubyCorner and Rubylicious when it shouldn’t have. I made it tag-based so it checks a category of feed URL and decides whether the tag matches the category. Right now, I’ve only implemented it for the ruby tag since that’s all I should need for these two services.
I wanted to be able to click a link in my email to see the comment it talked about. So, I modified Luke Redpath’s Comment Notification Plugin to give that to me. First, I had to do some script/console action:
# app/models/article.rb, in the public section
def full_external_link
["http://", site.host, full_permalink].join("")
end
And a slight test:
Loading production environment.
>> Article.find_first.full_external_link
=> "http://www.ralree.info/2006/5/21/first-post-what-to-say"
Perfect!
Then, I just modified the view for the email a bit:
# vendor/plugins/mephisto_comment_notification/lib/views/
# comment_notifier/comment_notification.rhtml
A new comment has been posted on your blog for the article '<%= @comment.article.title %>' by <%= @comment.author %> (<%= @comment.author_email %>):
<%= @comment.article.full_external_link %>
The commenter IP address is <%= @comment.author_ip %>.
Here is the comment that was posted:
"<%= @comment.body %>"
This notification was sent using the Mephisto Comment notification plugin by Luke Redpath.
http://opensource.agileevolved.com/svn/root/rails_plugins/mephisto_comment_notification/trunk
Modified awesomely by Erik Gregg (http://www.ralree.info)
I wanted some places to get pinged when I posted. I used the mephisto_post_ping plugin, I simply changed the directory structure and class definition around:
I'm a computer programmer from Ellicott City, MD.
I go to OSCON every year, write random code, and blag about it here.
I enjoy cooking,
reviewing beer, hiking, kayaking, and watching movies and television shows.