From: danixland Date: Wed, 4 Jul 2018 13:21:19 +0000 (+0200) Subject: initial import X-Git-Url: https://git.danix.xyz/?p=danixland-asciinema.git;a=commitdiff_plain;h=131808ed204725baf7456808538e85be7e8fd1fc initial import --- 131808ed204725baf7456808538e85be7e8fd1fc diff --git a/danixland-asciinema.php b/danixland-asciinema.php new file mode 100644 index 0000000..a59ad69 --- /dev/null +++ b/danixland-asciinema.php @@ -0,0 +1,42 @@ +asciinema.org +Plugin URI: http://danixland.net/?p=3525 +Version: 0.1 +Author: Danilo 'danix' Macrì +Author URI: http://danixland.net +License: GPL2 +License URI: https://www.gnu.org/licenses/gpl-2.0.html +*/ + +/* + * The actual video displayed using a shortcode + * @since 0.1 + */ +function dnxasc_display_video( $atts ) { + // Attributes + extract( shortcode_atts( + array( + 'video' => '22124', + 'time' => '0', + 'autoplay' => false, + 'loop' => false, + 'speed' => 1, + 'theme' => 'monokai' + ), $atts ) + ); + + $autoplay = ( 0 != $time ) ? true : false; + $videoscript = ''; + + return $videoscript; +} +add_shortcode( 'asciinema', 'dnxasc_display_video' ); diff --git a/index.php b/index.php new file mode 100644 index 0000000..cb66473 --- /dev/null +++ b/index.php @@ -0,0 +1 @@ +Directory Access Prohibited'); ?> \ No newline at end of file diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..d1e4c29 --- /dev/null +++ b/readme.txt @@ -0,0 +1,76 @@ +=== danixland-asciinema === + +Contributors: danixland +Donate link: http://danixland.net +Tags: asciinema, shortcode, video +Requires at least: 3.0.1 +Tested up to: 4.4 +Stable tag: 0.1 +License: GPLv2 or later + +This plugin adds a shortcode that displays a video from asciinema.org. + +== Description == + +danixland-asciinema is a plugin that adds a new shortcode to be used whenever you want to embed a video from asciinema.org. + +As stated on their website, asciinema (formerly ascii.io) is a free and open source solution for recording terminal sessions and sharing them on the web. +It aims to be a "go to" place for every command-line user who wants to share their skills with others. Or putting it differently, it's a place to show off your geekiness. + +I decided to make this plugin because I was looking for a good and easy way to share a video from asciinema and I'm too lazy to dwelve into oEmbed :-D + +== Installation == + +Installing danixland-asciinema is straightforward and requires just a few seconds: + +If you use the **"Add New Plugin"** pane from your dashboard just install it and activate it, nothing to configure here, just go ahead and use it. +Otherwise follow these steps: + +1. Download the latest version of the plugin. +1. If using the "Install Plugins->Upload" section on the WordPress admin area just upload the zip file, otherwise unpack the zip file and upload the **"danixland-asciinema"** directory inside the "wp-content/plugins" directory of your WordPress installation using your favourite ftp client. +1. Activate the plugin through the 'Plugins' menu in WordPress and you're ready to go!! + +== Frequently Asked Questions == + += What are the options that I can use with the shortcode? = + +The most important option is the "video" which you can assign to the number of the video you want to embed, let's say you want to embed `https://asciinema.org/a/14829` the shortcode whould be `[asciinema video=14829]` +The full list of options is: + +* video +* time +* autoplay +* loop +* speed +* theme + +You can read about their usage [on the website](https://asciinema.org/docs/embedding). + += I'm stuck with your plugin and don't seem to be able to customize it/make it work, can you help me? = + +Of course, you can ask for help on [the forums](http://wordpress.org/support/) or write a comment on the main article for this plugin on [my site](http://danixland.net/?p=3525), I'll reply ASAP ;) + += I'd like this plugin to be translated in my language, can you do this for me? = + +This plugin doesn't output any text other than the video code, so it doesn't provide/need a translation ;) + +####If you have any other questions feel free to ask + +== Screenshots == + +1. The shortcode with few options as seen in the admin area of the website +2. A sample video displayed in single view with the TwentyFifteen theme + +== Changelog == + += 0.1 = +* This is the first version of the plugin. + +== Upgrade Notice == + +Thank you Mario! But our princess is in another castle! + +== ToDo list == + +List is actually empty, but I'm open to suggestions. +