plugin.rb 581 Bytes
Newer Older
François-Xavier's avatar
François-Xavier committed
1 2
# name: embed-hackmd
# about: Embed HackMD pads using Onebox.
Bernhard Fürst's avatar
Bernhard Fürst committed
3
# version: 1.0
François-Xavier's avatar
François-Xavier committed
4 5
# authors: Bernhard Fürst & LaToileScoute
# url: https://git.latoilescoute.net/dev/embed-hackmd
Bernhard Fürst's avatar
Bernhard Fürst committed
6

François-Xavier's avatar
François-Xavier committed
7
class Onebox::Engine::HackMdOnebox
Bernhard Fürst's avatar
Bernhard Fürst committed
8
  include Onebox::Engine
François-Xavier's avatar
François-Xavier committed
9
  matches_regexp /https:\/\/notes?\.latoilescoute\.net\/.+/
Bernhard Fürst's avatar
Bernhard Fürst committed
10 11 12

  # See https://github.com/ether/etherpad-lite/wiki/Embed-Parameters
  def to_html
François-Xavier's avatar
François-Xavier committed
13
    "<iframe name='embed_readwrite' src='#{@url}?both' style='border-width:0' frameborder='0' width='100%' height=800></iframe><br><a href='#{@url}?both' target='_blank'>Aller à la note</a>"
Bernhard Fürst's avatar
Bernhard Fürst committed
14 15
  end
end