Skip to content

Commit dee9c51

Browse files
authored
Move configuration into its own section in readme (#85)
1 parent 347d140 commit dee9c51

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

README.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ It was created by [Professional.Wiki](https://professional.wiki/) and funded by
1818
- [Usage](#usage)
1919
* [Parameters](#parameters)
2020
* [Layout CSS](#layout-css)
21-
* [Configuration](#configuration)
2221
* [Examples](#examples)
2322
+ [Options parameter](#options-parameter)
2423
+ [Using templates](#using-templates)
24+
- [PHP Configuration](#php-configuration)
2525
- [Limitations](#limitations)
2626
- [Contribution and support](#contribution-and-support)
2727
- [Development](#development)
@@ -198,7 +198,41 @@ a page rendered in the graph has at least one title icon defined, one of those t
198198
icon. If there are multiple title icons defined for the page, one will be selected in the order in which they were
199199
parsed on the page.
200200

201-
### Configuration
201+
### Examples
202+
203+
#### Options parameter
204+
205+
Array of [vis.js options](https://visjs.github.io/vis-network/docs/network/#options)
206+
207+
```
208+
{{#network:Page1 | Page2 | Page3
209+
| options=
210+
{
211+
"autoResize": true,
212+
"nodes": {
213+
"color": "lightblue",
214+
"shape": "box",
215+
"borderWidth": 3,
216+
"font": { "color": "red", "size": 17 }
217+
}
218+
}
219+
}}
220+
```
221+
222+
Wrong: `"font.color": "red"`, right: `"font": { "color": "red" }`, also right: `"font": "14 px arial red"`
223+
224+
#### Using templates
225+
226+
```
227+
{{#network: {{NetworkPages}}
228+
| class = col-lg-3 mt-0
229+
| options= {{NetworkOptions}}
230+
}}
231+
```
232+
233+
Where `NetworkPages` contains `Page1 | Page2 | Page3` and `NetworkOptions` contains `{ "nodes": { "shape": "box" } } `
234+
235+
## PHP Configuration
202236

203237
The default value of all parameters can be changed by placing configuration in "LocalSettings.php".
204238
These configuration settings are available:
@@ -282,40 +316,6 @@ internal links. To make them show up as internal links on the network graph, you
282316
setting is changed, you will need to run the `refreshLinks.php` MediaWiki maintenance script for the change to
283317
be recognized.
284318

285-
### Examples
286-
287-
#### Options parameter
288-
289-
Array of [vis.js options](https://visjs.github.io/vis-network/docs/network/#options)
290-
291-
```
292-
{{#network:Page1 | Page2 | Page3
293-
| options=
294-
{
295-
"autoResize": true,
296-
"nodes": {
297-
"color": "lightblue",
298-
"shape": "box",
299-
"borderWidth": 3,
300-
"font": { "color": "red", "size": 17 }
301-
}
302-
}
303-
}}
304-
```
305-
306-
Wrong: `"font.color": "red"`, right: `"font": { "color": "red" }`, also right: `"font": "14 px arial red"`
307-
308-
#### Using templates
309-
310-
```
311-
{{#network: {{NetworkPages}}
312-
| class = col-lg-3 mt-0
313-
| options= {{NetworkOptions}}
314-
}}
315-
```
316-
317-
Where `NetworkPages` contains `Page1 | Page2 | Page3` and `NetworkOptions` contains `{ "nodes": { "shape": "box" } } `
318-
319319
## Performance / caching
320320

321321
This extension bypasses the MediaWiki page cache. This means that your network graphs will always be up to date,

0 commit comments

Comments
 (0)