-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor this repo; update contact info; update js library; fix the w…
…ay to control the svg size
- Loading branch information
Showing
11 changed files
with
177 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Dokuwiki 2022-07-31 | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- "*.md" | ||
- "*.txt" | ||
- "images/*" | ||
|
||
jobs: | ||
test-on-docker: | ||
uses: "./.github/workflows/test-on-docker.yml" | ||
with: | ||
version: "2022-07-31a" | ||
source_tag: "release-2022-07-31a" | ||
docker_tag: "version-2022-07-31a" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Dokuwiki 2023-04-04 | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- "*.md" | ||
- "*.txt" | ||
- "images/*" | ||
|
||
jobs: | ||
test-on-docker: | ||
uses: "./.github/workflows/test-on-docker.yml" | ||
with: | ||
version: "2023-04-04a" | ||
source_tag: "release-2023-04-04a" | ||
docker_tag: "version-2023-04-04a" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Test on Dokuwiki Docker | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
source_tag: | ||
required: true | ||
type: string | ||
docker_tag: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test-on-docker: | ||
name: DokuWiki ${{inputs.version}} | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: flowchartjs | ||
|
||
- name: Checkout Dokuwiki | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: dokuwiki/dokuwiki | ||
ref: ${{inputs.source_tag}} | ||
path: dokuwiki | ||
|
||
- name: Test on Dokuwiki Docker | ||
run: | | ||
docker run --rm \ | ||
-v ${{github.workspace}}/dokuwiki/_test:/app/www/public/_test \ | ||
-v ${{github.workspace}}/flowchartjs:/flowchartjs \ | ||
-w /app/www/public \ | ||
linuxserver/dokuwiki:${{inputs.docker_tag}} \ | ||
bash -c " \ | ||
cp -rp /flowchartjs /config/dokuwiki/lib/plugins/flowchartjs; \ | ||
apk update; \ | ||
apk search php-tokenize |cut -f-2 -d- |xargs -n 1 apk add; \ | ||
apk search php-phar |cut -f-2 -d- |xargs -n 1 apk add; \ | ||
cd _test; \ | ||
php fetchphpunit.php; \ | ||
php phpunit.phar --stderr --verbose --group plugin_flowchartjs; \ | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,49 @@ | ||
# Flowchart Plugin for Dokuwiki | ||
# [Flowchart Plugin]((http://dokuwiki.org/plugin:flowchartjs)) for Dokuwiki | ||
|
||
All documentation for this plugin is avaliable online at [flowchartjs](http://dokuwiki.org/plugin:flowchartjs) | ||
[![2023-04-04a](https://github.com/ghbore/flowchartjs/actions/workflows/test-2023-04-04.yml/badge.svg)](https://github.com/ghbore/flowchartjs/actions/workflows/test-2023-04-04.yml) | ||
[![2022-07-31a](https://github.com/ghbore/flowchartjs/actions/workflows/test-2022-07-31.yml/badge.svg)](https://github.com/ghbore/flowchartjs/actions/workflows/test-2022-07-31.yml) | ||
|
||
**Draw flowchart (SVG) based on [flowchart.js](flowchart.js.org)** | ||
|
||
## Example | ||
The example copied from [flowchart.js](flowchart.js.org): | ||
|
||
``` | ||
<flowchartjs default> | ||
st=>start: Start|past:>http://www.google.com[blank] | ||
e=>end: End|future:>http://www.google.com | ||
op1=>operation: My Operation|past | ||
op2=>operation: Stuff|current | ||
sub1=>subroutine: My Subroutine|invalid | ||
cond=>condition: Yes | ||
or No?|approved:>http://www.google.com | ||
c2=>condition: Good idea|rejected | ||
io=>inputoutput: catch something...|future | ||
st->op1(right)->cond | ||
cond(yes, right)->c2 | ||
cond(no)->sub1(left)->op1 | ||
c2(yes)->io->e | ||
c2(no)->op2->e | ||
</flowchartjs> | ||
``` | ||
|
||
The output looks like: | ||
![](https://www.dokuwiki.org/lib/exe/fetch.php?tok=02f4a0&media=https%3A%2F%2Fimg-fotki.yandex.ru%2Fget%2F108168%2F85226599.d%2F0_c9c93_de8fec8e_orig.png) | ||
|
||
## Syntax | ||
The Basic syntax is: | ||
``` | ||
<flowchartjs style width height>...</flowchart> | ||
``` | ||
where, | ||
- *style*: This parameter refers to the chosen display style for the flowchart. At present, it offers the following options: | ||
- (blank) — no style | ||
- *default* — the default style | ||
- Alternatively, you can select from other available styles (see below about how to manage the styles) | ||
- *width* and *height*: These parameters accept CSS-style values that allow for the adjustment of the width and height of the associated SVG element. Leaving these fields blank will maintain the default measurements. | ||
- *...*: This section encompasses the flowchart definition itself, which should adhere to the grammar outlined in [flowchart.js](flowchart.js.org) | ||
|
||
## Configuration and Settings | ||
Using the **Amin Plugin**, managers can upload new flowchart styles, or update existing ones through JSON files. These files must have the *.json* extension, and the filename serving as the designated style name. Manager also can remove any styles as needed. | ||
|
||
Within the textbox, toolbar **FC** icon will insert a pair of *flowchartjs* tags, and **F<sub>c</sub><sup>s</sup>** toggles the comprehensive list of available styles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace dokuwiki\plugin\flowchartjs\test; | ||
use DokuWikiTest; | ||
|
||
/** | ||
* Render tests for the flowchartjs plugin | ||
* | ||
* @group plugin_flowchartjs | ||
* @group plugins | ||
*/ | ||
class plugin_flowchartjs_render_test extends DokuWikiTest { | ||
public function test_render(){ | ||
// print_r(plugin_list("", true)); | ||
global $plugin_controller; $plugin_controller->enable("flowchartjs"); | ||
$info = array(); | ||
$instructions = p_get_instructions("xxx<flowchartjs>\n _cfg_\n</flowchartjs>\nxxx"); | ||
// print_r($instructions); | ||
$xhtml = p_render("xhtml", $instructions, $info); | ||
// print_r($xhtml); | ||
|
||
$expected = "\n<p>\nxxx\n</p>\n<pre class='flowchartjs '>\n _cfg_\n</pre>\n<p>\nxxx\n</p>\n"; | ||
|
||
$this->assertEquals($expected, $xhtml); | ||
} | ||
} | ||
//Setup VIM: ex: et ts=4 : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
base flowchartjs | ||
author Hua GAO | ||
email gaoh@pku.edu.cn | ||
date 2021-01-15 | ||
author Hua Gao | ||
email ghbore@gmail.com | ||
date 2023-08-07 | ||
name Flowchartjs Plugin | ||
desc draw flowchart based on flowchart.js | ||
url https://www.dokuwiki.org/plugin:flowchartjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters