Skip to content

Commit

Permalink
Provide embedded documentation
Browse files Browse the repository at this point in the history
Fixes jlandersen#35

Signed-off-by: azerr <[email protected]>
  • Loading branch information
angelozerr committed Jan 25, 2021
1 parent a515d53 commit 2e57037
Show file tree
Hide file tree
Showing 17 changed files with 1,040 additions and 6 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ Planned features in no particular order:
- More administration features
- Update configs

You might also find useful information in the [Online VScode Kafka Documentation](https://github.com/jlandersen/vscode-kafka/blob/master/docs/README.md)
or you can read this documentation inside vscode with the command `Open VScode Kafka Documentation` available with `Ctrl+Shift+P`:

![Open VScode Kafka Documentation](docs/assets/open-doc-cmd.png)

## Screenshots
![Screenshot-1](assets/screen-1.png)
![Screenshot-1](docs/assets/screen-1.png)

![Screenshot-2](assets/screen-2.png)
![Screenshot-2](docs/assets/screen-2.png)

![Screenshot-3](assets/screen-3.png)
![Screenshot-3](docs/assets/screen-3.png)

## Producing
Producing can be done by creating a `.kafka` file. Write simple producers using the following format:
Expand All @@ -50,7 +55,7 @@ The log about produced messages is printed in the "Kafka Producer Log" Output vi

Record content can be randomized by injecting mustache-like placeholders of [faker.js properties](https://github.com/Marak/faker.js#api-methods), like ``{{name.lastName}}`` or ``{{random.number}}``. Some randomized properties can be localized via the `kafka.producers.fakerjs.locale` setting.

![Screenshot-4](assets/screen-4.png)
![Screenshot-4](docs/assets/screen-4.png)

## Consuming
Consuming topics can be done by right clicking a topic in the explorer or from the command palette. Some things to note about consuming:
Expand Down
10 changes: 10 additions & 0 deletions docs/Consuming.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Consuming

Consuming topics can be done by right clicking a topic in the explorer or from the command palette. Some things to note about consuming:

* UTF-8 encoded keys and values only. If data is encoded differently, it will not be pretty.
* One consumer group is created per topic (may change in the future to just have one for the extension).

Consumers are based on virtual documents, available in the VS Code extension API. A consumer will keep running even if you close the document in the editor. You should make sure to close the consumer explicitly, either via the command palette, the status bar element or the start/stop action button as well. The VS Code API does not support detecting if a virtual document is closed immediately. Instead, the underlying virtual document is automatically closed after two minutes if the document is closed in the editor.

You can configure start offset for new consumers in settings (earliest, latest).
7 changes: 7 additions & 0 deletions docs/Explorer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Explorer

![Screenshot-1](assets/screen-1.png)

![Screenshot-2](assets/screen-2.png)

![Screenshot-3](assets/screen-3.png)
25 changes: 25 additions & 0 deletions docs/Producing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Producing

Producing can be done by creating a `.kafka` file. Write simple producers using the following format:

```json
PRODUCER keyed-message
topic: my-topic
key: mykeyq
record content

###

PRODUCER non-keyed-json-message
topic: json-events
{
"type": "my_test_event"
}
```

For actually producing a single record, click on the "Produce record" link above the PRODUCER line; for producing 10 records, click on "Produce record x 10".
The log about produced messages is printed in the "Kafka Producer Log" Output view.

Record content can be randomized by injecting mustache-like placeholders of [faker.js properties](https://github.com/Marak/faker.js#api-methods), like ``{{name.lastName}}`` or ``{{random.number}}``. Some randomized properties can be localized via the `kafka.producers.fakerjs.locale` setting.

![Screenshot-4](assets/screen-4.png)
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# VSCode Kafka Documentation

Welcome to the [vscode-kafka](https://github.com/jlandersen/vscode-kafka) documentation.

* [Kafka Explorer](Explorer.md#explorer)
* [Producing](Producing.md#producing)
* [Consuming](Consuming.md#consuming)
Binary file added docs/assets/open-doc-cmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit 2e57037

Please sign in to comment.