From b48c72ec3d72ff26519c468c4152babfd8884443 Mon Sep 17 00:00:00 2001
From: BERTHAUT Florent <florent.berthaut@univ-lille1.fr>
Date: Tue, 10 Aug 2021 00:59:28 +0200
Subject: [PATCH] Fixed iframe in documentation

---
 README.md              | 13 +++++++++++--
 doc/img/md_to_html.lua | 16 +++++++++++++++-
 doc/index.html         |  5 +++--
 3 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 9ea440d..6cf6280 100644
--- a/README.md
+++ b/README.md
@@ -88,9 +88,18 @@ You can also ask another instrument's parameter to be set to a specific value by
 
 ![doc/img/direct_asking.gif](doc/img/direct_asking.gif)
 
-## Demo Video 
+## Demo Videos
+
+<a href="https://pod.univ-lille.fr/video/19614-bf-pd-collaboration-window/">
+	Video demoing the collaboration window in bf-pd
+	<img src="doc/img/video.png" height="300px"/>
+</a>
+
+<a href="https://pod.univ-lille.fr/video/20945-bf-pd-using-bf-clock/">
+	Video demoing bf-clock in bf-pd
+	<img src="doc/img/video_clock.png" height="300px"/>
+</a>
 
-<a href="https://pod.univ-lille.fr/video/19614-bf-pd-collaboration-window/"><img src="doc/img/video.png" height="300px"/><br/>Video demoing the collab window for bf-pd</a>.
 
 ## More resources
 
diff --git a/doc/img/md_to_html.lua b/doc/img/md_to_html.lua
index f68f936..fbdd007 100644
--- a/doc/img/md_to_html.lua
+++ b/doc/img/md_to_html.lua
@@ -11,7 +11,21 @@ end
 
 function RawInline (raw)
 	if raw.format == 'html' then 
-		return pandoc.RawInline('html', string.gsub(raw.text, "doc/img", "img"))
+		txt = raw.text
+		if string.find(txt, "<a") then 
+			txt = ""
+		end
+		if string.find(txt, "</a>") then
+			txt = ""
+		end
+		if string.find(txt, "img/video.png") then
+			txt = "<iframe src=\"http://pod.univ-lille.fr/video/19614-bf-pd-collaboration-window/?is_iframe=true\" width=\"640px\" height=\"360px\" allowfullscreen></iframe>"
+		end
+		if string.find(txt, "img/video_clock.png") then
+			txt = "<iframe src=\"https://pod.univ-lille.fr/video/20945-bf-pd-using-bf-clock/?is_iframe=true\" width=\"640px\" height=\"360px\" allowfullscreen></iframe>"
+		end
+		txt = string.gsub(txt, "doc/img", "img")
+		return pandoc.RawInline('html', txt)
 	end
 end
 
diff --git a/doc/index.html b/doc/index.html
index e7642e7..38ae7d5 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -91,8 +91,9 @@
 <figure>
 <img src="img/direct_asking.gif" alt="" /><figcaption>doc/img/direct_asking.gif</figcaption>
 </figure>
-<h2 id="demo-video">Demo Video</h2>
-<p><a href="https://pod.univ-lille.fr/video/19614-bf-pd-collaboration-window/"><img src="img/video.png" height="300px"/><br/>Video demoing the collab window for bf-pd</a>.</p>
+<h2 id="demo-videos">Demo Videos</h2>
+<p> Video demoing the collaboration window in bf-pd <iframe src="http://pod.univ-lille.fr/video/19614-bf-pd-collaboration-window/?is_iframe=true" width="640px" height="360px" allowfullscreen></iframe> </p>
+<p> Video demoing bf-clock in bf-pd <iframe src="https://pod.univ-lille.fr/video/20945-bf-pd-using-bf-clock/?is_iframe=true" width="640px" height="360px" allowfullscreen></iframe> </p>
 <h2 id="more-resources">More resources</h2>
 <p>Documentation for each of the user objects in bf-pd can be found in <a href="objects.html">objects.md</a> and on help patches directly in PureData (right-click an object -&gt; Help)</p>
 <p>The <em>BOEUF conceptual framework</em> describes the <em>modes of collaboration</em> used in musical collaboration and describes a set of <em>components</em> for realizing these modes in a software framework. Bf-pd is based on this framework. More info can be found in <a href="boeuf.html">boeuf.md</a>.</p>
-- 
GitLab