Introducing CodeMirror OSF mode

Shownotes in the context of Podcasts are a simple but suitable method to supply related information to the listener. One approach is the Open Show Notes Format which covers a few application fields.

As it name says, CodeMirror OSF mode, is a mode for CodeMirror which highlights OSF documents. The mode is thought to address people that usually write or edit Shownotes.


Install

This CodeMirror mode is available once you have included the osf.js file in your document. Then, all you have to do is to select this mode in codemirror. Somehow like this:

The official CodeMirror site features lots of information about how to use CodeMirror.


Demo


Download

CodeMirror OSF mode is released under the MIT license.

Fork on GitHub Download

DasDev – iOS-Dev stuff

My name is Dominik Hauser. I am an iOS developer. There is so much I have to learn. This blog is about the learning.

Neues Blog von Dominik. Sollte man mal im Auge behalten – Könnte interessant werden.

Get the Flattr WordPress plugin ready for HTML5

If you are using the Flattr WordPress plugin you can choose between three different modes of button presentation:

  • Dynamic javascript version
  • Static image version
  • Static text version

If you choose one of the static variants everything is fine using HTML5 markup. Now, if you choose the Dynamic javascript version this will result in an non-valid source code. The reason for that is that the rel attribute is no longer supported in HTML5, what is also said on the Flattr website. However, the fix for that issue is quite simple. Just replace the function getButtonCode (line 644) in the flattr.php in the plugins directory. Note that I don’t check for empty values for the category and the tags field anymore, as my workflow does not include empty categories or tags.

Now your markup should be valid.

Simple Chart.js

Please see Version 1.0 in the WordPress.org repository for current version of enigma Chart.js!

The plugin is no longer maintained and is removed from the WordPress.org repository.

Introduction

As I was searching for a wordpress plugin, offering an easy implementation plotted data I found many different approaches. However, those were on the one hand commercially available or on the other hand hard to work with. The Simple Chart.js plugin offers you a simple way to include and plot your data with six different kind of graphs. The plugin itself is based on the famous Chart.js library by Nick Drownie.

Features

At the moment the plugin gives a basic functionally.

  • Choose from six different graphs to plot your data (metric)
  • Beside settings the plugins offers the full Chart.js experience (colors, labels…)
  • The graphs will use the default settings as given by Chart.js (For modification see the Chart.js documentation)
  • As Chart.js does not support legends yet, this is not included. However, this will be included in a future release

Other features will be included in further releases.

How to Use

The syntax itself is quite simple:

[chart TYPE DATA]

Current available types are: pie, bar, line, doughnut, polar and radar as provided by Chart.js. As each type of graph has different requirements there currently two groups of graphs which need different syntax for inserting data.

The first group consists of the types: pie, doughnut and radar. The insertion is quite simple for these ones:

{VALUE:COLOR,VALUE:COLOR,VALUE:COLOR}

For each value a color will be attributed. Colors can be inserted as described in the Chart.js documentation. Plotting some data with a pie, polar or doughnut chart could look like this:

Your code for the pie chart would be (ignore the space before the „chart“):

[ chart pie {58.1:#1bd081,30.17:#e0cb1e,11.73:#19a694}]

For the types line and polar things are a little bit more complicated due to the required labels. Here the data syntax consists of different elements:

{LABELS [fillColor;strokeColor;pointColor;pointStrokeColor||DATA|fillColor2;strokeColor2;pointColor2;pointStrokeColor2|DATA2]}

The data insertion starts with a ; separated list of the labels. Data and colors are then within squared brackets. Note the space between the labels and the first bracket. Also note that no spaces are used in LABELS or any other list of ; separated values. Spaces in labels will be a feature in future releases.

The line graph, for instance, would be resulted by (ignore the space before the „chart“):

[ chart line {1;2;3;4;5 [#FFFFFF;#CDCDCD;#CCCCCC;#000000|10;20;30;80;90||#ff3600;#CDCDCD;#000;#CCC|20;30;10;0;90]}]

The last available kind of graph is the bar chart. The syntax only slightly differs from the line or the polar graph. Here the pointColor and pointStrokeColor are not available. For instance,

[ chart bar {1;2;3;4;5 [#FFFFFF;#CDCDCD|10;20;30;80;90||#ff3600;#CDCDCD|20;30;10;0;90]}]

would result in this (ignore the space before the „chart“):

Known issues

You absolutely need to stick to the format when requesting a chart. It is not known or tested what happens if a wrong input is used. It is also known that there are some issues with the „wp-markdown“ plugin. For some reason there is an issue with random addition of backslashs to squared brackets. However, this is caused by the wp-markdown plugin and not by „Simple Chart.js“.

Download

The plugin is no longer maintained.

Bug reporting & feature requests

Please use any of the provided ways on this website to contact me for reporting bugs or requesting features.