Browse Source

renamed repository

- added separate readme for YouTubeVideo macro
- merged PageRevision macro
master
Holger Frey 7 years ago
parent
commit
1ee4ff0e48
  1. 11
      PageRevision.md
  2. 26
      PageRevision.py
  3. 53
      README.md
  4. 50
      YouToubeVideo.md

11
PageRevision.md

@ -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'

26
PageRevision.py

@ -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)

53
README.md

@ -1,49 +1,22 @@ @@ -1,49 +1,22 @@
YouTubeVideoMacro
=================
MoinMoin Macros
================
A macro for the MoinMoin wiki for displaying embedded YouTube videos.
A collection of macros for the [MoinMoin][moin] wiki software.
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.
Available Macros
----------------
- [YouTubeVideo](YouTubeVideo,md):
Embed a single YouTube video on a wiki page
- [PageRevision](PageRevision.md):
show the full page name and revision number of 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 will
propably survive a MoinMoin or Python upgrade. Make shure, that the file has
To install a macro, copy the python file (`<macro name>.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/

50
YouToubeVideo.md

@ -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…
Cancel
Save