Skip to content

Commit 741f7bc

Browse files
add a plugin example project docs
1 parent 5f101e9 commit 741f7bc

File tree

6 files changed

+57
-2
lines changed

6 files changed

+57
-2
lines changed

docs/StardustDocs/topics/Compiler-Plugin.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
# Kotlin DataFrame Compiler Plugin
22

3-
Kotlin DataFrame compiler plugin: available in Gradle projects, is coming to Kotlin Notebook and Maven projects soon.
3+
<web-summary>
4+
Explore the Kotlin DataFrame Compiler Plugin —
5+
a powerful tool for on-the-fly generating type-safe accessors in DataFrames.
6+
</web-summary>
7+
8+
<card-summary>
9+
Explore the Kotlin DataFrame Compiler Plugin —
10+
a powerful tool for on-the-fly generating type-safe accessors in DataFrames.
11+
</card-summary>
12+
13+
<link-summary>
14+
Explore the Kotlin DataFrame Compiler Plugin —
15+
a powerful tool for on-the-fly generating type-safe accessors in DataFrames.
16+
</link-summary>
17+
18+
19+
> Now available in Gradle projects, is coming to Kotlin Notebook and Maven projects soon.
20+
21+
**Kotlin DataFrame Compiler Plugin** is a Kotlin compiler plugin that automatically generates
22+
**[type-safe extension properties](extensionPropertiesApi.md)** for your DataFrame,
23+
allowing you to access columns and rows in a type-safe way and avoid mistakes in column names.
24+
25+
## Why use it?
26+
27+
- Access columns as regular properties: `df.name` instead of `df["name"]`.
28+
- Get full IDE and compiler support: autocompletion, refactoring, and type checking.
29+
- Improve code readability and safety when working with DataFrame.
430

531
Check out this video that shows how expressions update the schema of a dataframe:
6-
<video src="compiler_plugin.mp4" controls/>
32+
33+
<video src="compiler_plugin.mp4" controls=""/>
734

835
## Setup
936

@@ -111,3 +138,9 @@ fun main() {
111138
```
112139

113140
[Learn more](dataSchema.md) about data schema declarations
141+
142+
## Examples
143+
144+
* [Kotlin DataFrame in the IntelliJ IDEA project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-example)
145+
— an IntelliJ IDEA project showcasing simple DataFrame expressions using the Compiler Plugin.
146+
* [](compilerPluginExamples.md) — few examples of Compiler Plugin usages.

docs/StardustDocs/topics/Home.topic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<secondary>
2929
<title>Featured topics</title>
3030
<a href="Kotlin-DataFrame-Features-in-Kotlin-Notebook.md"/>
31+
<a href="Compiler-Plugin.md"/>
3132
<a href="readSqlDatabases.md"/>
3233
</secondary>
3334

docs/StardustDocs/topics/compilerPluginExamples.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
This page provides a few examples that you can copy directly to your project.
44
[Schema info](staticInterpretation.md#schema-info) will be a convenient way to observe the result of different operations.
55

6+
> See also a [Kotlin DataFrame in the IntelliJ IDEA project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-example)
7+
> — an IntelliJ IDEA project showcasing simple DataFrame expressions using the Compiler Plugin.
8+
69
### Example 1
710

811
```kotlin

docs/StardustDocs/topics/guides/Guides-And-Examples.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ Explore our structured, in-depth guides to steadily improve your Kotlin DataFram
5656

5757
Explore our extensive collection of practical examples and real-world analytics workflows.
5858

59+
* [Kotlin DataFrame Compiler Plugin Example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-example)
60+
— a simple project demonstrating the usage of the [compiler plugin](Compiler-Plugin.md),
61+
showcasing DataFrame expressions with [extension properties](extensionPropertiesApi.md)
62+
that are generated on-the-fly in the IDEA project.
63+
5964
* [Titanic Example](https://github.com/Kotlin/dataframe/blob/master/examples/notebooks/titanic/Titanic.ipynb)
6065
— discover the famous "Titanic"
6166
dataset with the Kotlin DataFrame analysis toolkit

examples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Examples of Kotlin Dataframe
22

33
### Idea examples
4+
* [plugin example](kotlin-dataframe-plugin-example) IDEA project with a
5+
[Kotlin DataFrame Compiler Plugin](https://kotlin.github.io/dataframe/compiler-plugin.html) example.
46
* [movies](idea-examples/movies) Using extension properties [Access API](https://kotlin.github.io/dataframe/apilevels.html) to perform a data cleaning task
57
* [titanic](idea-examples/titanic)
68
* [youtube](idea-examples/youtube)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Kotlin DataFrame Compiler Plugin Example
2+
3+
An IntelliJ IDEA project demonstrating the use of the
4+
[Kotlin DataFrame Compiler Plugin](https://kotlin.github.io/dataframe/compiler-plugin.html).
5+
6+
> **Note:** This project uses **dev versions** of the Kotlin and the Kotlin DataFrame plugin.
7+
> See [build.gradle.kts](build.gradle.kts) for details.
8+
9+
For proper functionality in IntelliJ IDEA requires version 2025.2 or higher
10+
(Currently available only in [IntelliJ IDEA EAP](https://www.jetbrains.com/idea/nextversion/?_gl=1*1ojxffu*_gcl_au*MTk5NzUwODYzOS4xNzQ2NzkxMDMz*_ga*MTE0ODQ1MzY3OS4xNzM4OTY1NzM3*_ga_9J976DJZ68*czE3NDkyMTM4MzkkbzE5OCRnMSR0MTc0OTIxMzg0MSRqNTgkbDAkaDA.)
11+
).

0 commit comments

Comments
 (0)