selfthinker / dokuwiki_plugin_abc Goto Github PK
View Code? Open in Web Editor NEWABC Plugin for DokuWiki: Displays sheet music (input ABC, output PNG, MIDI and PDF)
Home Page: http://www.dokuwiki.org/plugin:abc
ABC Plugin for DokuWiki: Displays sheet music (input ABC, output PNG, MIDI and PDF)
Home Page: http://www.dokuwiki.org/plugin:abc
First of all, thank you for developing this plugin, it allowed me to use my wiki the way I didn't hope for. Unfortunately, it didn't work for me out-of-the-box. I've never developed a DokuWiki plugin before, so it took me some time to figure it out, but finally I discovered that the problem is PHP version-related. The plugin uses preg_match
with /e
modifier for extracting ID and title needed to generate image name, but /e
modifier has been deprecated since PHP 5.5 and removed in 7.0. Failing to extract these pieces of information, the resulting image name is broken and so is the rendered HTML.
The solution seems to be pretty simple - remove /e
modifier. With this little change it works flawlessly for my version of PHP (7.3) and from what I read, the modifier is completely meaningless in preg_match
function anyway, so it should be compatible with older versions as well. I can create a pull request if there is anybody who can review it and eventually merge too.
Use dbg() and $conf['allowdebug'] for debugging.
Use the ml() and/or mediaFN() functions for getting URLs for media (images, pdf, etc).
Add the timestamp through those as well and explain in a comment.
DW: Detritus, PHP: 7.0.2, abcm2ps-8.10.1
$conf['im_convert'] = '/usr/bin/convert';
$conf['plugin']['abc']['displayErrorlog'] = 1;
$conf['plugin']['abc']['abc2ps'] = '/usr/local/bin/abcm2ps';
$conf['plugin']['abc']['params4img'] = '';
It is not a software bug as such, rather a design problem leading to the bug.
In the test case when author A working on page A embedding musical excerpt with X:1 and T:Name and author B working on the page B in the same namespace embedding a different musical excerpt with different contents and X:1 and T:name, who saves last overwrites previous authors content.
It is easily possible to have X and T identical for the different musical excerpts with different contents.
The ABC specification is that the X: (reference number) field is used to assign to each tune within a tunebook a unique reference number.
A T: (title) field must follow immediately after the X: field; it is the human identifier for the tune.
Authors publishing for example orchestral excerpt cannot assign any X, no such X exist (yet it must be present according to specs), at best they can number the number of excerpts on the page (starting with 1). At the same time different authors can work on the orchestral excerpt from the same piece (with different contents but the same title) on different pages.
abc plugin creates filename of the png file using X and T and that is not enough; the above scenario is easily reproducible, workaround none. Solution would be to add another parameter to the filename such as the name of the page from which the excerpt was created.
A side note: All the excerpts are saved in the namespace defined in mediaNS. In case of big number of excerpts it might lead to problems in the future.
Implement Flash from http://tech.groups.yahoo.com/group/abcusers/message/1009
(First ask Willem if it is possible to Open Source his script or make it otherwise available.)
Make it optional either through the config or through user choice. If Flash and/or JavaScript is not available, show the usual png.
Either change the use of the $_REQUEST variable to $INPUT or check if it's possible to check for the purge differently.
Implement abcjs [https://github.com/paulrosen/abcjs] as
a) a visual help while editing a tune
b) optional configurable output instead of the png
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.