3 // in flutter - an event is actually a property..?
5 // we have 2 types of data - the overall summary, and the 'detail one we use for docs..
10 Generics CompoundAnimation<T> ... or
11 children → List<Widget> << fixed..
12 material/PopupMenuEntry-class.html
13 http://localhost/roojs1/docs/?/flutter/#material.PopupMenuDivider
16 Constants on Libraries.. /? classes?
18 Abstracts - no need to show them in menu?
25 config --- constructor links...
30 require_once 'flutter_nodes.php'; // the classes..
32 define( 'FDIR', '/home/alan/Downloads/flutterdocs/flutter/');
33 define( 'TDIR', '/home/alan/gitlive/flutter-docs-json/');
36 $c = new eClass(array(
37 'name' => 'dart:core.List',
38 'href' => 'dart-core/List-class.html',
39 'memberOf' => 'dart:core',
43 // let's do some testing...
44 $c = new eClass(array(
45 'name' => 'dart:core.Object',
46 'href' => 'dart-core/Object-class.html',
47 'memberOf' => 'dart:core',
51 $c = new eClass(array(
52 'name' => 'foundation.Diagnosticable',
53 'href' => 'foundation/Diagnosticable-class.html',
54 'memberOf' => 'foundation',
58 $c = new eClass(array(
59 'name' => 'foundation.DiagnosticableTree',
60 'href' => 'foundation/DiagnosticableTree-class.html',
61 'memberOf' => 'foundation',
67 $c = new eClass(array(
68 'name' => 'widgets.Widget',
69 'href' => 'widgets/Widget-class.html',
70 'memberOf' => 'widgets',
73 $c = new eClass(array(
74 'name' => 'widgets.StatelessWidget',
75 'href' => 'widgets/StatelessWidget-class.html',
76 'memberOf' => 'widgets',
80 $c = new eClass(array(
81 'name' => 'widgets.StatelessWidget',
82 'href' => 'widgets/StatelessWidget-class.html',
83 'memberOf' => 'widgets',
87 $c = new eClass(array(
88 'name' => 'material.AboutDialog',
89 'href' => 'material/AboutDialog-class.html',
90 'memberOf' => 'material',
93 $add = new Prop(array(
95 'href' => 'material/AboutDialog/children.html',
96 'memberOf' => 'material.AboutDialog'
108 $js = json_decode(file_get_contents(FDIR.'index.json'));
125 case 'typedef': // func sig?
126 case 'top-level property':
127 $ctor = 'e'. ucfirst(str_replace('top-level ', '', $o->type));
131 'name' => $o->qualifiedName,
133 'isMixin' => $o->type == 'mixin',
134 'isEnum' => $o->type == 'enum',
135 'isTypedef' => $o->type == 'typedef',
136 'isConstant' => $o->type == 'top-level constant',
137 'memberOf' => $o->enclosedBy->name,
147 $ar = explode('.', $o->qualifiedName);
149 $cls = implode('.', $ar);
150 $ctor = 'e'. ucfirst($o->type);
151 $add = new $ctor(array(
154 'isConstructor' => $o->type == 'constructor',
157 if ($o->type != 'function') {
158 eClass::$all[$cls]->methods[] = $add;
160 eClass::$all[$o->qualifiedName] = $add;
164 case 'top-level constant':
166 $ar = explode('.', $o->qualifiedName);
168 $memberof= implode('.', $ar);
170 $add = new eConstant(array(
173 'memberOf' => $memberof,
175 switch($o->enclosedBy->type) {
177 if (empty(eClass::$all[$memberof])) {
179 echo "Can not find class: $memberof to add object to";
182 eClass::$all[$memberof]->props[] = $add;
199 $ar = explode('.', $o->qualifiedName);
201 $cls = implode('.', $ar);
205 if (substr($o->name, 0,2) == 'on' && $o->type == 'property') {
207 eClass::$all[$cls]->events[] = new eMethod(array(
210 'isConstant' => $o->type == 'constant',
215 $add = new Prop(array(
221 eClass::$all[$cls]->props[] = $add;
226 die("invalid type {$o->type}");
237 if (!file_exists(TDIR .'symbols')) {
238 mkdir(FDIR .'symbols', 0755, true);
240 if (!file_exists(TDIR .'ns')) {
241 mkdir(FDIR .'ns', 0755, true);
246 foreach(eClass::$all as $c) {
248 if (!method_exists($c, 'readDocs')) {
249 echo "missing readDocs";
253 // constant's and other mixins..
255 // at this point we need to dump the whole thing.
261 foreach(eClass::$all as $c) {
263 if (!method_exists($c, 'readDocs')) {
264 echo "missing readDocs";
267 if (is_a($c, 'eClass') ||is_a($c, 'eMixin') ) {
268 $c->expandImplementors();
270 // constant's and other mixins..
273 // output the files..
274 foreach(eClass::$all as $c) {
275 //$summary[$c->name] = $c->toSummaryArray();
276 if (is_a($c, 'eClass') ||is_a($c, 'eMixin') ) {
277 $c->realImplementors();
278 file_put_contents(TDIR .'symbols/'.$c->name. '.json', json_encode($c,JSON_PRETTY_PRINT));
280 // constant's and other mixins..
282 foreach(Ns::$tree as $c) {
283 //$summary[$c->name] = $c->toSummaryArray();
284 file_put_contents(TDIR .'ns/'.$c->name. '.json', json_encode($c,JSON_PRETTY_PRINT));
286 // constant's and other mixins..
289 foreach(Ns::$tree as $e) {
291 $tree[] = $e->toTreeArray();
293 file_put_contents(TDIR .'tree.json', json_encode($tree, JSON_PRETTY_PRINT));
294 //file_put_contents(FDIR .'json/index.json', json_encode($summary, JSON_PRETTY_PRINT)); // this is for builder.. later..
296 //print_r(eClass::$all);