Not logged in. · Lost password · Register
Forum: General Help and Support Development RSS
First steps in plugin development: a Go player page
Avatar
cleinias #1
Member since Jan 2019 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: First steps in plugin development: a Go player page
I am completely new to Dokuwiki and I am trying to put togother a personal site that should include records of go games. There is a wonderful javascript library and a player built on top of it, WGo.js (http://wgo.waltheri.net/player), so I am hoping writing a plugin that allows he creation of a page containing the player should not be too difficult.

However, I am so new to Dokuwiki and its jargon that I got stumped on the first page of the development manual's plugin section. The page lists seven kinds of allowed plugins, and I an not clear where to look for further help.

Here is how, according to WGo.js docs, you can embed a go player in a page that load a game record in sgf format (game.sgf) (assuming the relevant js files are accessible):

<!-- Activating a player using HTML -->
<div data-wgo="game.sgf" style="width: 700px">
  Sorry, your browser doesn't support WGo.js. Download SGF <a href="game.sgf">directly</a>.
</div>

Pretty simple, and it works remarkably well. I wonder which of the listed kinds of plugin would allow me to create a page that renders that code?
Perhaps a kind soul would point me toward an existing plugin performing a similar task for inspiration (and shameless copying)?
Avatar
cziehr #2
Member since Jan 2011 · 591 posts · Location: 10119 Berlin
Group memberships: Members
Show profile · Link to this post
You can write a syntax-plugin, but it is also possible to include HTML into pages, which would be much easier than writing a plugin as a rookie: https://www.dokuwiki.org/config:htmlok

This can be a security risk, but if you are the only editor, this is no problem. And even if you have other editors which you don‘t trust, there are alternative solutions to put code safely on pages.

But maybe the built-in possibilty to integrate HTML allows all what you want.
Avatar
cleinias #3
Member since Jan 2019 · 6 posts
Group memberships: Members
Show profile · Link to this post
Thanks for the suggestion, inserting raw HTML might work.

One more question: where does Dokuwiki look for auxiliary javascript files? Is there a default location or does one have to be registered?
Avatar
cziehr #4
Member since Jan 2011 · 591 posts · Location: 10119 Berlin
Group memberships: Members
Show profile · Link to this post
You can define them in the file /conf/meta.html, as you would do it in the HTML-head.
If /conf/meta.html doesn‘t exist, create it.
Avatar
cleinias #5
Member since Jan 2019 · 6 posts
Group memberships: Members
Show profile · Link to this post
Sorry for the dumb question, but would that be

1) /var/lib/dokuwiki/conf/meta.html
or
2) /etc/webapps/dokuwiki/conf/meta.html

?

Looks like /var/lib has data, plugin codes and templates, while all the app logic is in /etc/webapps, so I would say (2), but since the plugins are in (1)...
Avatar
cziehr #6
Member since Jan 2011 · 591 posts · Location: 10119 Berlin
Group memberships: Members
Show profile · Link to this post
/etc/webapps/dokuwiki/conf/meta.html is the right place ;-)
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-08-25, 18:03:13 (UTC +02:00)