Add sample page

This commit is contained in:
Melon Bread 2019-12-24 10:26:36 -05:00
parent aa35bcd824
commit ed923db616
2 changed files with 47 additions and 16 deletions

31
page.rst Normal file
View File

@ -0,0 +1,31 @@
TEST PAGE
============
:date: 2019-12-08 19:00
:modified: 2019-12-08 19:00
:category: Ramblings
This is a test page to test different plugins
List:
* Item
* Item
* Item
+------------+------------+-----------+
| Header 1 | Header 2 | Header 3 |
+============+============+===========+
| body row 1 | column 2 | column 3 |
+------------+------------+-----------+
| body row 2 | Cells may span columns.|
+------------+------------+-----------+
| body row 3 | Cells may | - Cells |
+------------+ span rows. | - contain |
| body row 4 | | - blocks. |
+------------+------------+-----------+
.. peertube:: peertube.social 13fde89f-5360-4020-8ea4-93eda2665b54
:width: 240
:height: 224
:loop: True

View File

@ -47,8 +47,8 @@ class PeerTube(Directive):
url = f"https://{instanceURL}/videos/embed/{videoID}?"
width = self.options["width"] if "width" in self.options else "560"
height = self.options["height"] if "height" in self.options else "315"
width = self.options["width"] if "width" in self.options else 560
height = self.options["height"] if "height" in self.options else 315
fullscreen = (
self.options["fullscreen"] if "fullscreen" in self.options else True
)
@ -57,36 +57,36 @@ class PeerTube(Directive):
muted = self.options["muted"] if "muted" in self.options else False
loop = self.options["loop"] if "loop" in self.options else False
title_show = (
self.options["title_show"] if "title_show" in self.options else True
self.options["title_show"] if "title_show" in self.options else ""
)
privacy_show = (
self.options["privacy_show"] if "privacy_show" in self.options else True
self.options["privacy_show"] if "privacy_show" in self.options else ""
)
controls_show = (
self.options["controls_show"] if "controls_show" in self.options else True
self.options["controls_show"] if "controls_show" in self.options else ""
)
iframe_arguments = [
(width, "width='{}'"),
(height, "height='{}'"),
(width, "width={}"),
(height, "height={}"),
(fullscreen, "allowfullscreen"),
(seamless, "frameborder='0'"),
]
url_arguments = [
(autoplay, "autoplay='{}'"),
(muted, "muted='{}'"),
(loop, "loop='{}'"),
(title_show, "title='{}'"),
(privacy_show, "warningTitle='{}'"),
(controls_show, "controls='{}'"),
(autoplay, "autoplay={}"),
(muted, "muted={}"),
(loop, "loop={}"),
(title_show, "title={}"),
(privacy_show, "warningTitle={}"),
(controls_show, "controls={}"),
]
for value, format in url_arguments:
toggle = 1 if value == True else 0
url += (format).format(toggle) if value else ""
embed_block = f"<iframe src={url} "
url += format.format(toggle) if value else ""
url.replace("'", "")
embed_block = "<iframe src='{}' ".format(url)
for value, format in iframe_arguments:
embed_block += (format + " ").format(value) if value else ""