Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
extended_markdownizer
Advanced tools
#Extended Markdownizer
A simple gem for Rails 3 to render some ActiveRecord text field as Markdown!
Based on Markdownizer, by Txus.
It mixes CodeRay and RDiscount to give you awesome code highlighting :)
Besides that:
You can check the generated Rocco documentation on the project page.
##Install
In your Gemfile:
gem 'extended_markdownizer'
If you want code highlighting, you should run this generator too:
rails generate extended_markdownizer:install
This will place a extended_markdownizer.css file in your public/stylesheets
folder.
You will have to require it manually in your layouts, or through jammit
, or
whatever.
In your model, let's say, Post:
class Post < ActiveRecord::Base
extended_markdownize! :body
# In this case we want to treat :body as markdown.
# You can pass an options hash to the code renderer, such as:
#
# extended_markdownize! :body, :line_numbers => :table
#
end
Extended Markdownizer needs an additional field (:rendered_body
), which you should
generate in a migration. (If the attribute was :some_other_field
, it would need
:rendered_some_other_field
!) All these fields should have the type :text
.
You save your posts with markdown text like this:
Post.create body: """
# My H1 title
Markdown is awesome!
## Some H2 title...
{% code ruby %}
{% caption 'This caption will become an h5 and also a property of the enclosing div' %}
{% highlight [1,2,3] %} <- this will highlight lines 1, 2 and 3 (it accepts a Range as well)
# All this code will be highlighted properly! :)
def my_method(*my_args)
something do
. . .
end
end
{% endcode %}
"""
And then, in your view you just have to call <%= raw @post.rendered_body %>
:)
##TODO
Markdown: Copyright (c) 2011 Codegram. See LICENSE for details. Extended Markdown: Copyright (c) 2011 José M. Gilgado
FAQs
Unknown package
We found that extended_markdownizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.