Skip to content

Commit

Permalink
Added Readmes for all templates
Browse files Browse the repository at this point in the history
fixed #63

Signed-off-by: Jonas Helming <[email protected]>
  • Loading branch information
JonasHelming authored and vince-fugnitto committed Feb 1, 2021
1 parent 6214ca1 commit 4f4361f
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 1 deletion.
25 changes: 25 additions & 0 deletions src/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ module.exports = class TheiaExtension extends Base {
this.extensionPath(`src/browser/${this.params.extensionPath}-contribution.ts`),
{ params: this.params }
);
this.fs.copyTpl(
this.templatePath('hello-world/README.md'),
this.extensionPath('README.md'),
{ params: this.params }
);
}

/** empty */
Expand All @@ -278,6 +283,11 @@ module.exports = class TheiaExtension extends Base {
this.extensionPath(`src/browser/${this.params.extensionPath}-contribution.ts`),
{ params: this.params }
);
this.fs.copyTpl(
this.templatePath('empty/README.md'),
this.extensionPath('README.md'),
{ params: this.params }
);
}

/** widget */
Expand All @@ -302,6 +312,11 @@ module.exports = class TheiaExtension extends Base {
this.extensionPath('src/browser/style/index.css'),
{ params: this.params }
);
this.fs.copyTpl(
this.templatePath('widget/README.md'),
this.extensionPath('README.md'),
{ params: this.params }
);
}

/** backend */
Expand Down Expand Up @@ -336,6 +351,11 @@ module.exports = class TheiaExtension extends Base {
this.extensionPath(`src/node/hello-backend-with-client-service.ts`),
{ params: this.params }
);
this.fs.copyTpl(
this.templatePath('backend/README.md'),
this.extensionPath('README.md'),
{ params: this.params }
);
}

/** labelprovider */
Expand All @@ -355,6 +375,11 @@ module.exports = class TheiaExtension extends Base {
this.extensionPath('src/browser/style/example.css'),
{ params: this.params }
);
this.fs.copyTpl(
this.templatePath('labelprovider/README.md'),
this.extensionPath('README.md'),
{ params: this.params }
);
}

/** tree-editor */
Expand Down
11 changes: 11 additions & 0 deletions templates/backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Backend Communication Example

The example extension demonstrates how to communicate with backend services.
It contains the following two backend service examples:
* `HelloBackendService`: Can be called by the client to create a "Hello World" string. The client provides a name as a parameter, and the server returns the name prefixed with "Hello" (ex: "World" as a parameter returns "Hello World").
* `HelloBackendWithClientService`: Same as `HelloBackendService`, but the name parameter is not directly passed by the client in the first call. Instead, the backend services retrieves the name to say "Hello" to from the client again (`BackendClient`). This example shows how to implement call backs from the backend to the client.
Further, the example contributes two commands to trigger both types of backend calls.

## How to use the backend communication example

In the running application, trigger the command "Say hello on the backend" or "Say hello on the backend with a callback to the client" via the command palette (F1 => "Say Hello"). A message will be printed out on the console from where you launched the application.
3 changes: 3 additions & 0 deletions templates/empty/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Empty Template Extension

This template extension does not contain any features, but provides an empty stub including a frontend module and a generic contribution. It can be used as a starting point to implement any custom extension.
7 changes: 7 additions & 0 deletions templates/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Hello World Example

The example extension demonstrates how to register a command in Theia saying "Hello world" using the message service.

## How to use the Hello World example

In the running application, trigger the command "Say hello" via the command palette (F1 => "Say Hello"). A message dialog will pop up saying "Hello World".
8 changes: 8 additions & 0 deletions templates/labelprovider/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Example Label Provider

The example extension demonstrates how to contribute a custom label provider in order to customize the `label` and `icon` when displaying specific file types (using the ".my" file extension as an example).

## How to use the label provider example

In the running application, create a new file with the file extension ".my".
The Theia file explorer will be show the file using a custom icon and an augmented label.
2 changes: 1 addition & 1 deletion templates/tree-editor/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Example tree editor
# Example Tree Editor

The example extension demonstrates how to build tree editors in Eclipse Theia, which show the content of JSON files.

Expand Down
7 changes: 7 additions & 0 deletions templates/widget/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Example Widget

The example extension demonstrates how to contribute a custom widget (i.e. a view or editor) to Eclipse Theia.

## How to use the widget example

In the running application, open the widget using the menu "View" => "<%= params.extensionPrefix %> Widget"

0 comments on commit 4f4361f

Please sign in to comment.