mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Documentation (MKDOCS) (#1230)
Co-authored-by: Steve Richards <srichards@mirantis.com> Co-authored-by: Mario Sarcher <msarcher@mirantis.com> Co-authored-by: steve richards <steve.james.richards@gmail.com> Co-authored-by: Paul Williams <pawilliams@mirantis.com> Co-authored-by: pauljwil <pauljwil@gmail.com>
This commit is contained in:
41 files changed
+719
-2
No files matched your search
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,18 @@
|
||||
# Wrapping Up
|
||||
|
||||
In the [Your First Extension](your-first-extension.md) topic, you learned how to create and run an extension. In the [Extension Anatomy](anatomy.md) topic, you learned fundamental concepts to Lens extension development. However, this is just a small glimpse of what can be created with Lens Extensions. Below are some suggested routes for furthering your Lens extension development skills.
|
||||
|
||||
## Extension Capabilities
|
||||
|
||||
In this section, we split the Lens extension points into a few categories, each with short descriptions as to what your extension could achieve. Validate that your extension idea is achievable by reading the [Extension Capabilities](../capabilities/overview.md) section for new extension ideas.
|
||||
|
||||
## Guides & Samples
|
||||
|
||||
We have a great collection of sample extensions that you can adapt from, and some of them include a detailed guide that explains the source code. You can find all Samples & Guides in the [lens-extension-samples](https://github.com/lensapp/lens-extension-samples) repository.
|
||||
|
||||
## Testing and Publishing
|
||||
|
||||
This section includes topics that help you develop high-quality Lens extensions. For example, you can learn
|
||||
|
||||
* How to add [integration tests](../testing-and-publishing/testing.md) for your extension
|
||||
* How to [publish your extension](../testing-and-publishing/publishing.md)
|
||||
@@ -0,0 +1,63 @@
|
||||
# Your First Extension
|
||||
|
||||
In this topic, we'll teach you the fundamental concepts for building extensions. Make sure you have [Node.js](https://nodejs.org/en/) and [Git](https://git-scm.com/) installed....
|
||||
|
||||
## Installing and Building the extension
|
||||
|
||||
Simple Lens extension that adds "Hello World" page to a cluster menu.
|
||||
|
||||
### Linux
|
||||
|
||||
First you will need to clone the [Lens Extension samples](https://github.com/lensapp/lens-extension-samples) repository to your local machine:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/lensapp/lens-extension-samples.git
|
||||
```
|
||||
|
||||
Next you need to create a symlink from the directory that Lens will monitor for user installed extensions to the sample extension, in this case **helloworld-sample**:
|
||||
|
||||
```sh
|
||||
mkdir -p ~/.k8slens/extensions
|
||||
cd ~/.k8slens/extensions
|
||||
ln -s <lens-extension-samples directory>/helloworld-sample helloworld-sample
|
||||
```
|
||||
|
||||
To build the extension you can use `make` or run the `npm` commands manually:
|
||||
|
||||
```sh
|
||||
cd <lens-extension-samples directory>/helloworld-sample
|
||||
make build
|
||||
```
|
||||
|
||||
OR
|
||||
|
||||
```sh
|
||||
cd <lens-extension-samples directory>/helloworld-sample
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
|
||||
If you want to watch for any source code changes and automatically rebuild the extension you can use:
|
||||
|
||||
```sh
|
||||
cd <lens-extension-samples directory>/helloworld-sample
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Finally, if you already have Lens open you will need to quit and restart Lens for the extension to be loaded. After this initial restart you can reload Lens and it will pick up any new builds of the extension. Within Lens connect to an existing cluster or [create a new one](../../clusters/adding-clusters.md). You should see then see the "Hello World" page in the Lens sidebar cluster menu.
|
||||
|
||||
## Developing the extension
|
||||
|
||||
Let's make a change to the message that our helloworld-sample extension displays:
|
||||
|
||||
* Navigate to `<lens-extension-samples directory>/helloworld-sample`.
|
||||
* Change the message from HelloWorld! to **Hello Lens Extensions** in `page.tsx`.
|
||||
* Rebuild the extension or, if you used `npm run dev`, the extension should automatically rebuild.
|
||||
* Reload the Lens window and click on the Hello World page.
|
||||
* You should see the updated message showing up.
|
||||
|
||||
## Next steps
|
||||
|
||||
In the next topic, [Extension Anatomy](anatomy.md), we'll take a closer look at the source code of the Hello World sample and explain key concepts.
|
||||
|
||||
You can find the source code of this tutorial at: [lensapp/lens-extension-samples](https://github.com/lensapp/lens-extension-samples/tree/master/helloworld-sample). The [Extension Guides](../guides/overview.md) topic contains other samples, each illustrating a different Lens Extension API.
|
||||
Whitespace-only changes.
@@ -0,0 +1 @@
|
||||
# Renderer Extension
|
||||
@@ -0,0 +1,48 @@
|
||||
# Lens Extension API
|
||||
|
||||
The Extensions API in Lens allows users to customize and enhance the Lens experience by creating their own menus or page content that is extended from the existing pages. Many of the core features of Lens are built as extensions and use the same Extension API.
|
||||
|
||||
This documentation describes:
|
||||
|
||||
* How to build, run, test and publish an extension
|
||||
* How to take advantage of Lens's Extension API
|
||||
* Where to find [guides](guides/overview.md) and [code samples](https://github.com/lensapp/lens-extension-samples) to help get you started
|
||||
|
||||
Code samples are available at [lensapp/lens-extension-samples](https://github.com/lensapp/lens-extension-samples).
|
||||
|
||||
## What can extensions do
|
||||
|
||||
Here are some examples of what you can achieve with the Extension API:
|
||||
|
||||
* Add custom components & views in the UI - Extending the Lens Workbench
|
||||
|
||||
If you'd like to have a more comprehensive overview of the Extension API, refer to the [Extension Capabilities Overview](capabilities/overview.md) page. [Extension Guides Overview](guides/overview.md) also includes a list of code samples and guides that illustrate various Extension API usage.
|
||||
|
||||
## How to build extensions
|
||||
|
||||
Building a good extension can take a lot of effort. Here is what each section of the API doc can help you with:
|
||||
|
||||
* **Get Started** teaches fundamental concepts for building extensions with the Hello World sample.
|
||||
* **Extension Capabilities** dissects Lens's Extension API into smaller categories and points you to more detailed topics.
|
||||
* **Extension Guides** includes guides and code samples that explain specific usages of Lens Extension API.
|
||||
* **Testing and Publishing** includes in-depth guides on various extension development topics, such as testing and publishing extensions.
|
||||
* **Advanced Topics** explains advanced concepts such as integrating with 3rd party applications/services.
|
||||
* **References** contains exhaustive references for the Lens Extension API, Contribution Points, and many other topics.
|
||||
|
||||
## What's new
|
||||
|
||||
Lens updates on a monthly cadence, and that applies to the Extension API as well. New features and APIs become available every month to increase the power and scope of Lens extensions.
|
||||
|
||||
To stay current with the Extension API and Lens features in general, you can review the [release notes](https://github.com/lensapp/lens/releases).
|
||||
|
||||
## Looking for help
|
||||
|
||||
If you have questions for extension development, try asking on:
|
||||
|
||||
* [Lens Dev Slack](http://k8slens.slack.com/): Public chatroom for Lens developers. Some Lens team members chime in on conversations.
|
||||
|
||||
To provide feedback on the documentation or issues with the Lens Extension API, create new issues at [lensapp/lens](https://github.com/lensapp/lens/issues) with the labels `area/documentation` and/or `area/extension`.
|
||||
|
||||
## Download Lens - The Kubernetes IDE
|
||||
|
||||
Go to [Lens](https://k8slens.dev)
|
||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Reference in new issue
Block a user