Skip to content

Commit

Permalink
Update overview page and other pages
Browse files Browse the repository at this point in the history
  • Loading branch information
theEvilReaper committed Jan 22, 2024
1 parent b176d0c commit 607407e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 23 deletions.
1 change: 1 addition & 0 deletions Writerside/docs.tree
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
name="DartPoet Docs"
start-page="overview.md">
<toc-element topic="overview.md"/>
<toc-element topic="Lets-get-started.md"/>
<toc-element topic="annotation.md"/>
<toc-element topic="variables.md"/>
<toc-element topic="placeholders.md"/>
Expand Down
22 changes: 22 additions & 0 deletions Writerside/topics/Lets-get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Let's get started

The project is available over the Maven Central Repository and doesn't require the usage of a third patty repository.

To use it, you need to add the following dependency to your used build system:

## API Specifications

Most of API from DartPoet uses immutable objects from Kotlin.
There are also builder, method chaining and other parts to make the API friendly as possible.

DartPoet contains different `SpecObjects` which allows the creation from classes, interface and more (ClassSpec),
properties (PropertySpec), parameters(Parameters), annotations (Annotations), extensions(Extensions) and more.

Beth the body of a function, constructors is not modeled by any kind of object structure. There is also no
expression class, statement class or a syntax tree node. Instead, DartPoet uses placeholders to format the code blocks
like `KotlinPoet`

Where do you want to go?

- To the `SpecObjects` (Click here)
- To the [`Placeholders`](placeholders.md)
2 changes: 0 additions & 2 deletions Writerside/topics/class.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ The programming language Dart supports different type such `Enum`, `abstract` or
Both of them hve different abilities which are supported from the library.



Start typing here...
38 changes: 17 additions & 21 deletions Writerside/topics/overview.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# DartPoet

`DartPoet` is a library written in kotlin which provides the ability to generate `.dart` files for the programming language Dart.
`DartPoet` is a library written in kotlin which provides the ability to generate `.dart` files for the programming
language Dart.

The generation of source files can be useful in different situations.
Also code generation can eliminate to write boilerplate code.
The process of generating source files can prove advantageous in various scenarios. It effectively reduces the need for
boilerplate code and establishes a consistent standard within the codebase. However, achieving a reduction in
boilerplate code requires the support of frameworks designed for code generation.

When exploring projects that facilitate code generation for Dart and comparing them to other languages, there seems to
be a limited presence in this domain. Enter DartPoet, a valuable tool that simplifies code generation for Dart using
Kotlin. It's important to note that Kotlin and Dart lack interoperability, which adds a layer of complexity to using
this library. The challenge arises from the fact that predefined objects and classes from the Kotlin/Java language
cannot be directly employed in this context.

**Note:** DartPoet is not free from errors and may lack certain features of the Dart language. Furthermore, the format
of the generated code may at times be inconsistent with the Dart style guide.

Example:

Expand Down Expand Up @@ -31,6 +42,7 @@ greetings.writeTo(System.out)
```

And this is the generated code from DartPoet:

```text
class Greetings {
Expand All @@ -40,21 +52,5 @@ class Greetings {
}
```

**Note:** The team from Google is very active to enhance the programming language Dart which is a hard to stand update with the specification from it.

## API Specifications

Most of API from DartPoet uses immutable objects from Kotlin.
There are also builder, method chaining and other parts to make the API friendly as possible.

DartPoet contains different `SpecObjects` which allows the creation from classes, interface and more (ClassSpec),
properties (PropertySpec), parameters(Parameters), annotations (Annotations), extensions(Extensions) and more.

Beth the body of a function, constructors is not modeled by any kind of object structure. There is also no
expression class, statement class or a syntax tree node. Instead, DartPoet uses placeholders to format the code blocks like `KotlinPoet`

Where do you want to go?

- To the `SpecObjects`? (Click here)
- To the [`Placeholders`?](placeholders.md)

**Note:** The team from Google is very active to enhance the programming language Dart which is a hard to stand update
with the specification from it.

0 comments on commit 607407e

Please sign in to comment.