Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • librehosters/embed-codimd
  • yala/embed-codimd
2 results
Show changes
Commits on Source (2)
# Change Log
## [UNRELEASED]
## 0.1.1 -- 2019-01-26
(nothing yet)
- switch to degrowth.net instances
## 0.1.0 -- 2018-11-14
......
# Embed codimd pads into Discourse for libreho.st
# Embed codimd pads into Discourse for degrowth.net
This allows you to embed libreho.st pads into discourse. It is based on https://github.com/fuerst/embed-etherpad-lite which embeds pads into posts using the Onebox mechanism.
This allows you to embed degrowth.net pads into discourse. It is based on https://github.com/fuerst/embed-etherpad-lite which embeds pads into posts using the Onebox mechanism.
# Usage
**This is meant to use with <https://talk.libreho.st>. You need to fork and adapt to your case.**
**This is meant to use with <https://agora.degrowth.net>. You need to fork and adapt to your case.**
After installation just insert codimd links into your Discourse posts or comments. The pad will be embedded using the famous and beloved [IFRAME](https://en.wikipedia.org/wiki/HTML_element#Frames) tag and is fully operational.
......@@ -15,7 +15,7 @@ Read [Install a Plugin](https://meta.discourse.org/t/install-a-plugin/19157) at
The configuration line you have to add to your container's app.yml file looks like:
```
- git clone https://lab.libreho.st/librehosters/embed-codimd.git
- git clone https://lab.libreho.st/yala/embed-codimd.git
```
# Details
......
# name: embed-codimd
# about: Embed codimd pads using Onebox. Based on https://github.com/fuerst/embed-etherpad-lite
# version: 0.1
# author: realitygaps
# url: https://lab.libreho.st/librehosters/embed-codimd
# about: Embed codimd pads using Onebox. Based on https://lab.libreho.st/librehosters/embed-codimd
# version: 0.1.1
# author: yala
# url: https://lab.libreho.st/yala/embed-codimd
class Onebox::Engine::CodimdOnebox
include Onebox::Engine
# we only want to match for a specific codimd domain
matches_regexp %r{\Ahttps://pad\.libreho\.st/}
matches_regexp %r{\Ahttps://pad\.degrowth\.net/}
def to_html
"<iframe name='embed_readwrite' src='#{@url}' style='border-width:0' frameborder='0' scrolling='no' width='100%' height=600></iframe><br><a href='#{@url}' target='_blank'>Goto this Pad</a>"
"<iframe name='embed_readwrite' src='#{@url}' style='border-width:0' frameborder='0' scrolling='no' width='100%' height=600></iframe><br /><a href='#{@url}' target='_blank'>Visit this pad.</a>"
end
end