A WYSIWYG editor for DokuWiki
All documentation for this plugin can be found at https://www.dokuwiki.org/plugin:prosemirror
If you install this plugin manually, make sure it is installed in
lib/plugins/prosemirror/
- if the folder is called different it
will not work!
Please refer to http://www.dokuwiki.org/plugins for additional info on how to install plugins in DokuWiki.
Use yarn to install the dependecies
yarn
Create a develoment bundle:
yarn dev
Automatically recreate the bundle during development:
yarn watch
Build a release
yarn build
We really recommend yarn, but npm should work, too.
action/editor.php
: HTML_EDITFORM_OUTPUT
get Instructions and render them to json
renderer.php
renderer.php
uses the classes NodeStack
Node
and Mark
in schema
to do its jobparser/
classesscript/main.js
according to the schema defined in
script/schema.js
and creates its doc
-Node from it.LinkForm.resolveSubmittedLinkData
in script/LinkForm.js
action/ajax.php
which resolves the link/images and returns
the resolved html to be rendered into Prosemirror<input>
fieldaction/parser.php
during the event ACTION_ACT_PREPROCESS
**bold __underlined and bold__**
is represented in Prosemirror's data as
[{text: "bold ", marks: [bold]}, {text: "underlined and bold", marks: [bold, underlined]}]
parser/SyntaxTreeBuilder.php
InlineNodeInterface::getStartingNodeMarkScore($markType)
and Mark::tailLength
play togethergetStartingNodeMarkScore()
to work, it needs the inline nodes inside a block node to be
chained together, so we can ask the previous node whether it has a given node or notMark::markOrder
Currently all our prosemirror scripts are in script/
.
This definietly needs some better organisation.
I can see the following possible groups:
<code>
and <file>
?commands
in general wich then can be used by menu-items and keyboard-events?These files are compiled with webpack and transpiled with Babel into lib/bundle.js
,
which is the file actually included by DokuWiki.
The central test-data is the collection of DokuWiki-Syntax and corresponding Prosemirror JSON
in _test/json/
. This data is used for three sets of tests:
_test/renderer.test.php
_test/jsonParser.test.php
script/schema.js
) in _jstest/test.js
The rendering and parsing tests are run as usual DokuWiki tests.
The javascript tests are run with yarn test
The scripts in script/
are also checked when building with eslint.
Eslint can also be run on its own with yarn eslint
.
Copyright (C) CosmoCode GmbH dokuwiki@cosmocode.de Andreas Gohr Michael Grosse Anna Dabrowska
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
See the COPYING file in your DokuWiki folder for details