New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin Support #27

Merged
merged 1 commit into from May 21, 2017

Conversation

Projects
None yet
2 participants
@kevcodez
Contributor

kevcodez commented May 21, 2017

No description provided.

@kevcodez

This comment has been minimized.

Contributor

kevcodez commented May 21, 2017

If there is anything to improve, please let me know ;)

Kotlin Grammar https://kotlinlang.org/docs/reference/grammar.html

Example Code https://learnxinyminutes.com/docs/kotlin/

@AndiDittrich AndiDittrich merged commit 034db5f into EnlighterJS:master May 21, 2017

@kevcodez

This comment has been minimized.

Contributor

kevcodez commented May 21, 2017

@AndiDittrich would love to see a new plugin release for wordpress, if possible :)

@AndiDittrich

This comment has been minimized.

Member

AndiDittrich commented May 22, 2017

Do you have any kotlin example code owned by yours ? the example codes license is not compatible

@kevcodez

This comment has been minimized.

Contributor

kevcodez commented May 22, 2017

What about this one https://try.kotlinlang.org/#/Examples/Longer%20examples/HTML%20Builder/HTML%20Builder.kt ? From the official Kotlin page

If this is not sufficient, I am going to write some code

@AndiDittrich

This comment has been minimized.

Member

AndiDittrich commented Jun 5, 2017

need something with MIT license or similar .. a small testcase will be sufficient.

@kevcodez

This comment has been minimized.

Contributor

kevcodez commented Jun 5, 2017

Just wrote some sample code, free to use.

package com.example

import java.time.LocalDate

data class Person(var firstName: String, var lastName: String, var birthdate: LocalDate) {

    fun getAge(): Int {
        return LocalDate.now().year - birthdate.year;
    }

}

fun main(args: Array<String>) {
    val person1 = Person("Samuel", "Jackson", LocalDate.of(1948, 12, 21));
    val person2 = Person("Quentin", "Tarantino", LocalDate.of(1963, 3, 27))

    val persons = listOf<Person>(person1, person2)

    val personsAbove50 = persons.filter { it.getAge() > 50 }

    println(personsAbove50)

    println("First Name: ${person1.firstName}")

    val jsonString = """[
      {"firstName":"Samuel", "lastName": "Jackson"},
      {"firstName":"Quentin", "lastName": "Tarantino"}
    ]"""

    println(jsonString)
}

@AndiDittrich

This comment has been minimized.

Member

AndiDittrich commented Jun 5, 2017

Dear kevcodez,

i've just release EnlighterJS v2.11.0 including your Kotlin language support. https://enlighterjs.org/Language.Kotlin.html

it will be added to the next Enlighter WordPress Release

br, Andi

@AndiDittrich

This comment has been minimized.

Member

AndiDittrich commented Jun 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment