Holger Frey
7 years ago
4 changed files with 100 additions and 40 deletions
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
PageRevisionMacro |
||||
================= |
||||
|
||||
Show the current page name and revision number on a moinmoin wiki page |
||||
|
||||
|
||||
Usage on a MoinMoin wiki page |
||||
----------------------------- |
||||
|
||||
Adding this macro `<<PageRevision>>` to the page will output |
||||
'SomeWikiPage, revision 123' |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
# -*- coding: iso-8859-1 -*- |
||||
u''' |
||||
MoinMoin - PageRevision macro Version 0.1 |
||||
Displays the revision number of the current MoinMoin page |
||||
|
||||
<<PageRevision>> |
||||
|
||||
Repository for the macro: |
||||
https://git.cpi.imtek.uni-freiburg.de/holgi/PageRevisionMacro |
||||
|
||||
@copyright: 2018 by Holger Frey |
||||
@license: Beerware license |
||||
|
||||
''' |
||||
|
||||
from MoinMoin import wikiutil |
||||
|
||||
|
||||
def macro_PageRevision(macro): |
||||
request = macro.request |
||||
_ = request.getText |
||||
|
||||
revision = request.page.current_rev() or '' |
||||
html = '<em>%s, revision %s</em>' % (request.page.page_name, str(revision)) |
||||
|
||||
return macro.formatter.rawHTML(html) |
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
YouTubeVideoMacro |
||||
================= |
||||
|
||||
A macro for the MoinMoin wiki for displaying embedded YouTube videos. |
||||
|
||||
There is already a [YouTube macrco][ytm] available on the website of the |
||||
[MoinMoin wiki][moin] software. Unfortunately the last update was in 2011. |
||||
While it still works with the current MoinMoin version, the embedding relies |
||||
on old [YouTube][yt] apis and still requires Flash. |
||||
|
||||
To simply embed single videos on an wiki page, this new plugin was written. |
||||
Although it has not the same features as the old one, it can be used to displaying |
||||
a single video on a wiki page. |
||||
|
||||
|
||||
Installation |
||||
------------ |
||||
|
||||
To install the macro, copy the file `YoutubeVideo.py` into the |
||||
`/path_to_wiki_instance/data/plugin/macro` directory. This method should |
||||
survive a MoinMoin or Python upgrade. Make shure, that the file has |
||||
the right ownership and permissions. |
||||
|
||||
|
||||
Usage |
||||
----- |
||||
|
||||
On a MoinMoin wiki page, you can embed a video by calling the macro with a |
||||
YouTube video id: |
||||
|
||||
<<Youtube(KYeMAfXrask)>> |
||||
|
||||
Optionally you can also provide a width and / or height parameter for the |
||||
video: |
||||
|
||||
<<Youtube(KYeMAfXrask, width=560, height=315)>> |
||||
|
||||
|
||||
Remark |
||||
------ |
||||
|
||||
To respect user privacy (insofar this is possible with embedded content), the |
||||
domain `https://www.youtube-nocookie.com/` is used and related videos will not |
||||
be displayed at the end of the video. |
||||
|
||||
|
||||
|
||||
[ytm]: https://moinmo.in/MacroMarket/YouTube |
||||
[moin]: https://moinmo.in/ |
||||
[yt]: https://www.youtube.com/ |
Loading…
Reference in new issue