You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2018. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+65-30Lines changed: 65 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ The `web-editor` provides three main errors of functionality:
18
18
* Provide an abstraction API to allow editing of those project files in the [`monaco-editor`](https://github.com/Microsoft/monaco-editor)
19
19
in a browser.
20
20
* Provide an API to allow the loaded project to be run in an `iframe`.
21
+
* A router which understands GitHub gists ID for being able to load a project from a gist.
21
22
22
23
This package is inteded to be integrated into a website which would provide a more rich user interface to allow editing and running
23
24
the project in a browser. There is a minimal API implemented in `examples/index.html` which allows the loading of example projects
@@ -47,6 +48,8 @@ There are several key methods of `project`:
47
48
in the project, but you can specify as many different file types as arguments and only those types of files will be returned.
48
49
*`.get(): ProjectJson | undefined` - Returns the object representation of the project JSON, including any changes that have been made
49
50
while the project has been loaded.
51
+
*`.getProgram(): Promise<Program>` - Returns an object which contains the properties of `css`, `dependencies`, `html`, and `modules`
52
+
which are designed to be used with the `Runner` widget as widget properties to specify the program to run.
50
53
51
54
#### Usage
52
55
@@ -63,65 +66,97 @@ import project from '@dojo/web-editor/project';
63
66
64
67
### Editor
65
68
66
-
This is a class which wraps `monaco-editor`, allowing the editor to seemlessly integrate with the project. It will automatically
69
+
This is a widget which wraps `monaco-editor`, allowing the editor to seemlessly integrate with the project. It will automatically
67
70
display files with the appropriate language intellisense as well as the file is edited, changes will automatically be sent to
68
71
the project to keep it updated.
69
72
70
-
The `Editor` constructor takes two arguments. First, you need to provide a DOM element that will serve as the root for the editor.
71
-
The second is an optional argument is a pass through of any options as specified in the `monaco.editor.IEditorOptions` interface.
73
+
The `Editor` has two key properties:
72
74
73
-
The class has only one method:
75
+
*`filename` - This is the name of the file in the project which the editor should be displaying. Changing this property will cause the widget to change the file that is currently being displayed.
76
+
*`options` - Passed to the `monaco-editor` when it is created. Needs to conform to the `monaco.editor.IEditorOptions` interface.
74
77
75
-
*`.display(filename: string): void` - Displays the file based on the name supplied. It will throw if the file is not part of the
76
-
currently loaded project.
78
+
`Editor` is a themeable widget, with the only themeable class being `editor.base`.
0 commit comments