mirror of
https://github.com/Leaflet/Leafdoc.git
synced 2025-08-15 23:08:29 +00:00
WIP: JS identifiers with _ and $; WIP on "relationship" directive
This commit is contained in:
47
README.md
47
README.md
@ -98,16 +98,17 @@ the `🍂alternative` directive after to re-defining the documentable, e.g.:
|
||||
Adds the function `fn` as an event handler for the `type` event.
|
||||
|
||||
🍂alternative
|
||||
🍂method on(types: String, fn: Function): this
|
||||
🍂method on(types: [String], fn: Function): this
|
||||
Given an array of event types (strings), attaches `fn` as an event handler to each of them.
|
||||
*/
|
||||
```
|
||||
In this example, the two alternatives are `on(type, fn)` and `on(fnMap)`. They will be shown as two different documentables.
|
||||
|
||||
* `🍂inherits (parent)` means that a class or namespace inherits all documentables
|
||||
* `🍂inherits [parent]` means that a class or namespace inherits all documentables
|
||||
from another class or namespace.
|
||||
* `🍂relationship [relationshiptype] [namespace] ()` is specific to thegraphviz
|
||||
* `🍂uninheritable` is applied only to *sections*, and hides them from the
|
||||
documentation of children classes.
|
||||
* `🍂miniclass [name] [(parentname)]` defines a class/namespace that shall display *inside* the parent namespace (specified between parentheses); most useful for very concide classes/data structs that are useful only within the context of the parent namespace.
|
||||
|
||||
### Shorthand syntax
|
||||
|
||||
@ -174,6 +175,44 @@ You can specify everything (name, optional, params, type, default), but no docum
|
||||
| constructor | X | | |
|
||||
| factory | X | | |
|
||||
|
||||
### Relationships format
|
||||
|
||||
Relationships are meaningful for class diagrams. They correspond with the UML class diagram
|
||||
|
||||
The syntax is:
|
||||
```
|
||||
🍂relationship type namespace [ ,cardinalityFrom [ ,cardinalityTo [ ,label ]]]
|
||||
```
|
||||
|
||||
The following relationship `type`s are implemented:
|
||||
- `associated`
|
||||
- `implements`
|
||||
- `dependsOn`
|
||||
- `aggregationOf`
|
||||
- `compositionOf`
|
||||
|
||||
Note that class inheritance is a separate directive (`🍂inherits`) .
|
||||
|
||||
`namespace` must be an identifier; `cardinalityFrom` and `cardinalityTo` must not have commas in them.
|
||||
|
||||
Some examples of how `🍂relationship` works:
|
||||
|
||||
```
|
||||
🍂namespace ConcreteClass
|
||||
🍂relationship implements AbstractClass
|
||||
```
|
||||
|
||||
```
|
||||
🍂namespace Classroom
|
||||
🍂relationship aggregationOf Student, 0..n, 1..n
|
||||
🍂relationship aggregationOf Teacher, 1, 0..n
|
||||
```
|
||||
|
||||
```
|
||||
🍂namespace Caller
|
||||
🍂relationship associated Callee ,, calls
|
||||
```
|
||||
|
||||
|
||||
### Output customization
|
||||
|
||||
@ -247,7 +286,7 @@ full text at https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
|
||||
### I'm using Debian and I cannot see the leaf character!
|
||||
|
||||
Run `apt-get install ttf-ancient-fonts` and don't ask why the fallback file for emojis is packaged as "ancient fonts".
|
||||
Run `apt-get install fonts-symbola`.
|
||||
|
||||
### I cannot type 🍂 in my keyboard!
|
||||
|
||||
|
@ -1,4 +1,8 @@
|
||||
|
||||
# 2.0.1 (2020-09-08)
|
||||
|
||||
* Tweak the `bin` field in package.json
|
||||
|
||||
# 2.0.0 (2020-09-04)
|
||||
|
||||
* Support for multiple languages (tests now include java, ruby); this is done via deprecation of the comment block regexes in favour of `multilang-extract-comments`
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "leafdoc",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"description": "A lightweight NaturalDocs-like LeafletJS-style documentation generator",
|
||||
"main": "dist/leafdoc.cjs.js",
|
||||
"browser": "dist/leafdoc.browser.js",
|
||||
|
@ -1,8 +1,8 @@
|
||||
digraph ClassDiagram {
|
||||
node [shape=plaintext]
|
||||
edge [arrowhead=onormal];
|
||||
edge [arrowhead=empty];
|
||||
|
||||
ChildClass [ label = <<TABLE CELLSPACING="0">
|
||||
"ChildClass" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>ChildClass</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
childMethod(<String> foo):this
|
||||
@ -13,8 +13,9 @@ childMethod(<String> foo):this
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
ChildClass -> ParentClass
|
||||
ParentClass [ label = <<TABLE CELLSPACING="0">
|
||||
"ChildClass" -> "ParentClass"
|
||||
|
||||
"ParentClass" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>ParentClass</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
parentMethod(<Boolean> bar):this
|
||||
@ -27,4 +28,5 @@ parentMethod(<Boolean> bar):this
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
digraph ClassDiagram {
|
||||
node [shape=plaintext]
|
||||
edge [arrowhead=onormal];
|
||||
edge [arrowhead=empty];
|
||||
|
||||
ChildClass [ label = <<TABLE CELLSPACING="0">
|
||||
"ChildClass" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>ChildClass</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
childMethod(<String> foo):this
|
||||
@ -13,8 +13,9 @@ childMethod(<String> foo):this
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
ChildClass -> ParentClass
|
||||
ParentClass [ label = <<TABLE CELLSPACING="0">
|
||||
"ChildClass" -> "ParentClass"
|
||||
|
||||
"ParentClass" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>ParentClass</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
parentMethod(<Boolean> bar):this
|
||||
@ -27,4 +28,5 @@ parentMethod(<Boolean> bar):this
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -46,6 +46,7 @@
|
||||
"inherits": [
|
||||
"ParentClass"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "childclass"
|
||||
},
|
||||
"ParentClass": {
|
||||
@ -93,6 +94,7 @@
|
||||
}
|
||||
},
|
||||
"inherits": [],
|
||||
"relationships": [],
|
||||
"id": "parentclass"
|
||||
}
|
||||
}
|
||||
}
|
@ -53,6 +53,7 @@
|
||||
}
|
||||
},
|
||||
"inherits": [],
|
||||
"relationships": [],
|
||||
"id": "math"
|
||||
}
|
||||
}
|
||||
}
|
@ -90,6 +90,7 @@
|
||||
}
|
||||
},
|
||||
"inherits": [],
|
||||
"relationships": [],
|
||||
"id": "singletonobject"
|
||||
}
|
||||
}
|
@ -307,6 +307,7 @@
|
||||
}
|
||||
},
|
||||
"inherits": [],
|
||||
"relationships": [],
|
||||
"id": "domevent"
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
digraph ClassDiagram {
|
||||
node [shape=plaintext]
|
||||
edge [arrowhead=onormal];
|
||||
edge [arrowhead=empty];
|
||||
|
||||
Map [ label = <<TABLE CELLSPACING="0">
|
||||
"Map" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>Map</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
panTo(<LatLng> latlng):this
|
||||
@ -20,8 +20,9 @@ getZoom():Number
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
Map -> Evented
|
||||
Evented [ label = <<TABLE CELLSPACING="0">
|
||||
"Map" -> "Evented"
|
||||
|
||||
"Evented" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>Evented</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
on(<String> evtype, <Function> handler):this
|
||||
@ -35,8 +36,9 @@ off(<String> evtype, <Function> handler):this
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
Evented -> Class
|
||||
Class [ label = <<TABLE CELLSPACING="0">
|
||||
"Evented" -> "Class"
|
||||
|
||||
"Class" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>Class</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
extend(Object):Class
|
||||
@ -56,7 +58,8 @@ options:Object<BR align="left" />
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
Layer [ label = <<TABLE CELLSPACING="0">
|
||||
|
||||
"Layer" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>Layer</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
addTo(<Map> map):this
|
||||
@ -76,16 +79,18 @@ getAttribution():String
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
Layer -> Evented
|
||||
Marker [ label = <<TABLE CELLSPACING="0">
|
||||
"Layer" -> "Evented"
|
||||
|
||||
"Marker" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>Marker</B></TD></TR>
|
||||
|
||||
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
Marker -> Layer
|
||||
TileLayer [ label = <<TABLE CELLSPACING="0">
|
||||
"Marker" -> "Layer"
|
||||
|
||||
"TileLayer" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>TileLayer</B></TD></TR>
|
||||
<TR><TD><I>Options</I><BR/>
|
||||
minZoom:<Number> = 0
|
||||
@ -109,8 +114,9 @@ getTileUrl(<Object> coords):
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
TileLayer -> GridLayer
|
||||
GridLayer [ label = <<TABLE CELLSPACING="0">
|
||||
"TileLayer" -> "GridLayer"
|
||||
|
||||
"GridLayer" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>GridLayer</B></TD></TR>
|
||||
<TR><TD><I>Options</I><BR/>
|
||||
tileSize:<Number|Point> = 256
|
||||
@ -136,7 +142,8 @@ createTile(<Object> coords):
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
GridLayer -> Layer
|
||||
"GridLayer" -> "Layer"
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
digraph ClassDiagram {
|
||||
node [shape=plaintext]
|
||||
edge [arrowhead=onormal];
|
||||
edge [arrowhead=empty];
|
||||
|
||||
Map [ label = <<TABLE CELLSPACING="0">
|
||||
"Map" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>Map</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
panTo(<LatLng> latlng):this
|
||||
@ -20,8 +20,9 @@ getZoom():Number
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
Map -> Evented
|
||||
Evented [ label = <<TABLE CELLSPACING="0">
|
||||
"Map" -> "Evented"
|
||||
|
||||
"Evented" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>Evented</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
on(<String> evtype, <Function> handler):this
|
||||
@ -35,8 +36,9 @@ off(<String> evtype, <Function> handler):this
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
Evented -> Class
|
||||
Class [ label = <<TABLE CELLSPACING="0">
|
||||
"Evented" -> "Class"
|
||||
|
||||
"Class" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>Class</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
extend(Object):Class
|
||||
@ -56,7 +58,8 @@ options:Object<BR align="left" />
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
Layer [ label = <<TABLE CELLSPACING="0">
|
||||
|
||||
"Layer" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>Layer</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
addTo(<Map> map):this
|
||||
@ -76,18 +79,32 @@ getAttribution():String
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
Layer -> Evented
|
||||
Marker [ label = <<TABLE CELLSPACING="0">
|
||||
"Layer" -> "Evented"
|
||||
|
||||
"Marker" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>Marker</B></TD></TR>
|
||||
|
||||
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
Marker -> Layer
|
||||
TileLayer [ label = <<TABLE CELLSPACING="0">
|
||||
"Marker" -> "Layer"
|
||||
|
||||
"TileLayer" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>TileLayer</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
<TR><TD><I>Options</I><BR/>
|
||||
minZoom:<Number> = 0
|
||||
<BR align="left" />
|
||||
maxZoom:<Number> = 18
|
||||
<BR align="left" />
|
||||
zoomOffset:<Number> = 0
|
||||
<BR align="left" />
|
||||
zoomReverse:<Boolean> = false
|
||||
<BR align="left" />
|
||||
|
||||
</TD></TR>
|
||||
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
getTileUrl(<Object> coords):
|
||||
<BR align="left" />
|
||||
|
||||
@ -97,10 +114,25 @@ getTileUrl(<Object> coords):
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
TileLayer -> GridLayer
|
||||
GridLayer [ label = <<TABLE CELLSPACING="0">
|
||||
"TileLayer" -> "GridLayer"
|
||||
|
||||
"GridLayer" [ label = <<TABLE CELLSPACING="0">
|
||||
<TR><TD><B>GridLayer</B></TD></TR>
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
<TR><TD><I>Options</I><BR/>
|
||||
tileSize:<Number|Point> = 256
|
||||
<BR align="left" />
|
||||
opacity:<Number> = 1.0
|
||||
<BR align="left" />
|
||||
minZoom:<Number> = 0
|
||||
<BR align="left" />
|
||||
maxZoom:<Number> = undefined
|
||||
<BR align="left" />
|
||||
noWrap:<Boolean> = false
|
||||
<BR align="left" />
|
||||
|
||||
</TD></TR>
|
||||
|
||||
<TR><TD><I>Methods</I><BR/>
|
||||
createTile(<Object> coords):
|
||||
<BR align="left" />
|
||||
|
||||
@ -110,7 +142,8 @@ createTile(<Object> coords):
|
||||
|
||||
</TABLE>>]
|
||||
|
||||
GridLayer -> Layer
|
||||
"GridLayer" -> "Layer"
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -81,6 +81,7 @@
|
||||
"inherits": [
|
||||
"Evented"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "map"
|
||||
},
|
||||
"Evented": {
|
||||
@ -153,6 +154,7 @@
|
||||
"inherits": [
|
||||
"Class"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "evented"
|
||||
},
|
||||
"Class": {
|
||||
@ -256,6 +258,7 @@
|
||||
}
|
||||
},
|
||||
"inherits": [],
|
||||
"relationships": [],
|
||||
"id": "class"
|
||||
},
|
||||
"Layer": {
|
||||
@ -349,6 +352,7 @@
|
||||
"inherits": [
|
||||
"Evented"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "layer"
|
||||
},
|
||||
"Marker": {
|
||||
@ -361,6 +365,7 @@
|
||||
"inherits": [
|
||||
"Layer"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "marker"
|
||||
},
|
||||
"TileLayer": {
|
||||
@ -404,11 +409,72 @@
|
||||
}
|
||||
},
|
||||
"id": "tilelayer-method"
|
||||
},
|
||||
"option": {
|
||||
"name": "option",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"sections": {
|
||||
"__default": {
|
||||
"name": "__default",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"uninheritable": false,
|
||||
"documentables": {
|
||||
"minZoom": {
|
||||
"name": "minZoom",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"params": {},
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
"defaultValue": "0",
|
||||
"id": "tilelayer-minzoom"
|
||||
},
|
||||
"maxZoom": {
|
||||
"name": "maxZoom",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"params": {},
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
"defaultValue": "18",
|
||||
"id": "tilelayer-maxzoom"
|
||||
},
|
||||
"zoomOffset": {
|
||||
"name": "zoomOffset",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"params": {},
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
"defaultValue": "0",
|
||||
"id": "tilelayer-zoomoffset"
|
||||
},
|
||||
"zoomReverse": {
|
||||
"name": "zoomReverse",
|
||||
"aka": [],
|
||||
"comments": [
|
||||
""
|
||||
],
|
||||
"params": {},
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
"defaultValue": "false",
|
||||
"id": "tilelayer-zoomreverse"
|
||||
}
|
||||
},
|
||||
"type": "option",
|
||||
"id": "tilelayer-option"
|
||||
}
|
||||
},
|
||||
"id": "tilelayer-option"
|
||||
}
|
||||
},
|
||||
"inherits": [
|
||||
"GridLayer"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "tilelayer"
|
||||
},
|
||||
"GridLayer": {
|
||||
@ -433,7 +499,6 @@
|
||||
"name": "createTile",
|
||||
"aka": [],
|
||||
"comments": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"params": {
|
||||
@ -453,11 +518,87 @@
|
||||
}
|
||||
},
|
||||
"id": "gridlayer-method"
|
||||
},
|
||||
"option": {
|
||||
"name": "option",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"sections": {
|
||||
"__default": {
|
||||
"name": "__default",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"uninheritable": false,
|
||||
"documentables": {
|
||||
"tileSize": {
|
||||
"name": "tileSize",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"params": {},
|
||||
"type": "Number|Point",
|
||||
"optional": false,
|
||||
"defaultValue": "256",
|
||||
"id": "gridlayer-tilesize"
|
||||
},
|
||||
"opacity": {
|
||||
"name": "opacity",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"params": {},
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
"defaultValue": "1.0",
|
||||
"id": "gridlayer-opacity"
|
||||
},
|
||||
"minZoom": {
|
||||
"name": "minZoom",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"params": {},
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
"defaultValue": "0",
|
||||
"id": "gridlayer-minzoom"
|
||||
},
|
||||
"maxZoom": {
|
||||
"name": "maxZoom",
|
||||
"aka": [],
|
||||
"comments": [],
|
||||
"params": {},
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
"defaultValue": "undefined",
|
||||
"id": "gridlayer-maxzoom"
|
||||
},
|
||||
"noWrap": {
|
||||
"name": "noWrap",
|
||||
"aka": [],
|
||||
"comments": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"params": {},
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
"defaultValue": "false",
|
||||
"id": "gridlayer-nowrap"
|
||||
}
|
||||
},
|
||||
"type": "option",
|
||||
"id": "gridlayer-option"
|
||||
}
|
||||
},
|
||||
"id": "gridlayer-option"
|
||||
}
|
||||
},
|
||||
"inherits": [
|
||||
"Layer"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "gridlayer"
|
||||
}
|
||||
}
|
||||
}
|
@ -563,6 +563,84 @@
|
||||
|
||||
<h2 id='tilelayer'>TileLayer</h2>
|
||||
|
||||
<h3 id='tilelayer-option'>Options</h3>
|
||||
|
||||
<section>
|
||||
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th>Type</th>
|
||||
<th>Default</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr id='tilelayer-minzoom'>
|
||||
<td><code><b>minZoom</b></code></td>
|
||||
<td><code>Number</code>
|
||||
<td><code>0</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id='tilelayer-maxzoom'>
|
||||
<td><code><b>maxZoom</b></code></td>
|
||||
<td><code>Number</code>
|
||||
<td><code>18</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id='tilelayer-zoomoffset'>
|
||||
<td><code><b>zoomOffset</b></code></td>
|
||||
<td><code>Number</code>
|
||||
<td><code>0</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id='tilelayer-zoomreverse'>
|
||||
<td><code><b>zoomReverse</b></code></td>
|
||||
<td><code>Boolean</code>
|
||||
<td><code>false</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</section>
|
||||
|
||||
|
||||
<div class='accordion'>
|
||||
<!-- <label>Show inherited <a href='#gridlayer-option'>Options from GridLayer</a>.</label> -->
|
||||
<label><span class='expander'>▶</span> Options inherited from <a href='#gridlayer'>GridLayer</a></label>
|
||||
<div class='accordion-content'><section>
|
||||
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th>Type</th>
|
||||
<th>Default</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr id='tilelayer-tilesize'>
|
||||
<td><code><b>tileSize</b></code></td>
|
||||
<td><code>Number|Point</code>
|
||||
<td><code>256</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id='tilelayer-opacity'>
|
||||
<td><code><b>opacity</b></code></td>
|
||||
<td><code>Number</code>
|
||||
<td><code>1.0</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id='tilelayer-nowrap'>
|
||||
<td><code><b>noWrap</b></code></td>
|
||||
<td><code>Boolean</code>
|
||||
<td><code>false</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 id='tilelayer-method'>Methods</h3>
|
||||
|
||||
<section>
|
||||
@ -740,6 +818,53 @@
|
||||
|
||||
<h2 id='gridlayer'>GridLayer</h2>
|
||||
|
||||
<h3 id='gridlayer-option'>Options</h3>
|
||||
|
||||
<section>
|
||||
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th>Type</th>
|
||||
<th>Default</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr id='gridlayer-tilesize'>
|
||||
<td><code><b>tileSize</b></code></td>
|
||||
<td><code>Number|Point</code>
|
||||
<td><code>256</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id='gridlayer-opacity'>
|
||||
<td><code><b>opacity</b></code></td>
|
||||
<td><code>Number</code>
|
||||
<td><code>1.0</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id='gridlayer-minzoom'>
|
||||
<td><code><b>minZoom</b></code></td>
|
||||
<td><code>Number</code>
|
||||
<td><code>0</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id='gridlayer-maxzoom'>
|
||||
<td><code><b>maxZoom</b></code></td>
|
||||
<td><code>Number</code>
|
||||
<td><code>undefined</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id='gridlayer-nowrap'>
|
||||
<td><code><b>noWrap</b></code></td>
|
||||
<td><code>Boolean</code>
|
||||
<td><code>false</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</section>
|
||||
|
||||
|
||||
<h3 id='gridlayer-method'>Methods</h3>
|
||||
|
||||
<section>
|
||||
|
@ -81,6 +81,7 @@
|
||||
"inherits": [
|
||||
"Evented"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "map"
|
||||
},
|
||||
"Evented": {
|
||||
@ -153,6 +154,7 @@
|
||||
"inherits": [
|
||||
"Class"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "evented"
|
||||
},
|
||||
"Class": {
|
||||
@ -256,6 +258,7 @@
|
||||
}
|
||||
},
|
||||
"inherits": [],
|
||||
"relationships": [],
|
||||
"id": "class"
|
||||
},
|
||||
"Layer": {
|
||||
@ -349,6 +352,7 @@
|
||||
"inherits": [
|
||||
"Evented"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "layer"
|
||||
},
|
||||
"Marker": {
|
||||
@ -361,6 +365,7 @@
|
||||
"inherits": [
|
||||
"Layer"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "marker"
|
||||
},
|
||||
"TileLayer": {
|
||||
@ -469,6 +474,7 @@
|
||||
"inherits": [
|
||||
"GridLayer"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "tilelayer"
|
||||
},
|
||||
"GridLayer": {
|
||||
@ -592,6 +598,7 @@
|
||||
"inherits": [
|
||||
"Layer"
|
||||
],
|
||||
"relationships": [],
|
||||
"id": "gridlayer"
|
||||
}
|
||||
}
|
@ -69,6 +69,7 @@
|
||||
}
|
||||
},
|
||||
"inherits": [],
|
||||
"relationships": [],
|
||||
"id": "map"
|
||||
}
|
||||
}
|
@ -11,6 +11,7 @@
|
||||
],
|
||||
"supersections": {},
|
||||
"inherits": [],
|
||||
"relationships": [],
|
||||
"id": "svg"
|
||||
}
|
||||
}
|
@ -283,6 +283,7 @@
|
||||
}
|
||||
},
|
||||
"inherits": [],
|
||||
"relationships": [],
|
||||
"id": "treenode"
|
||||
}
|
||||
}
|
@ -194,7 +194,7 @@ export default class Leafdoc {
|
||||
}
|
||||
|
||||
// 🍂method addStr(str: String, filename?: String): this
|
||||
// Parses the given string for Leafdoc comments.
|
||||
// Parses the given string for Leafdoc directives.
|
||||
addStr(str, filename) {
|
||||
|
||||
// Leaflet files use DOS line feeds, which screw up things.
|
||||
@ -221,7 +221,6 @@ export default class Leafdoc {
|
||||
let sectionAKA = [];
|
||||
let sectionIsUninheritable = false;
|
||||
|
||||
console.log(path.extname(filename), filename);
|
||||
const parser = path.extname(filename) === '.leafdoc' ?
|
||||
parserTrivial :
|
||||
parserMec;
|
||||
@ -247,18 +246,9 @@ console.log(path.extname(filename), filename);
|
||||
for (const i in lines) {
|
||||
const line = lines[i];
|
||||
|
||||
// var match = regex.exec(line); // Skips extra comment characters
|
||||
// var lineStr = match[1];
|
||||
// Might happen in some binary files
|
||||
// console.log(line);
|
||||
// break;
|
||||
// }
|
||||
let lineIsValid = false;
|
||||
let parsedCharacters = 0;
|
||||
|
||||
// console.log('Line: ', i, line);
|
||||
// var match = regex.exec(line);
|
||||
|
||||
let match;
|
||||
// In "param foo, bar", directive is "param" and content is "foo, bar"
|
||||
while (match = regexps.getLeafDirective().exec(line)) {
|
||||
@ -271,9 +261,7 @@ console.log(path.extname(filename), filename);
|
||||
}
|
||||
|
||||
if (lineIsValid) {
|
||||
// console.log('After having matched a line:', match);
|
||||
const trailing = line.substr(parsedCharacters + 1).trim();
|
||||
// console.log('After having matched a line:', trailing);
|
||||
if (trailing) {
|
||||
directives.push(['comment', trailing]);
|
||||
}
|
||||
@ -285,16 +273,12 @@ console.log(path.extname(filename), filename);
|
||||
}
|
||||
}
|
||||
|
||||
// console.log('directives', directives);
|
||||
|
||||
for (const i in directives) {
|
||||
const directive = directives[i][0],
|
||||
content = directives[i][1];
|
||||
|
||||
// 4: Parse 🍂 directives
|
||||
|
||||
// console.log(directive, '-', content);
|
||||
|
||||
if (directive === 'class' || directive === 'namespace') {
|
||||
ns = content.trim();
|
||||
sec = '__default';
|
||||
@ -322,7 +306,6 @@ console.log(path.extname(filename), filename);
|
||||
dc = ''; // The name of the documentable will be set later
|
||||
}
|
||||
|
||||
|
||||
// console.log(scope, '-', directive, '-', content);
|
||||
|
||||
if (scope === 'ns') {
|
||||
@ -333,21 +316,32 @@ console.log(path.extname(filename), filename);
|
||||
aka: [],
|
||||
comments: [],
|
||||
supersections: {},
|
||||
inherits: []
|
||||
inherits: [],
|
||||
relationships: [],
|
||||
};
|
||||
}
|
||||
|
||||
currentNamespace = namespaces[ns];
|
||||
|
||||
if (directive === 'aka') {
|
||||
namespaces[ns].aka.push(content);
|
||||
currentNamespace.aka.push(content);
|
||||
}
|
||||
if (directive === 'comment') {
|
||||
namespaces[ns].comments.push(content);
|
||||
currentNamespace.comments.push(content);
|
||||
}
|
||||
if (directive === 'inherits') {
|
||||
namespaces[ns].inherits.push(content);
|
||||
currentNamespace.inherits.push(content);
|
||||
}
|
||||
if (directive === 'relationship') {
|
||||
var split = regexps.relationshipDefinition.exec(content);
|
||||
currentNamespace.relationships.push({
|
||||
type: parts[1],
|
||||
namespace: parts[2],
|
||||
cardinalityFrom: parts[3],
|
||||
cardinalityTo: parts[4],
|
||||
label: parts[5],
|
||||
});
|
||||
}
|
||||
|
||||
currentNamespace = namespaces[ns];
|
||||
}
|
||||
|
||||
if (scope === 'sec') {
|
||||
@ -583,7 +577,8 @@ console.log(path.extname(filename), filename);
|
||||
id: namespace.id,
|
||||
comments: namespace.comments,
|
||||
supersections: out,
|
||||
inherits: namespace.inherits
|
||||
inherits: namespace.inherits,
|
||||
relationships: namespace.relationships
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export function redoLeafDirective(char) {
|
||||
// Parses an identifier, allowing only unicode ID_Start and ID_Continue characters
|
||||
// An identifier allows dots in it, to allow for namespacing identifiers.
|
||||
// TODO: An identifier shall allow an underscore or dollar at the beginning, as JS does.
|
||||
const identifier = xRegExp.build('^({{ID_Start}} ( {{ID_Continue}} | \\. | : )*)$', {
|
||||
const identifier = xRegExp.build('^(({{ID_Start}} | _ | \$) ( {{ID_Continue}} | \\. | : )*)$', {
|
||||
ID_Start: unicodeRegExpIDStart, // eslint-disable-line camelcase
|
||||
ID_Continue: unicodeRegExpIDContinue // eslint-disable-line camelcase
|
||||
}, 'nx');
|
||||
@ -66,3 +66,15 @@ export const functionParam = xRegExp.build('\\s* (?<name> ( {{identifier}} | …
|
||||
// Parses a miniclass name and its real class between parentheses.
|
||||
export const miniclassDefinition = xRegExp('^ (?<miniclass> .+ ) \\s* \\( (?<realclass> .+ ) \\) $', 'nx');
|
||||
|
||||
|
||||
|
||||
// Parses a UML-like relationship definition
|
||||
export const relationshipDefinition = xRegExp(`^
|
||||
(?<type> \\S+ ) \\s*
|
||||
(?<namespace> \\S+ ) \\s*
|
||||
(?<cardinalityFrom> [^,\\s]* )? \\s*
|
||||
(, \\s* (?<cardinalityTo> [^,\\s]* )? \\s*
|
||||
(, \\s* (?<label> .+ )? )?
|
||||
)? \\s* $`, 'nx');
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
digraph ClassDiagram {
|
||||
node [shape=plaintext]
|
||||
edge [arrowhead=onormal];
|
||||
edge [arrowhead=empty];
|
||||
|
||||
{{{ body }}}
|
||||
|
||||
|
Reference in New Issue
Block a user