-
-
-
-
-
-
-
-
-
-
-
-`;
-}
-
-function formatDate(date: string): string {
- return moment(date, 'MMM DD, YYYY hh:mm').format('MMM DD, YYYY');
-}
-
-function getFeatures(features: ArticleFeature[] = []): string {
- return features
- .map(feature => {
- switch (feature) {
- case 'mathjax':
- return '';
- default:
- return ``;
- }
- })
- .join('\n');
-}
diff --git a/app/rss/RssGenerator.ts b/app/rss/RssGenerator.ts
deleted file mode 100644
index fef48a13e..000000000
--- a/app/rss/RssGenerator.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import {writeSync} from '../File';
-import {articles} from './articles';
-import * as RSS from 'rss';
-import * as _ from 'lodash';
-
-generate('rss.xml', articles, 20);
-generate('rss-full.xml', articles);
-
-function generate(name: string, articles: Article[], limit: number = articles.length) {
- const feed = new RSS({
- title: 'Kotlin Programming Language',
- description: 'News, blog posts, projects, podcasts, videos and other. All information about Kotlin.',
- feed_url: `http://kotlin.link/${name}`,
- site_url: 'http://kotlin.link/',
- image_url: 'http://kotlin.link/favicon.ico',
- docs: 'https://validator.w3.org/feed/docs/rss2.html',
- managingEditor: 'ruslan@ibragimov.by (Ruslan Ibragimov)',
- webMaster: 'ruslan@ibragimov.by (Ruslan Ibragimov)',
- copyright: 'CC0 1.0 Universal (CC0 1.0)',
- language: 'en',
- categories: ['Kotlin', 'Programming', 'JVM'],
- pubDate: new Date().toUTCString(),
- ttl: 30,
- generator: 'node-rss'
- });
-
- _.take(articles, limit).forEach(article => feed.item(article));
-
- writeSync(`./dist/${name}`, feed.xml());
-}
diff --git a/app/rss/articles.ts b/app/rss/articles.ts
deleted file mode 100644
index 0a0d80bd6..000000000
--- a/app/rss/articles.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import * as moment from 'moment';
-
-const fm = require('front-matter');
-const fs = require('fs');
-const markdown = require('./markdown');
-const articlesDir = fs.readdirSync('./app/rss/articles');
-
-articlesDir.forEach(article => validateArticle(article));
-
-const parseDate = date => moment(date, 'MMM DD, YYYY hh:mm');
-
-const sortByDate = (a, b) => {
- if (parseDate(a.date).isBefore(parseDate(b.date))) {
- return 1;
- } else if (parseDate(a.date).isAfter(parseDate(b.date))) {
- return -1;
- } else {
- return 0;
- }
-};
-
-const getFileName = name => {
- const escaped = name
- .split('') // split string on array of symbols
- .map(it => it.charCodeAt(0)) // convert string in corresponding codes
- .map(code => { // replace all special symbols with dash
- // See html codes: 32 - space, 47 - slash, 58 - colon, 64 - at, 91 - opening bracket, 96 - grave accent
- // http://ascii-code.com/
- if ((code > 31 && code < 48) ||
- (code > 57 && code < 65) ||
- (code > 90 && code < 97) ||
- (code > 122 && code < 256)) {
- return '-';
- } else {
- return String.fromCharCode(code); // return symbol instead of his code
- }
- })
- .join('')
- .replace(new RegExp('-$', 'g'), '') // Replace last dash in string with ''
- .replace(new RegExp('^-', 'g'), '') // Replace first dash in string with ''
- .replace(new RegExp('-+', 'g'), '-'); // Replace multiple dashes with one dash
-
- return `${escaped}.html`
-};
-
-export const articles: Article[] = articlesDir
- .filter(article => !article.startsWith('.'))
- .map(article => {
- const content = fs.readFileSync(`./app/rss/articles/${article}`, {encoding: 'UTF-8'});
-
- const data = fm(content);
-
- data.attributes.file = article;
- return data;
- })
- .map(article => {
- const attr = article.attributes;
-
- if (!attr.title || !attr.url || !attr.categories || !attr.author || !attr.date) {
- throw new Error(`Metadata not complete: ${JSON.stringify(attr)}`);
- }
-
- return article;
- })
- .map(article => {
- article.attributes.filename = getFileName(article.attributes.title);
- return article;
- })
- .map(article => {
- article.attributes.description = markdown(article.body);
- return article.attributes;
- })
- .sort(sortByDate);
-
-function validateArticle(name: string) {
- const invalid = ['\\', '/', ':', '*', '?', '"', '<', '>', '|'];
- const includes = invalid.find(symbol => name.includes(symbol));
-
- if (includes) {
- throw new Error(`File '${name}' includes restricted symbol '${includes}'.`);
- }
-}
diff --git a/app/rss/articles/.chinese/Redux for Android using Kotlin.md b/app/rss/articles/.chinese/Redux for Android using Kotlin.md
deleted file mode 100644
index ff1f558d2..000000000
--- a/app/rss/articles/.chinese/Redux for Android using Kotlin.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-title: 'Redux for Android using Kotlin'
-url: https://www.youtube.com/watch?v=BUAxqiGrKOc
-categories:
- - Kotlin
- - Android
-type: video
-lang: chinese
-author: Nevin Chen
-date: Nov 22, 2016 07:00
----
-
-
diff --git a/app/rss/articles/.links/An adventure with Kotlin - Part I.md b/app/rss/articles/.links/An adventure with Kotlin - Part I.md
deleted file mode 100644
index df81d7b03..000000000
--- a/app/rss/articles/.links/An adventure with Kotlin - Part I.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'An adventure with Kotlin - Part I'
-url: http://angrybyte.me/post/154701023805/kotlin-adventures-1
-categories:
- - Kotlin
- - Android
-author: Milos Marinkovic
-date: Dec 20, 2016 05:24
----
diff --git a/app/rss/articles/.links/Android: Improving sign-in experience with Google Sign-In and SmartLock.md b/app/rss/articles/.links/Android: Improving sign-in experience with Google Sign-In and SmartLock.md
deleted file mode 100644
index d1aa1e56e..000000000
--- a/app/rss/articles/.links/Android: Improving sign-in experience with Google Sign-In and SmartLock.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Android: Improving sign-in experience with Google Sign-In and SmartLock'
-url: https://medium.com/@p.tournaris/android-improving-sign-in-experience-with-google-sign-in-and-smartlock-f0bfd789602a#.djgn5w44q
-categories:
- - Kotlin
- - Android
-author: Pavlos-Petros Tournaris
-date: Dec 14, 2016 03:42
----
diff --git a/app/rss/articles/.links/Classes in Kotlin: More power with less effort.md b/app/rss/articles/.links/Classes in Kotlin: More power with less effort.md
deleted file mode 100644
index b52a5a961..000000000
--- a/app/rss/articles/.links/Classes in Kotlin: More power with less effort.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: 'Classes in Kotlin: More power with less effort'
-url: http://antonioleiva.com/classes-kotlin/
-categories:
- - Kotlin
-author: Antonio Leiva
-date: Dec 7, 2016 03:45
----
diff --git a/app/rss/articles/.links/Coding Functional Android Apps in Kotlin: Getting Started.md b/app/rss/articles/.links/Coding Functional Android Apps in Kotlin: Getting Started.md
deleted file mode 100644
index 43e503f3d..000000000
--- a/app/rss/articles/.links/Coding Functional Android Apps in Kotlin: Getting Started.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Coding Functional Android Apps in Kotlin: Getting Started'
-url: https://code.tutsplus.com/tutorials/start-developing-android-apps-with-kotlin-part-1--cms-27827
-categories:
- - Kotlin
- - Android
-author: Jessica Thornsby
-date: Dec 19, 2016 04:12
----
diff --git a/app/rss/articles/.links/Custom Views in Android with Kotlin.md b/app/rss/articles/.links/Custom Views in Android with Kotlin.md
deleted file mode 100644
index 524ba2f20..000000000
--- a/app/rss/articles/.links/Custom Views in Android with Kotlin.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Custom Views in Android with Kotlin'
-url: https://antonioleiva.com/custom-views-android-kotlin/
-categories:
- - Kotlin
- - Android
-author: Antonio Leiva
-date: Dec 27, 2016 05:18
----
diff --git a/app/rss/articles/.links/FoldingTabBar Comes to Android. Thank You, Google!.md b/app/rss/articles/.links/FoldingTabBar Comes to Android. Thank You, Google!.md
deleted file mode 100644
index a8bf57e0d..000000000
--- a/app/rss/articles/.links/FoldingTabBar Comes to Android. Thank You, Google!.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'FoldingTabBar Comes to Android. Thank You, Google!'
-url: https://yalantis.com/blog/foldingtabbar-for-android/
-categories:
- - Kotlin
- - Android
-author: Andriy Hristyan
-date: Dec 15, 2016 03:30
----
diff --git a/app/rss/articles/.links/Implementing Android App Shortcuts.md b/app/rss/articles/.links/Implementing Android App Shortcuts.md
deleted file mode 100644
index 16296de4e..000000000
--- a/app/rss/articles/.links/Implementing Android App Shortcuts.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Implementing Android App Shortcuts'
-url: https://medium.com/@andreworobator/implementing-android-app-shortcuts-74feb524959b#.vrst29h9p
-categories:
- - Kotlin
- - Android
-author: Andrew Orobator
-date: Dec 19, 2016 03:30
----
diff --git a/app/rss/articles/.links/Java vs. Kotlin: Should You Be Using Kotlin for Android Development?.md b/app/rss/articles/.links/Java vs. Kotlin: Should You Be Using Kotlin for Android Development?.md
deleted file mode 100644
index e2fca2cd9..000000000
--- a/app/rss/articles/.links/Java vs. Kotlin: Should You Be Using Kotlin for Android Development?.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Java vs. Kotlin: Should You Be Using Kotlin for Android Development?'
-url: https://code.tutsplus.com/articles/java-vs-kotlin-should-you-be-using-kotlin-for-android-development--cms-27846
-categories:
- - Kotlin
- - Android
-author: Jessica Thornsby
-date: Dec 12, 2016 04:08
----
diff --git a/app/rss/articles/.links/Kotlin VS Java: Basic Syntax Differences.md b/app/rss/articles/.links/Kotlin VS Java: Basic Syntax Differences.md
deleted file mode 100644
index 9dcae35d7..000000000
--- a/app/rss/articles/.links/Kotlin VS Java: Basic Syntax Differences.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Kotlin VS Java: Basic Syntax Differences'
-url: https://yalantis.com/blog/kotlin-vs-java-syntax/
-categories:
- - Kotlin
- - Java
-author: Irina Galata
-date: Dec 13, 2016 03:30
----
diff --git a/app/rss/articles/.links/Living (Android) without Kotlin.md b/app/rss/articles/.links/Living (Android) without Kotlin.md
deleted file mode 100644
index fb5af837f..000000000
--- a/app/rss/articles/.links/Living (Android) without Kotlin.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Living (Android) without Kotlin'
-url: https://hackernoon.com/living-android-without-kotlin-db7391a2b170#.kme29gfhg
-categories:
- - Kotlin
- - Android
-author: Piotr Ślesarew
-date: Dec 21, 2016 04:10
----
diff --git a/app/rss/articles/.links/Seductive Code.md b/app/rss/articles/.links/Seductive Code.md
deleted file mode 100644
index 7e434dcda..000000000
--- a/app/rss/articles/.links/Seductive Code.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Seductive Code'
-url: https://publicobject.com/2016/12/19/seductive-code/
-categories:
- - Kotlin
- - Java
-author: Jesse Wilson
-date: Dec 19, 2016 02:35
----
diff --git a/app/rss/articles/.links/Setting animation scale for Android UI tests.md b/app/rss/articles/.links/Setting animation scale for Android UI tests.md
deleted file mode 100644
index c63dd58d6..000000000
--- a/app/rss/articles/.links/Setting animation scale for Android UI tests.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Setting animation scale for Android UI tests'
-url: http://www.thedroidsonroids.com/blog/setting-animation-scale-for-android-ui-tests/
-categories:
- - Kotlin
- - Android
-author: Karol Wrótniak
-date: Dec 11, 2016 03:30
----
diff --git a/app/rss/articles/.new/Why You Must Try Kotlin For Android Development.md b/app/rss/articles/.new/Why You Must Try Kotlin For Android Development.md
deleted file mode 100644
index ec624d2a6..000000000
--- a/app/rss/articles/.new/Why You Must Try Kotlin For Android Development.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Why You Must Try Kotlin For Android Development ?'
-url: https://medium.com/@amitshekhar/why-you-must-try-kotlin-for-android-development-e14d00c8084b#.2w8jdujf8
-categories:
- - Kotlin
-author: Amit Shekhar
-date: Nov 10, 2016 03:06
----
-
diff --git "a/app/rss/articles/.russian/\320\221\320\265\320\263\320\273\321\213\320\271 \320\262\320\267\320\263\320\273\321\217\320\264 \320\275\320\260 Async-Await \320\262 Android.md" "b/app/rss/articles/.russian/\320\221\320\265\320\263\320\273\321\213\320\271 \320\262\320\267\320\263\320\273\321\217\320\264 \320\275\320\260 Async-Await \320\262 Android.md"
deleted file mode 100644
index 37e8a97da..000000000
--- "a/app/rss/articles/.russian/\320\221\320\265\320\263\320\273\321\213\320\271 \320\262\320\267\320\263\320\273\321\217\320\264 \320\275\320\260 Async-Await \320\262 Android.md"
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: 'Беглый взгляд на Async-Await в Android'
-url: https://habrahabr.ru/post/314574/
-lang: ru
-categories:
- - Kotlin
- - Android
-author: Макс Ровкин
-date: Nov 8, 2016 03:19
----
diff --git "a/app/rss/articles/.russian/\320\237\320\276\320\263\321\200\321\203\320\266\320\265\320\275\320\270\320\265 \320\262 Async-Await \320\262 Android.md" "b/app/rss/articles/.russian/\320\237\320\276\320\263\321\200\321\203\320\266\320\265\320\275\320\270\320\265 \320\262 Async-Await \320\262 Android.md"
deleted file mode 100644
index 3121732f4..000000000
--- "a/app/rss/articles/.russian/\320\237\320\276\320\263\321\200\321\203\320\266\320\265\320\275\320\270\320\265 \320\262 Async-Await \320\262 Android.md"
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: 'Погружение в Async-Await в Android'
-url: https://habrahabr.ru/post/314656/
-lang: ru
-categories:
- - Kotlin
- - Android
-author: Макс Ровкин
-date: Nov 9, 2016 03:20
----
diff --git a/app/rss/articles/.template.md b/app/rss/articles/.template.md
deleted file mode 100644
index c48e3a8e1..000000000
--- a/app/rss/articles/.template.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: ''
-url: https://domchristie.github.io/to-markdown/
-categories:
- -
- - Kotlin
-author: JetBrains
-date: Feb 20, 2016 15:44
-enclosure:
- url: http://site.com/file.mp3
- size: 42
----
diff --git a/app/rss/articles/Andrey Breslav Kotlin Coroutines, JVMLS 2016.md b/app/rss/articles/Andrey Breslav Kotlin Coroutines, JVMLS 2016.md
deleted file mode 100644
index 594ab0e54..000000000
--- a/app/rss/articles/Andrey Breslav Kotlin Coroutines, JVMLS 2016.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: 'Andrey Breslav: Kotlin Coroutines, JVMLS 2016'
-url: https://www.youtube.com/watch?v=4W3ruTWUhpw
-type: video
-categories:
- - Kotlin
- - Coroutines
-author: Andrey Breslav
-date: Aug 03, 2016 00:00
----
-
-
diff --git a/app/rss/articles/FRP + Kotlin.md b/app/rss/articles/FRP + Kotlin.md
deleted file mode 100644
index dcb3dbfc8..000000000
--- a/app/rss/articles/FRP + Kotlin.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-title: 'FRP + Kotlin'
-url: https://drive.google.com/file/d/0BxCm4NRlzb3PWjNNaG1KS0Utckk/view
-categories:
- - Kotlin
- - FP
-type: slides
-author: Giorgio Natili
-date: Nov 25, 2016 01:22
----
-
-![Photo from meetup](http://i.imgur.com/DOlI1Of.jpg)
-
-[Slides](https://drive.google.com/file/d/0BxCm4NRlzb3PWjNNaG1KS0Utckk/view)
diff --git a/app/rss/articles/Fun with Kotlin.md b/app/rss/articles/Fun with Kotlin.md
deleted file mode 100644
index fc2d2cdb9..000000000
--- a/app/rss/articles/Fun with Kotlin.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-title: 'Fun with Kotlin'
-url: https://vimeo.com/151846078
-type: video
-categories:
- - Kotlin
-author: Eder Bastos
-date: Jan 14, 2016 18:54
----
-
-[Fun with Kotlin](https://vimeo.com/151846078)
diff --git a/app/rss/articles/Functional Programming in Kotlin with funKTionale (Video).md b/app/rss/articles/Functional Programming in Kotlin with funKTionale (Video).md
deleted file mode 100644
index 560f84dd1..000000000
--- a/app/rss/articles/Functional Programming in Kotlin with funKTionale (Video).md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-title: 'Functional Programming in Kotlin with funKTionale (Video)'
-url: https://www.youtube.com/watch?v=klakgWp1KWg
-categories:
- - Kotlin
-type: video
-author: Mario Arias
-date: Dec 16, 2016 10:37
----
-
-[Slides](https://speakerdeck.com/marioariasc/functional-programming-in-kotlin-with-funktionale-2)
-
-
diff --git a/app/rss/articles/Functional Programming in Kotlin with funKTionale.md b/app/rss/articles/Functional Programming in Kotlin with funKTionale.md
deleted file mode 100644
index 5096587fc..000000000
--- a/app/rss/articles/Functional Programming in Kotlin with funKTionale.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: 'Functional Programming in Kotlin with funKTionale'
-url: https://speakerdeck.com/marioariasc/functional-programming-in-kotlin-with-funktionale-1
-categories:
- - Kotlin
- - Functional Programming
-type: slides
-author: Mario Arias
-date: Sep 29, 2016 08:04
----
-
-_v1_
-
-[Slides on SpeakerDeck](https://speakerdeck.com/marioariasc/functional-programming-in-kotlin-with-funktionale-1)
-
-_v2_
-
-[Slides on SpeakerDeck](https://speakerdeck.com/marioariasc/functional-programming-in-kotlin-with-funktionale-2)
diff --git a/app/rss/articles/GeeCON Prague 2014 Andrey Cheptsov - A Reactive and Type-safe Kotlin DSL for NoSQL and SQL.md b/app/rss/articles/GeeCON Prague 2014 Andrey Cheptsov - A Reactive and Type-safe Kotlin DSL for NoSQL and SQL.md
deleted file mode 100644
index d7076bd43..000000000
--- a/app/rss/articles/GeeCON Prague 2014 Andrey Cheptsov - A Reactive and Type-safe Kotlin DSL for NoSQL and SQL.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-title: 'GeeCON Prague 2014: Andrey Cheptsov - A Reactive and Type-safe Kotlin DSL for NoSQL and SQL'
-url: https://vimeo.com/110781020
-type: video
-categories:
- - Kotlin
- - SQL
-author: Andrey Cheptsov
-date: Nov 03, 2014 09:11
----
-[GeeCON Prague 2014: Andrey Cheptsov - A Reactive and Type-safe Kotlin DSL for NoSQL and SQL](https://vimeo.com/110781020)
diff --git a/app/rss/articles/Generating Kotlin Code for Better Refactorings, Tests, and IDE Support.md b/app/rss/articles/Generating Kotlin Code for Better Refactorings, Tests, and IDE Support.md
deleted file mode 100644
index b6cd0d90d..000000000
--- a/app/rss/articles/Generating Kotlin Code for Better Refactorings, Tests, and IDE Support.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: 'Generating Kotlin Code for Better Refactorings, Tests, and IDE Support'
-url: https://docs.google.com/presentation/d/1pgzNnA4R3LU4hPnx0KTvQ0NFj23rPyq-ROr8kOiaxlM/edit#slide=id.p
-categories:
- - Kotlin
-type: slides
-author: Eugene Petrenko
-date: Sep 20, 2016 11:51
----
-[Slides on Google Slides](https://docs.google.com/presentation/d/1pgzNnA4R3LU4hPnx0KTvQ0NFj23rPyq-ROr8kOiaxlM/edit#slide=id.p)
diff --git a/app/rss/articles/JVMLS 2015 - Flexible Types in Kotlin.md b/app/rss/articles/JVMLS 2015 - Flexible Types in Kotlin.md
deleted file mode 100644
index 126b38ae3..000000000
--- a/app/rss/articles/JVMLS 2015 - Flexible Types in Kotlin.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-title: 'JVMLS 2015 - Flexible Types in Kotlin'
-url: https://www.youtube.com/watch?v=2IhT8HACc2E
-type: video
-categories:
- - Kotlin
-author: Andrey Breslav
-date: Aug 12, 2015 21:54
----
-
-
diff --git a/app/rss/articles/Kotlin + Android.md b/app/rss/articles/Kotlin + Android.md
deleted file mode 100644
index a2b569fe3..000000000
--- a/app/rss/articles/Kotlin + Android.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: 'Kotlin + Android'
-url: https://speakerdeck.com/dmytrodanylyk/kotlin-plus-android
-type: slides
-categories:
- - Kotlin
- - Android
-author: Dmytro Danylyk
-date: Apr 21, 2016 11:08
----
-
-[Slides](https://speakerdeck.com/dmytrodanylyk/kotlin-plus-android)
diff --git a/app/rss/articles/Kotlin - Ready for Production.md b/app/rss/articles/Kotlin - Ready for Production.md
deleted file mode 100644
index f61fbdbe6..000000000
--- a/app/rss/articles/Kotlin - Ready for Production.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-title: 'Kotlin - Ready for Production'
-url: https://vimeo.com/181814363
-categories:
- - Kotlin
-type: video
-author: Hadi Hariri
-date: Sep 07, 2016 12:21
----
-
-
-Kotlin - Ready for Production : Hadi Hariri from JavaZone on Vimeo.
-
-[Transcript](https://realm.io/news/gotocph-hadi-hariri-kotlin-ready-for-production/)
diff --git a/app/rss/articles/Kotlin Lang.md b/app/rss/articles/Kotlin Lang.md
deleted file mode 100644
index a67d68fa9..000000000
--- a/app/rss/articles/Kotlin Lang.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: 'Kotlin Lang'
-url: https://speakerdeck.com/developer/kotlin-lang
-categories:
- - Kotlin
- - Android
-type: slides
-author: Jemo Mgebrishvili
-date: Nov 20, 2016 01:34
----
-
-[Slides](https://speakerdeck.com/developer/kotlin-lang)
diff --git a/app/rss/articles/Kotlin New Hope in a Java 6 Wasteland.md b/app/rss/articles/Kotlin New Hope in a Java 6 Wasteland.md
deleted file mode 100644
index c44f5b0fc..000000000
--- a/app/rss/articles/Kotlin New Hope in a Java 6 Wasteland.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: 'Kotlin: New Hope in a Java 6 Wasteland'
-url: https://speakerdeck.com/pardom/kotlin-new-hope-in-a-java-6-wasteland
-type: slides
-categories:
- - Kotlin
- - Android
-author: Michael Pardo
-date: May 09, 2015 00:00
----
-
-[Slides](https://speakerdeck.com/pardom/kotlin-new-hope-in-a-java-6-wasteland)
diff --git a/app/rss/articles/Kotlin Night London - Nov 2016.md b/app/rss/articles/Kotlin Night London - Nov 2016.md
deleted file mode 100644
index 86b7f491c..000000000
--- a/app/rss/articles/Kotlin Night London - Nov 2016.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: 'Kotlin Night London'
-url: https://www.youtube.com/watch?list=PLoo7Ank5cc7FaemZS4sZC0oFnSbdJ-PiH&v=TMZD1GxAC8E
-categories:
- - Kotlin
-type: video
-author: JetBrains
-date: Nov 15, 2016 12:26
----
-[Announce](https://blog.jetbrains.com/kotlin/2016/09/kotlin-night-in-london/) | [Post in Kotlin Blog](https://blog.jetbrains.com/kotlin/2016/11/kotlin-night-in-london-recordings/)
-
-
diff --git a/app/rss/articles/Kotlin NoSQL for MongoDB in Action.md b/app/rss/articles/Kotlin NoSQL for MongoDB in Action.md
deleted file mode 100644
index 98faabf4c..000000000
--- a/app/rss/articles/Kotlin NoSQL for MongoDB in Action.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: 'Kotlin NoSQL for MongoDB in Action'
-url: https://www.youtube.com/watch?v=80xgl3KThvM
-type: video
-categories:
- - Kotlin
- - SQL
-author: Andrey Cheptsov
-date: Oct 22, 2015 21:54
----
-
-
diff --git a/app/rss/articles/Kotlin for Java developers.md b/app/rss/articles/Kotlin for Java developers.md
deleted file mode 100644
index 851d845ac..000000000
--- a/app/rss/articles/Kotlin for Java developers.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: 'Kotlin for Java developers'
-url: https://www.youtube.com/watch?v=vmjfIRsawlg
-type: video
-categories:
- - Kotlin
-author: Hadi Hariri
-date: Dec 11, 2014 21:54
----
-
diff --git a/app/rss/articles/Kotlin in Real Projects.md b/app/rss/articles/Kotlin in Real Projects.md
deleted file mode 100644
index 8d8dbdf1d..000000000
--- a/app/rss/articles/Kotlin in Real Projects.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: 'Kotlin in Real Projects'
-url: https://www.youtube.com/watch?v=lpPbCWpBM3I
-categories:
- - Kotlin
-author: Anton Keks
-type: video
-date: Nov 01, 2016 12:48
----
-
-
-
diff --git a/app/rss/articles/Kotlin vs Java puzzlers - Svetlana Isakova.md b/app/rss/articles/Kotlin vs Java puzzlers - Svetlana Isakova.md
deleted file mode 100644
index d082f1f24..000000000
--- a/app/rss/articles/Kotlin vs Java puzzlers - Svetlana Isakova.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-title: 'Kotlin vs Java puzzlers'
-url: https://vimeo.com/105758307
-type: video
-categories:
- - Kotlin
-author: Svetlana Isakova
-date: Sep 10, 2014 09:17
----
-
-[Kotlin vs Java puzzlers - Svetlana Isakova](https://vimeo.com/105758307)
diff --git a/app/rss/articles/Link Kotlin DSL Anko.md b/app/rss/articles/Link Kotlin DSL Anko.md
deleted file mode 100644
index 07cb83148..000000000
--- a/app/rss/articles/Link Kotlin DSL Anko.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: 'Kotlin DSL: Anko'
-url: https://docs.google.com/presentation/d/12mkyGQZO22kf0_6kp2K6xyFdpg0nBLqGtNcVR-cV4M8/pub
-type: slides
-categories:
- - Kotlin
- - Android
-author: '@maciekjanusz'
-date: Apr 06, 2016 08:54
----
-
-[Kotlin DSL: Anko](https://docs.google.com/presentation/d/12mkyGQZO22kf0_6kp2K6xyFdpg0nBLqGtNcVR-cV4M8/pub)
diff --git a/app/rss/articles/Spring Tips the Kotlin Programming Language.md b/app/rss/articles/Spring Tips the Kotlin Programming Language.md
deleted file mode 100644
index 3e3ef2d50..000000000
--- a/app/rss/articles/Spring Tips the Kotlin Programming Language.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-title: 'Spring Tips: the Kotlin Programming Language'
-url: https://www.youtube.com/watch?v=90WRtrbRi0Y
-categories:
- - Kotlin
-author: Josh Long
-type: video
-date: Oct 19, 2016 09:23
----
-
-Hi Spring fans! In this tip, we’ll quickly look at the Kotlin programming language and some very high-level things you need to know when building Spring Boot and Kotlin applications
-
-
diff --git a/app/rss/articles/Type safe JavaFX CSS with TornadoFX.md b/app/rss/articles/Type safe JavaFX CSS with TornadoFX.md
deleted file mode 100644
index 51bb4cf5f..000000000
--- a/app/rss/articles/Type safe JavaFX CSS with TornadoFX.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: 'Type safe JavaFX CSS with TornadoFX'
-url: https://www.youtube.com/watch?v=rjc8_HGHy3c
-type: video
-categories:
- - Kotlin
- - TornadoFx
-author: Edvin Syse
-date: Apr 24, 2016 00:00
----
-
-
diff --git "a/app/rss/articles/[RU] Podcast \320\240\320\260\320\267\320\261\320\276\321\200 \320\237\320\276\320\273\320\265\321\202\320\276\320\262 Episode 102 \342\200\224 Kotlin, \321\202\320\265\321\201\321\202\321\213 \320\270 \320\267\320\264\320\276\321\200\320\276\320\262\321\213\320\271 \321\201\320\276\320\275.md" "b/app/rss/articles/[RU] Podcast \320\240\320\260\320\267\320\261\320\276\321\200 \320\237\320\276\320\273\320\265\321\202\320\276\320\262 Episode 102 \342\200\224 Kotlin, \321\202\320\265\321\201\321\202\321\213 \320\270 \320\267\320\264\320\276\321\200\320\276\320\262\321\213\320\271 \321\201\320\276\320\275.md"
deleted file mode 100644
index 9c243d93d..000000000
--- "a/app/rss/articles/[RU] Podcast \320\240\320\260\320\267\320\261\320\276\321\200 \320\237\320\276\320\273\320\265\321\202\320\276\320\262 Episode 102 \342\200\224 Kotlin, \321\202\320\265\321\201\321\202\321\213 \320\270 \320\267\320\264\320\276\321\200\320\276\320\262\321\213\320\271 \321\201\320\276\320\275.md"
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: '(RU) Podcast Разбор Полетов: Episode 102 — Kotlin, тесты и здоровый сон.'
-url: http://razbor-poletov.com/2016/02/episode-102.html
-categories:
- - Kotlin
- - Podcast
-author: Dmitry Jemerov, Viktor Gamov, Alexey Abashev, Anton Arphipov, Dmitry Churbanov, Anton Arhipov
-date: Feb 04, 2016 21:54
-enclosure:
- url: http://traffic.libsyn.com/razborpoletov/razbor_102.mp3
- size: 70319173
----
-
-## Мероприятия
-
-1. http://jbreak.ru/
-1. https://fosdem.org/2016/
-
-## Темки
-
-1. Kotlin 1.0 RC - Философия Kotlin
-1. JavaTest, TCK, JTreg и его связь с TestNG/JUnit и прочие вопросы в знатоку по этим вопросам
-1. Что нужно есть и сколько нужно спать, что бы быть белым русским мужчиной в Америке
-
-## Полезняшки
-
-1. Клиент для Redis - [Medis](https://github.com/luin/medis)
-1. http://kotlin.link/
-1. https://github.com/Originate/git-town
-1. https://libraries.io/
diff --git "a/app/rss/articles/[RU] \320\224\320\274\320\270\321\202\321\200\320\270\320\271 \320\237\320\276\320\273\320\270\321\211\321\203\320\272 - Kotlin + Android \320\277\321\200\320\260\320\272\321\202\320\270\321\207\320\265\321\201\320\272\320\270\320\271 \320\273\320\270\320\272\320\261\320\265\320\267.md" "b/app/rss/articles/[RU] \320\224\320\274\320\270\321\202\321\200\320\270\320\271 \320\237\320\276\320\273\320\270\321\211\321\203\320\272 - Kotlin + Android \320\277\321\200\320\260\320\272\321\202\320\270\321\207\320\265\321\201\320\272\320\270\320\271 \320\273\320\270\320\272\320\261\320\265\320\267.md"
deleted file mode 100644
index f6e597b7b..000000000
--- "a/app/rss/articles/[RU] \320\224\320\274\320\270\321\202\321\200\320\270\320\271 \320\237\320\276\320\273\320\270\321\211\321\203\320\272 - Kotlin + Android \320\277\321\200\320\260\320\272\321\202\320\270\321\207\320\265\321\201\320\272\320\270\320\271 \320\273\320\270\320\272\320\261\320\265\320\267.md"
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: '(RU) Дмитрий Полищук - Kotlin + Android: практический ликбез'
-url: https://www.youtube.com/watch?v=2oVpnArCdWI
-type: video
-categories:
- - Kotlin
- - Android
-author: 'Дмитрий Полищук'
-date: Mar 09, 2016 00:00
----
-
-
diff --git a/app/rss/markdown.ts b/app/rss/markdown.ts
deleted file mode 100644
index c486b5588..000000000
--- a/app/rss/markdown.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-const remark = require('remark');
-const html = require('remark-html');
-const hljs = require('remark-highlight.js');
-
-const processor = remark().use(html).use(hljs);
-
-module.exports = function (content) {
- return processor.process(content, {
- commonmark: true
- });
-};
diff --git a/app/src/locations.tsx b/app/src/locations.tsx
index c71f0e090..9c2726717 100644
--- a/app/src/locations.tsx
+++ b/app/src/locations.tsx
@@ -1,5 +1,9 @@
export function searchString(object: QueryParams): string {
- return "?" + Object.keys(object).map(key => `${key}=${encodeURIComponent(object[key])}`).join("&")
+ return "?" + Object
+ .keys(object)
+ .filter(key => object[key] !== "")
+ .map(key => `${key}=${encodeURIComponent(object[key])}`)
+ .join("&");
}
interface QueryParams {
diff --git a/app/src/page/page.tsx b/app/src/page/page.tsx
index 0c87ea7db..1cf7e8724 100644
--- a/app/src/page/page.tsx
+++ b/app/src/page/page.tsx
@@ -35,8 +35,6 @@ function reduceSubcategory(subcategory, searchTerm) {
return acc;
}, []);
- console.log(links);
-
return {
name: subcategory.name,
links
diff --git a/articles/.links/An adventure with Kotlin - Part I.kts b/articles/.links/An adventure with Kotlin - Part I.kts
new file mode 100644
index 000000000..6eb969923
--- /dev/null
+++ b/articles/.links/An adventure with Kotlin - Part I.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "An adventure with Kotlin - Part I",
+ url = "http://angrybyte.me/post/154701023805/kotlin-adventures-1",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Milos Marinkovic",
+ date = LocalDate.of(2016, 12, 20),
+ body = body
+)
diff --git a/articles/.links/Android: Improving sign-in experience with Google Sign-In and SmartLock.kts b/articles/.links/Android: Improving sign-in experience with Google Sign-In and SmartLock.kts
new file mode 100644
index 000000000..cbd8d7cca
--- /dev/null
+++ b/articles/.links/Android: Improving sign-in experience with Google Sign-In and SmartLock.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Android: Improving sign-in experience with Google Sign-In and SmartLock",
+ url = "https://medium.com/@p.tournaris/android-improving-sign-in-experience-with-google-sign-in-and-smartlock-f0bfd789602a#.djgn5w44q",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Pavlos-Petros Tournaris",
+ date = LocalDate.of(2016, 12, 14),
+ body = body
+)
diff --git a/articles/.links/Classes in Kotlin: More power with less effort.kts b/articles/.links/Classes in Kotlin: More power with less effort.kts
new file mode 100644
index 000000000..dfe3f712f
--- /dev/null
+++ b/articles/.links/Classes in Kotlin: More power with less effort.kts
@@ -0,0 +1,23 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Classes in Kotlin: More power with less effort",
+ url = "http://antonioleiva.com/classes-kotlin/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Antonio Leiva",
+ date = LocalDate.of(2016, 12, 7),
+ body = body
+)
diff --git a/articles/.links/Coding Functional Android Apps in Kotlin: Getting Started.kts b/articles/.links/Coding Functional Android Apps in Kotlin: Getting Started.kts
new file mode 100644
index 000000000..63f0cd9f6
--- /dev/null
+++ b/articles/.links/Coding Functional Android Apps in Kotlin: Getting Started.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Coding Functional Android Apps in Kotlin: Getting Started",
+ url = "https://code.tutsplus.com/tutorials/start-developing-android-apps-with-kotlin-part-1--cms-27827",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Jessica Thornsby",
+ date = LocalDate.of(2016, 12, 19),
+ body = body
+)
diff --git a/articles/.links/Custom Views in Android with Kotlin.kts b/articles/.links/Custom Views in Android with Kotlin.kts
new file mode 100644
index 000000000..56db434dc
--- /dev/null
+++ b/articles/.links/Custom Views in Android with Kotlin.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Custom Views in Android with Kotlin",
+ url = "https://antonioleiva.com/custom-views-android-kotlin/",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Antonio Leiva",
+ date = LocalDate.of(2016, 12, 27),
+ body = body
+)
diff --git a/articles/.links/FoldingTabBar Comes to Android. Thank You, Google!.kts b/articles/.links/FoldingTabBar Comes to Android. Thank You, Google!.kts
new file mode 100644
index 000000000..e786d6e30
--- /dev/null
+++ b/articles/.links/FoldingTabBar Comes to Android. Thank You, Google!.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "FoldingTabBar Comes to Android. Thank You, Google!",
+ url = "https://yalantis.com/blog/foldingtabbar-for-android/",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Andriy Hristyan",
+ date = LocalDate.of(2016, 12, 15),
+ body = body
+)
diff --git a/articles/.links/Implementing Android App Shortcuts.kts b/articles/.links/Implementing Android App Shortcuts.kts
new file mode 100644
index 000000000..611d6d0f1
--- /dev/null
+++ b/articles/.links/Implementing Android App Shortcuts.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Implementing Android App Shortcuts",
+ url = "https://medium.com/@andreworobator/implementing-android-app-shortcuts-74feb524959b#.vrst29h9p",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Andrew Orobator",
+ date = LocalDate.of(2016, 12, 19),
+ body = body
+)
diff --git a/articles/.links/Java vs. Kotlin: Should You Be Using Kotlin for Android Development?.kts b/articles/.links/Java vs. Kotlin: Should You Be Using Kotlin for Android Development?.kts
new file mode 100644
index 000000000..1a9e350ab
--- /dev/null
+++ b/articles/.links/Java vs. Kotlin: Should You Be Using Kotlin for Android Development?.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Java vs. Kotlin: Should You Be Using Kotlin for Android Development?",
+ url = "https://code.tutsplus.com/articles/java-vs-kotlin-should-you-be-using-kotlin-for-android-development--cms-27846",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Jessica Thornsby",
+ date = LocalDate.of(2016, 12, 12),
+ body = body
+)
diff --git a/articles/.links/Kotlin VS Java: Basic Syntax Differences.kts b/articles/.links/Kotlin VS Java: Basic Syntax Differences.kts
new file mode 100644
index 000000000..fb23648fe
--- /dev/null
+++ b/articles/.links/Kotlin VS Java: Basic Syntax Differences.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Kotlin VS Java: Basic Syntax Differences",
+ url = "https://yalantis.com/blog/kotlin-vs-java-syntax/",
+ categories = listOf(
+ "Kotlin",
+ "Java"
+ ),
+ type = article,
+ lang = EN,
+ author = "Irina Galata",
+ date = LocalDate.of(2016, 12, 13),
+ body = body
+)
diff --git a/articles/.links/Living (Android) without Kotlin.kts b/articles/.links/Living (Android) without Kotlin.kts
new file mode 100644
index 000000000..a1f8f9c8b
--- /dev/null
+++ b/articles/.links/Living (Android) without Kotlin.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Living (Android) without Kotlin",
+ url = "https://hackernoon.com/living-android-without-kotlin-db7391a2b170#.kme29gfhg",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Piotr Ślesarew",
+ date = LocalDate.of(2016, 12, 21),
+ body = body
+)
diff --git a/articles/.links/Seductive Code.kts b/articles/.links/Seductive Code.kts
new file mode 100644
index 000000000..fc6407907
--- /dev/null
+++ b/articles/.links/Seductive Code.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Seductive Code",
+ url = "https://publicobject.com/2016/12/19/seductive-code/",
+ categories = listOf(
+ "Kotlin",
+ "Java"
+ ),
+ type = article,
+ lang = EN,
+ author = "Jesse Wilson",
+ date = LocalDate.of(2016, 12, 19),
+ body = body
+)
diff --git a/articles/.links/Setting animation scale for Android UI tests.kts b/articles/.links/Setting animation scale for Android UI tests.kts
new file mode 100644
index 000000000..8af5e2887
--- /dev/null
+++ b/articles/.links/Setting animation scale for Android UI tests.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Setting animation scale for Android UI tests",
+ url = "http://www.thedroidsonroids.com/blog/setting-animation-scale-for-android-ui-tests/",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Karol Wrótniak",
+ date = LocalDate.of(2016, 12, 11),
+ body = body
+)
diff --git a/articles/.links/Why You Must Try Kotlin For Android Development.kts b/articles/.links/Why You Must Try Kotlin For Android Development.kts
new file mode 100644
index 000000000..f1f872809
--- /dev/null
+++ b/articles/.links/Why You Must Try Kotlin For Android Development.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+
+"""
+
+Article(
+ title = "Why You Must Try Kotlin For Android Development?",
+ url = "https://medium.com/@amitshekhar/why-you-must-try-kotlin-for-android-development-e14d00c8084b#.2w8jdujf8",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Amit Shekhar",
+ date = LocalDate.of(2016, 11, 10),
+ body = body
+)
diff --git a/app/rss/articles/.new/Draft b/articles/.new/Draft
similarity index 100%
rename from app/rss/articles/.new/Draft
rename to articles/.new/Draft
diff --git a/articles/chinese/Redux for Android using Kotlin.kts b/articles/chinese/Redux for Android using Kotlin.kts
new file mode 100644
index 000000000..43873fd4f
--- /dev/null
+++ b/articles/chinese/Redux for Android using Kotlin.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.ZH
+import link.kotlin.scripts.LinkType.video
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+"""
+
+Article(
+ title = "Redux for Android using Kotlin",
+ url = "https://www.youtube.com/watch?v=BUAxqiGrKOc",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = video,
+ lang = ZH,
+ author = "Nevin Chen",
+ date = LocalDate.of(2016, 11, 22),
+ body = body
+)
diff --git a/app/rss/articles/Exploring the Kotlin Standard Library - Part 1.md b/articles/english/2013/Exploring the Kotlin Standard Library - Part 1.kts
similarity index 94%
rename from app/rss/articles/Exploring the Kotlin Standard Library - Part 1.md
rename to articles/english/2013/Exploring the Kotlin Standard Library - Part 1.kts
index 752bb0337..b51d73ac5 100644
--- a/app/rss/articles/Exploring the Kotlin Standard Library - Part 1.md
+++ b/articles/english/2013/Exploring the Kotlin Standard Library - Part 1.kts
@@ -1,11 +1,11 @@
----
-title: 'Exploring the Kotlin Standard Library - Part 1'
-url: http://jamie.mccrindle.org/2013/01/exploring-kotlin-standard-library-part-1.html
-categories:
- - Kotlin
-author: Jamie McCrindle
-date: Jan 22, 2013 05:01
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Exploring the API docs and source code for a language's standard library is usually illuminating and Kotlin is no different. In this series, I thought I'd look at some of the highlights of the Kotlin stdlib. In Part 1, I'll be going over the default Kotlin namespace.
Both the [API docs](http://jetbrains.github.com/kotlin/versions/snapshot/apidocs/index.html) and the [source code](https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib) for the stdlib are available on github.
@@ -251,3 +251,17 @@ assertEquals(listOf(1, 2, 3, 4, 5), (1..100) takeWhile { it <= 5 })
val takeWhileToList = arrayListOf()
assertEquals(listOf(1, 2, 3, 4, 5), (1..100).takeWhileTo(takeWhileToList) { it <= 5 })
```
+"""
+
+Article(
+ title = "Exploring the Kotlin Standard Library - Part 1",
+ url = "http://jamie.mccrindle.org/2013/01/exploring-kotlin-standard-library-part-1.html",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = LanguageCodes.EN,
+ author = "Jamie McCrindle",
+ date = LocalDate.of(2013, 1, 22),
+ body = body
+)
diff --git a/app/rss/articles/Exploring the Kotlin Standard Library - Part 2.md b/articles/english/2013/Exploring the Kotlin Standard Library - Part 2.kts
similarity index 90%
rename from app/rss/articles/Exploring the Kotlin Standard Library - Part 2.md
rename to articles/english/2013/Exploring the Kotlin Standard Library - Part 2.kts
index 43604db1d..c9b9b5335 100644
--- a/app/rss/articles/Exploring the Kotlin Standard Library - Part 2.md
+++ b/articles/english/2013/Exploring the Kotlin Standard Library - Part 2.kts
@@ -1,11 +1,11 @@
----
-title: 'Exploring the Kotlin Standard Library - Part 2'
-url: http://jamie.mccrindle.org/2013/01/exploring-kotlin-standard-library-part-2.html
-categories:
- - Kotlin
-author: Jamie McCrindle
-date: Jan 25, 2013 07:58
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
In [Part 1](http://jamie.mccrindle.org/2013/01/exploring-kotlin-standard-library-part-1.html) of this series, I went through the default Kotlin namespace. In Part 2 I'll be going over [kotlin.io](http://jetbrains.github.com/kotlin/versions/snapshot/apidocs/kotlin/io/package-summary.html).
Most of the public function in kotlin.io are overloaded versions of print and println, which all delegate to System.out.
@@ -148,3 +148,18 @@ File("/tmp/helloworld.bin").writeBytes("Hello World!".getBytes())
// write Hello World as bytes to /tmp/helloworld.txt
File("/tmp/helloworld.txt").writeText("Hello World!")
```
+
+"""
+
+Article(
+ title = "Exploring the Kotlin Standard Library - Part 2",
+ url = "http://jamie.mccrindle.org/2013/01/exploring-kotlin-standard-library-part-2.html",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Jamie McCrindle",
+ date = LocalDate.of(2013, 1, 25),
+ body = body
+)
diff --git a/app/rss/articles/Exploring the Kotlin Standard Library - Part 3.md b/articles/english/2013/Exploring the Kotlin Standard Library - Part 3.kts
similarity index 88%
rename from app/rss/articles/Exploring the Kotlin Standard Library - Part 3.md
rename to articles/english/2013/Exploring the Kotlin Standard Library - Part 3.kts
index 829088eaa..f9754330a 100644
--- a/app/rss/articles/Exploring the Kotlin Standard Library - Part 3.md
+++ b/articles/english/2013/Exploring the Kotlin Standard Library - Part 3.kts
@@ -1,11 +1,11 @@
----
-title: 'Exploring the Kotlin Standard Library - Part 3'
-url: http://jamie.mccrindle.org/2013/02/exploring-kotlin-standard-library-part-3.html
-categories:
- - Kotlin
-author: Jamie McCrindle
-date: Feb 07, 2013 09:04
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
In [Part 1](http://jamie.mccrindle.org/2013/01/exploring-kotlin-standard-library-part-1.html) and [Part 2](http://jamie.mccrindle.org/2013/01/exploring-kotlin-standard-library-part-2.html) of this series, I went through the default Kotlin namespace and kotlin.io. In Part 3 I'll be going over kotlin.concurrent.
The public functions in kotlin.concurrent are all utilities for creating timers, threads or timer tasks e.g.
@@ -145,3 +145,18 @@ val tryLockResult = tryLock.tryLock({
// run if we couldn't get a lock
});
```
+
+"""
+
+Article(
+ title = "Exploring the Kotlin Standard Library - Part 3",
+ url = "http://jamie.mccrindle.org/2013/02/exploring-kotlin-standard-library-part-3.html",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Jamie McCrindle",
+ date = LocalDate.of(2013, 2, 7),
+ body = body
+)
diff --git a/app/rss/articles/The Advent of Kotlin A Conversation with JetBrains' Andrey Breslav.md b/articles/english/2013/The Advent of Kotlin A Conversation with JetBrains' Andrey Breslav.kts
similarity index 96%
rename from app/rss/articles/The Advent of Kotlin A Conversation with JetBrains' Andrey Breslav.md
rename to articles/english/2013/The Advent of Kotlin A Conversation with JetBrains' Andrey Breslav.kts
index ae517ed15..68387c7c1 100644
--- a/app/rss/articles/The Advent of Kotlin A Conversation with JetBrains' Andrey Breslav.md
+++ b/articles/english/2013/The Advent of Kotlin A Conversation with JetBrains' Andrey Breslav.kts
@@ -1,11 +1,11 @@
----
-title: 'The Advent of Kotlin: A Conversation with JetBrains'' Andrey Breslav'
-url: http://www.oracle.com/technetwork/articles/java/breslav-1932170.html
-categories:
- - Kotlin
-author: Janice J. Heiss
-date: Apr 02, 2013 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
**Learn about Kotlin, a new statically typed language for the JVM.**
_Among the important Java software developments in recent years is the advent of such alternative languages for the JVM as Groovy, Jython, and JRuby—and, more recently, the rise of Scala. A new statically typed language, Kotlin, named after a Russian island off the coast of St. Petersburg, where Kotlin's Andrey Breslav and the Kotlin team reside, has recently been getting attention. A brainchild of the highly lauded Czech software development company JetBrains, maker of the Java IDE IntelliJ IDEA, Kotlin was named Language of the Month in the_ [_January 2012 issue of_ Dr. Dobb's Journal](http://www.drdobbs.com/jvm/language-of-the-month-kotlin/232600836?pgno=2).
@@ -180,3 +180,18 @@ Janice J. Heiss is the Java acquisitions editor at Oracle and a technology edito
## Join the Conversation
Join the Java community conversation on [Facebook](https://www.facebook.com/ilovejava), [Twitter](https://twitter.com/#!/java), and the [Java Source Blog](https://blogs.oracle.com/java/)!
+
+"""
+
+Article(
+ title = "The Advent of Kotlin: A Conversation with JetBrains' Andrey Breslav",
+ url = "http://www.oracle.com/technetwork/articles/java/breslav-1932170.html",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Janice J. Heiss",
+ date = LocalDate.of(2013, 4, 2),
+ body = body
+)
diff --git "a/app/rss/articles/The Adventurous Developer\342\200\231s Guide to JVM languages \342\200\223 Kotlin.md" "b/articles/english/2013/The Adventurous Developer\342\200\231s Guide to JVM languages \342\200\223 Kotlin.kts"
similarity index 95%
rename from "app/rss/articles/The Adventurous Developer\342\200\231s Guide to JVM languages \342\200\223 Kotlin.md"
rename to "articles/english/2013/The Adventurous Developer\342\200\231s Guide to JVM languages \342\200\223 Kotlin.kts"
index 8eef6b88c..b073ec8c1 100644
--- "a/app/rss/articles/The Adventurous Developer\342\200\231s Guide to JVM languages \342\200\223 Kotlin.md"
+++ "b/articles/english/2013/The Adventurous Developer\342\200\231s Guide to JVM languages \342\200\223 Kotlin.kts"
@@ -1,11 +1,11 @@
----
-title: 'The Adventurous Developer’s Guide to JVM languages – Kotlin'
-url: http://zeroturnaround.com/rebellabs/the-adventurous-developers-guide-to-jvm-languages-kotlin/
-categories:
- - Kotlin
-author: Simon Maple
-date: Jan 23, 2013 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
In this post we will focus on [Kotlin](http://kotlin.jetbrains.org/), with a simple [HTTP Server coding example](https://github.com/sjmaple/Kotlin-HTTP-Server) to showcase the language features and coding syntax.
[![](http://devnet.jetbrains.net/servlet/JiveServlet/showImage/2-5456865-25537/KotlinLogo.png)](http://devnet.jetbrains.net/servlet/JiveServlet/showImage/2-5456865-25537/KotlinLogo.png)
@@ -141,3 +141,18 @@ I’d like to look back in 6 months or a year to see how Kotlin has evolved, and
**Don’t forget to check out the [HTTP Server sample Kotlin code on Github](https://github.com/sjmaple/Kotlin-HTTP-Server).**
_Psst! If you liked this post, [we wrote a 50-page RebelLabs report](http://zeroturnaround.com/rebellabs/devs/the-adventurous-developers-guide-to-jvm-languages/) on Java 8, Scala, Groovy, Fantom, Clojure, Ceylon, Kotlin & Xtend._
+
+"""
+
+Article(
+ title = "The Adventurous Developer’s Guide to JVM languages – Kotlin",
+ url = "http://zeroturnaround.com/rebellabs/the-adventurous-developers-guide-to-jvm-languages-kotlin/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Simon Maple",
+ date = LocalDate.of(2013, 1, 23),
+ body = body
+)
diff --git a/articles/english/2014/GeeCON Prague 2014 Andrey Cheptsov - A Reactive and Type-safe Kotlin DSL for NoSQL and SQL.kts b/articles/english/2014/GeeCON Prague 2014 Andrey Cheptsov - A Reactive and Type-safe Kotlin DSL for NoSQL and SQL.kts
new file mode 100644
index 000000000..be66a40c1
--- /dev/null
+++ b/articles/english/2014/GeeCON Prague 2014 Andrey Cheptsov - A Reactive and Type-safe Kotlin DSL for NoSQL and SQL.kts
@@ -0,0 +1,25 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+[GeeCON Prague 2014: Andrey Cheptsov - A Reactive and Type-safe Kotlin DSL for NoSQL and SQL](https://vimeo.com/110781020)
+
+"""
+
+Article(
+ title = "GeeCON Prague 2014: Andrey Cheptsov - A Reactive and Type-safe Kotlin DSL for NoSQL and SQL",
+ url = "https://vimeo.com/110781020",
+ categories = listOf(
+ "Kotlin",
+ "SQL"
+ ),
+ type = video,
+ lang = EN,
+ author = "Andrey Cheptsov",
+ date = LocalDate.of(2014, 11, 3),
+ body = body
+)
diff --git a/articles/english/2014/Kotlin for Java developers.kts b/articles/english/2014/Kotlin for Java developers.kts
new file mode 100644
index 000000000..557284374
--- /dev/null
+++ b/articles/english/2014/Kotlin for Java developers.kts
@@ -0,0 +1,24 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+
+"""
+
+Article(
+ title = "Kotlin for Java developers",
+ url = "https://www.youtube.com/watch?v=vmjfIRsawlg",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = video,
+ lang = EN,
+ author = "Hadi Hariri",
+ date = LocalDate.of(2014, 12, 11),
+ body = body
+)
diff --git a/articles/english/2014/Kotlin vs Java puzzlers - Svetlana Isakova.kts b/articles/english/2014/Kotlin vs Java puzzlers - Svetlana Isakova.kts
new file mode 100644
index 000000000..3a483fa94
--- /dev/null
+++ b/articles/english/2014/Kotlin vs Java puzzlers - Svetlana Isakova.kts
@@ -0,0 +1,25 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+[Kotlin vs Java puzzlers - Svetlana Isakova](https://vimeo.com/105758307)
+
+"""
+
+Article(
+ title = "Kotlin vs Java puzzlers",
+ url = "https://vimeo.com/105758307",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = video,
+ lang = EN,
+ author = "Svetlana Isakova",
+ date = LocalDate.of(2014, 9, 10),
+ body = body
+)
diff --git a/app/rss/articles/Non-trivial constructors in Kotlin.md b/articles/english/2014/Non-trivial constructors in Kotlin.kts
similarity index 87%
rename from app/rss/articles/Non-trivial constructors in Kotlin.md
rename to articles/english/2014/Non-trivial constructors in Kotlin.kts
index 78e046fab..15fdca93f 100644
--- a/app/rss/articles/Non-trivial constructors in Kotlin.md
+++ b/articles/english/2014/Non-trivial constructors in Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'Non-trivial constructors in Kotlin'
-url: http://alexshabanov.com/2014/12/01/non-trivial-constructors-in-kotlin/
-categories:
- - Kotlin
-author: Alex Shabanov
-date: Dec 01, 2014 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Kotlin really simplifies things such as defining constructors and writing immutable objects for your application. For example, flexible Kotlin constructor definitions eliminate the need of [builder classes](http://en.wikipedia.org/wiki/Builder_pattern "Builder Pattern - Wikipedia") (you simply don’t need them in 99% of all the possible use cases, if you use Kotlin), thus reducing overhead of having immutable objects in your application, while retaining full flexibility and expressiveness.
However, if you want to define non-trivial constructor (especially for [data classes](http://kotlinlang.org/docs/reference/data-classes.html "Kotlin Data Classes")) it might not be as trivial as just writing a function.
@@ -56,3 +56,18 @@ val r2 = Ratio(numerator = 1, denominator = 4) // invoke will be called here
```
This is it, I hope you find it useful.
+
+"""
+
+Article(
+ title = "Non-trivial constructors in Kotlin",
+ url = "http://alexshabanov.com/2014/12/01/non-trivial-constructors-in-kotlin/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Alex Shabanov",
+ date = LocalDate.of(2014, 12, 1),
+ body = body
+)
diff --git a/app/rss/articles/Android + Kotlin = love.md b/articles/english/2015/Android + Kotlin = love.kts
similarity index 94%
rename from app/rss/articles/Android + Kotlin = love.md
rename to articles/english/2015/Android + Kotlin = love.kts
index 8194ff8cb..107e7c8e7 100644
--- a/app/rss/articles/Android + Kotlin = love.md
+++ b/articles/english/2015/Android + Kotlin = love.kts
@@ -1,12 +1,11 @@
----
-title: 'Android + Kotlin = <3'
-url: http://blog.zuehlke.com/en/android-kotlin/
-categories:
- - Kotlin
- - Android
-author: Michael Sattler
-date: Jul 20, 2015 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
The Android SDK has come a long way since its early days to make developing for Android as comfortable and efficient as possible. Yet there’s one thing that still gets in our way: The Java language. While more modern languages like C# or Swift make it possible to write code that is elegant and at the same time easy to read and understand, we’re still stuck with Java 7 for Android Development. Its cumbersome syntax for executing code on a different thread asynchronously, for example, or the fact that you require separate libs for even the most basic tasks like null-safe string comparison really make it a pain for development.
## A New Hope
@@ -44,7 +43,7 @@ When adding a property to your class, you don’t write the backing field and ge
public var context: Context? = null
get
set (value) {
- $context = value
+ ${"$"}context = value
if (context != null) {
setupBluetooth()
}
@@ -117,7 +116,7 @@ When passing Lambdas to functions, they are usually in-lined in the function cal
```kotlin
private var myCallback: Function1 = { param1: String ->
- println("Hi $param1")
+ println("Hi ${"$"}param1")
}
```
@@ -174,7 +173,7 @@ use { // Now "this" is the SQLiteDatabase, opened for read/write
"title" to item.title,
"checked" to item.checked)
} catch (exception: SQLiteException) { // SQL exceptions can still occur, of course
- error("INSERT threw exception: $exception")
+ error("INSERT threw exception: ${"$"}exception")
}
} // At the end of the block the DB is automatically closed
```
@@ -192,7 +191,7 @@ use {
parseList(classParser())
}
} catch (exception: SQLiteException) {
- error("SELECT threw exception: $exception")
+ error("SELECT threw exception: ${"$"}exception")
}
}
// Now process the result list
@@ -205,3 +204,19 @@ And this is just the tip of the iceberg! Anko also provides simplified mechanism
## Conclusion
Having tried out Kotlin in the context of Android development now, I can definitely see it becoming my new language of choice for Android development. It’s well made, mature and makes coding an absolute joy. The official Android documentation may be written for Java, but it’s easy to “translate” it to Kotlin, so any Android developer should definitely give Kotlin & Anko a try. Here’s hoping that Google will provide an Android API reference & guide in Kotlin in the near future, and that it will eventually become the de-facto standard for Android!
+
+"""
+
+Article(
+ title = "Android + Kotlin = <3",
+ url = "http://blog.zuehlke.com/en/android-kotlin/",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Michael Sattler",
+ date = LocalDate.of(2015, 7, 20),
+ body = body
+)
diff --git "a/app/rss/articles/Building APIs on the JVM Using Kotlin and Spark \342\200\223 Part 1.md" "b/articles/english/2015/Building APIs on the JVM Using Kotlin and Spark \342\200\223 Part 1.kts"
similarity index 98%
rename from "app/rss/articles/Building APIs on the JVM Using Kotlin and Spark \342\200\223 Part 1.md"
rename to "articles/english/2015/Building APIs on the JVM Using Kotlin and Spark \342\200\223 Part 1.kts"
index 00f080efa..37147231a 100644
--- "a/app/rss/articles/Building APIs on the JVM Using Kotlin and Spark \342\200\223 Part 1.md"
+++ "b/articles/english/2015/Building APIs on the JVM Using Kotlin and Spark \342\200\223 Part 1.kts"
@@ -1,11 +1,11 @@
----
-title: 'Building APIs on the JVM Using Kotlin and Spark – Part 1'
-url: http://nordicapis.com/building-apis-on-the-jvm-using-kotlin-and-spark-part-1/
-categories:
- - Kotlin
-author: Travis Spencer
-date: Aug 06, 2015 09:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
![Building-APIs-JVM-kotlin-spark-java-nordic-apis-pt-1](http://nordicapis.com/wp-content/uploads/Building-APIs-JVM-kotlin-spark-java-nordic-apis-pt-1.png)
When you start a new API project, one of the first questions to answer is what programming language to use. Picking the right one can make all the difference. Some languages help solve certain problems while others inhibit solutions. Even after a language is chosen and tens-of-thousands of lines of code have been written, there is the possibility of reducing complexity by using new languages on the same **runtime**.
@@ -377,3 +377,18 @@ _[Disclosure: PayPal is a sponsor of the Java Stockholm meetup being produced by
+
+"""
+
+Article(
+ title = "Building APIs on the JVM Using Kotlin and Spark – Part 1",
+ url = "http://nordicapis.com/building-apis-on-the-jvm-using-kotlin-and-spark-part-1/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Travis Spencer",
+ date = LocalDate.of(2015, 8, 6),
+ body = body
+)
diff --git a/app/rss/articles/Early Impressions of Kotlin.md b/articles/english/2015/Early Impressions of Kotlin.kts
similarity index 96%
rename from app/rss/articles/Early Impressions of Kotlin.md
rename to articles/english/2015/Early Impressions of Kotlin.kts
index eb3b0a725..3bba520b9 100644
--- a/app/rss/articles/Early Impressions of Kotlin.md
+++ b/articles/english/2015/Early Impressions of Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'Early Impressions of Kotlin'
-url: http://natpryce.com/articles/000815.html
-categories:
- - Kotlin
-author: Nat Pryce
-date: Dec 30, 2015 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
We’ve been using the [Kotlin](https://kotlinlang.org) programming language for a few weeks on our latest project to perform technical experiments, explore the problem space, and write a few HTTP services. I’ve also ported [Hamcrest](https://github.com/hamcrest/JavaHamcrest) to Kotlin, as [HamKrest](https://github.com/npryce/hamkrest), to help us write tests, and written a small library for [type safe configuration](https://github.com/npryce/konfig) of our services.
## Why Kotlin?
@@ -154,4 +154,18 @@ For object-oriented programming, Kotlin’s concise syntax for class definitions
However, most Java out there is monomorphic, procedural code moving data between “[NOJOs](http://puttingtheteaintoteam.blogspot.co.uk/2008/10/is-that-pojo-or-nojo.html)” and APIs that expect objects to have “bean” getters and setters. Kotlin has made working with that kind of API much easier and far more concise than doing so in Java.
-1. As far as I can tell, RedHat sponsor development of Ceylon but do not actually use it to develop their own products. If I’m wrong, please let me know in the comments.[↩](#fnref1)
\ No newline at end of file
+1. As far as I can tell, RedHat sponsor development of Ceylon but do not actually use it to develop their own products. If I’m wrong, please let me know in the comments.[↩](#fnref1)
+"""
+
+Article(
+ title = "Early Impressions of Kotlin",
+ url = "http://natpryce.com/articles/000815.html",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Nat Pryce",
+ date = LocalDate.of(2015, 12, 30),
+ body = body
+)
diff --git a/app/rss/articles/Exploring Kotlin.md b/articles/english/2015/Exploring Kotlin.kts
similarity index 96%
rename from app/rss/articles/Exploring Kotlin.md
rename to articles/english/2015/Exploring Kotlin.kts
index d67cf9dd6..8a099c9e9 100644
--- a/app/rss/articles/Exploring Kotlin.md
+++ b/articles/english/2015/Exploring Kotlin.kts
@@ -1,12 +1,11 @@
----
-title: 'Exploring Kotlin'
-url: http://blog.cacoethes.co.uk/software/exploring-kotlin
-categories:
- - Kotlin
- - Groovy
-author: Peter Ledbrook
-date: Jun 27, 2015 21:54
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
_This post is outdated, because Kotlin have a lot changes from June, 2015_
@@ -91,3 +90,19 @@ One final thing I learned is that I hate generics. Really. I think Kotlin’s
As I said at the beginning of the post, Kotlin is an evolution rather than a revolution. That’s why I think it has a reasonable chance of success. Will it prove a significant competitor to Java? I don’t know, but I doubt it. There is so much inertia around Java that sometimes it feels like nothing will supersede it. Nonetheless, Kotlin is definitely worth an investigation if you’re looking for a statically-typed alternative to Java for your own projects. As I understand it, Jetbrains are pretty reliant on it, so it’s unlikely to disappear soon if at all. And you’re guaranteed first class support in at least one IDE!
Do remember that this is a first impressions account of the language, so don’t take anything as gospel truth other than these were my experiences. I’ll try to post additional articles as I gain a better understanding of the language.
+
+"""
+
+Article(
+ title = "Exploring Kotlin",
+ url = "http://blog.cacoethes.co.uk/software/exploring-kotlin",
+ categories = listOf(
+ "Kotlin",
+ "Groovy"
+ ),
+ type = article,
+ lang = EN,
+ author = "Peter Ledbrook",
+ date = LocalDate.of(2015, 6, 27),
+ body = body
+)
diff --git a/app/rss/articles/Exploring the Kotlin standard library.md b/articles/english/2015/Exploring the Kotlin standard library.kts
similarity index 93%
rename from app/rss/articles/Exploring the Kotlin standard library.md
rename to articles/english/2015/Exploring the Kotlin standard library.kts
index 1ae0be095..d57294e5b 100644
--- a/app/rss/articles/Exploring the Kotlin standard library.md
+++ b/articles/english/2015/Exploring the Kotlin standard library.kts
@@ -1,11 +1,11 @@
----
-title: 'Exploring the Kotlin standard library'
-url: http://beust.com/weblog/2015/10/30/exploring-the-kotlin-standard-library/
-categories:
- - Kotlin
-author: 'Cédric Beust'
-date: Oct 30, 2015 17:30
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
[Standard.kt](https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/src/kotlin/util/Standard.kt) is part of the Kotlin library and it defines some essential functions. What’s really striking about this source file is that it’s less than fifty lines long and that each of the function it defines (less than ten) is a one liner. Yet, each of these functions is very powerful. Here is a quick overview of the most important ones.
## let()
@@ -170,3 +170,18 @@ fun readProperties() = Properties().apply {
The `apply()` call tells us that the type of this expression is that of the object `apply()` is invoked on, which is `Properties`. Inside this block, `this` is now of type `Properties`, which allows us to call `load()` on it directly. In between, we create a `FileInputStream` that we use to populate this property object. And once we call `use()` on it, that `FileInputStream` will be automatically closed before this function returns, saving us from the ugly `try/catch/finally` combo that Java requires.
You will find a lot of these constructs in the [Kobalt build tool](http://beust.com/kobalt) code, feel free to browse it.
+
+"""
+
+Article(
+ title = "Exploring the Kotlin standard library",
+ url = "http://beust.com/weblog/2015/10/30/exploring-the-kotlin-standard-library/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Cédric Beust",
+ date = LocalDate.of(2015, 10, 30),
+ body = body
+)
diff --git a/app/rss/articles/Functional Programming with Kotlin.md b/articles/english/2015/Functional Programming with Kotlin.kts
similarity index 81%
rename from app/rss/articles/Functional Programming with Kotlin.md
rename to articles/english/2015/Functional Programming with Kotlin.kts
index 1d651a93c..b5685fffd 100644
--- a/app/rss/articles/Functional Programming with Kotlin.md
+++ b/articles/english/2015/Functional Programming with Kotlin.kts
@@ -1,15 +1,10 @@
----
-title: 'Functional Programming with Kotlin'
-url: http://blog.jetbrains.com/kotlin/2015/11/webinar-recording-functional-programming-with-kotlin/
-type: webinar
-categories:
- - Kotlin
- - Fp
- - Functional
- - Webinar
-author: Roman Belov
-date: Nov 5, 2015 09:21
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes
+import link.kotlin.scripts.LinkType.webinar
+import java.time.LocalDate
+
+val body = """
The recording of our October 22nd webinar, **Functional Programming with Kotlin**, is now available on [JetBrainsTV YouTube channel](https://youtu.be/AhA-Q7MOre0).
In this talk, Mike Hearn provides a brief introduction to programming in Kotlin via practical example: creating a textfield with the autocomplete suggestions while typing. Demo project is available on [GitHub](https://github.com/mikehearn/KotlinFPWebinar).
@@ -54,3 +49,20 @@ Thanks to all the attendees for the questions! If you still have some, please, c
You are welcome to suggest themes for future webinars in comments.
_Let’s kotlin!_
+"""
+
+Article(
+ title = "Functional Programming with Kotlin",
+ url = "http://blog.jetbrains.com/kotlin/2015/11/webinar-recording-functional-programming-with-kotlin/",
+ categories = listOf(
+ "Kotlin",
+ "Webinar",
+ "Fp",
+ "Functional"
+ ),
+ type = webinar,
+ lang = LanguageCodes.EN,
+ author = "Roman Belov",
+ date = LocalDate.of(2015, 11, 5),
+ body = body
+)
\ No newline at end of file
diff --git a/articles/english/2015/JVMLS 2015 - Flexible Types in Kotlin.kts b/articles/english/2015/JVMLS 2015 - Flexible Types in Kotlin.kts
new file mode 100644
index 000000000..cbf2ac9cd
--- /dev/null
+++ b/articles/english/2015/JVMLS 2015 - Flexible Types in Kotlin.kts
@@ -0,0 +1,25 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+
+
+"""
+
+Article(
+ title = "JVMLS 2015 - Flexible Types in Kotlin",
+ url = "https://www.youtube.com/watch?v=2IhT8HACc2E",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = video,
+ lang = EN,
+ author = "Andrey Breslav",
+ date = LocalDate.of(2015, 8, 12),
+ body = body
+)
diff --git a/articles/english/2015/Kotlin New Hope in a Java 6 Wasteland.kts b/articles/english/2015/Kotlin New Hope in a Java 6 Wasteland.kts
new file mode 100644
index 000000000..09c2d290a
--- /dev/null
+++ b/articles/english/2015/Kotlin New Hope in a Java 6 Wasteland.kts
@@ -0,0 +1,26 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+[Slides](https://speakerdeck.com/pardom/kotlin-new-hope-in-a-java-6-wasteland)
+
+"""
+
+Article(
+ title = "Kotlin: New Hope in a Java 6 Wasteland",
+ url = "https://speakerdeck.com/pardom/kotlin-new-hope-in-a-java-6-wasteland",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = slides,
+ lang = EN,
+ author = "Michael Pardo",
+ date = LocalDate.of(2015, 5, 9),
+ body = body
+)
diff --git a/articles/english/2015/Kotlin NoSQL for MongoDB in Action.kts b/articles/english/2015/Kotlin NoSQL for MongoDB in Action.kts
new file mode 100644
index 000000000..815702f8c
--- /dev/null
+++ b/articles/english/2015/Kotlin NoSQL for MongoDB in Action.kts
@@ -0,0 +1,26 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+
+
+"""
+
+Article(
+ title = "Kotlin NoSQL for MongoDB in Action",
+ url = "https://www.youtube.com/watch?v=80xgl3KThvM",
+ categories = listOf(
+ "Kotlin",
+ "SQL"
+ ),
+ type = video,
+ lang = EN,
+ author = "Andrey Cheptsov",
+ date = LocalDate.of(2015, 10, 22),
+ body = body
+)
diff --git a/app/rss/articles/Kotlin for Java Developers 10 Features You Will Love About Kotlin.md b/articles/english/2015/Kotlin for Java Developers 10 Features You Will Love About Kotlin.kts
similarity index 96%
rename from app/rss/articles/Kotlin for Java Developers 10 Features You Will Love About Kotlin.md
rename to articles/english/2015/Kotlin for Java Developers 10 Features You Will Love About Kotlin.kts
index 070f9937b..d1c24258f 100644
--- a/app/rss/articles/Kotlin for Java Developers 10 Features You Will Love About Kotlin.md
+++ b/articles/english/2015/Kotlin for Java Developers 10 Features You Will Love About Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'Kotlin for Java Developers: 10 Features You Will Love About Kotlin'
-url: http://petersommerhoff.com/dev/kotlin/kotlin-for-java-devs/
-categories:
- - Kotlin
-author: Peter Sommerhoff
-date: Dec 12, 2015 10:06
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
# Kotlin for Java Developers: 10 Features You Will Love About Kotlin
Kotlin is a statically typed JVM language built by Jetbrains, the makers of the IntelliJ IDE. [Kotlin](https://kotlinlang.org/) is built upon Java and provides useful features such as null-safety, data classes, extensions, functional concepts, smart casts, operator overloading and more.
@@ -208,7 +208,7 @@ Let’s look at some **lazily evaluated conditional expressions**:
```kotlin
if (document is Payable && document.pay()) { // Smart cast
- println("Payable document ${document.title} was payed for.")
+ println("Payable document ${"$"}{document.title} was payed for.")
}
```
@@ -218,7 +218,7 @@ The same goes for disjunction:
```kotlin
if (document !is Payable || document.pay() == false) { // Smart cast
- println("Cannot pay document ${document.title}.")
+ println("Cannot pay document ${"$"}{document.title}.")
}
```
@@ -276,7 +276,7 @@ println(numbers.drop(2)) // List without first two elements: [13, -9, 12]
println(numbers.foldRight(0, { a, b -> a + b })) // Sum of all elements: -9
-numbers.forEach { print("${it * 2} ") } // -84 34 26 -18 24
+numbers.forEach { print("${"$"}{it * 2} ") } // -84 34 26 -18 24
---
@@ -438,3 +438,18 @@ Next, Kotlin also supports the principle to either design for inheritance or pro
**If this overview made you curious** to learn more about Kotlin, you can [check out my 10 beginner tutorial videos for Kotlin](http://petersommerhoff.com/dev/kotlin/kotlin-beginner-tutorial/) or **[go straight to the full course](https://www.udemy.com/kotlin-course/?couponCode=READERSONLY9USD) (with 95% reader discount)**.
**The course is beginner-friendly and starts completely from scratch.** If you already know Java or a comparable language, you’ll still find it a valuable resource to get to know Kotlin.
+
+"""
+
+Article(
+ title = "Kotlin for Java Developers: 10 Features You Will Love About Kotlin",
+ url = "http://petersommerhoff.com/dev/kotlin/kotlin-for-java-devs/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Peter Sommerhoff",
+ date = LocalDate.of(2015, 12, 12),
+ body = body
+)
diff --git a/app/rss/articles/Kotlin love FP.md b/articles/english/2015/Kotlin love FP.kts
similarity index 95%
rename from app/rss/articles/Kotlin love FP.md
rename to articles/english/2015/Kotlin love FP.kts
index 3a26a10a5..6c28fe7a4 100644
--- a/app/rss/articles/Kotlin love FP.md
+++ b/articles/english/2015/Kotlin love FP.kts
@@ -1,12 +1,11 @@
----
-title: 'Kotlin ❤ FP'
-url: https://medium.com/@octskyward/kotlin-fp-3bf63a17d64a
-categories:
- - Kotlin
- - Functional
-author: Mike Hearn
-date: Sep 18, 2015 21:52
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
#### Functional programming in Kotlin, a new language from JetBrains
I did [a video tutorial on FP in Kotlin](http://blog.jetbrains.com/kotlin/2015/11/webinar-recording-functional-programming-with-kotlin/), which can be viewed online.
@@ -36,14 +35,14 @@ Kotlin doesn’t need a Maybe type because it has optionality as a built in part
```kotlin
val s: String? = if (Math.random() < 0.5) "Yay!" else null
-println("length of string is .... ${s.length()}")
+println("length of string is .... ${"$"}{s.length()}")
```
Here, we get a compile error on the second line, because we’re trying to read the length of a string we might not actually have, depending on a coin flip. There’s a simple fix:
```kotlin
val s: String? = if (Math.random() < 0.5) "Yay!" else null
-println("length of string is .... ${s?.length() ?: -1}")
+println("length of string is .... ${"$"}{s?.length() ?: -1}")
```
Here, s?.length() will yield null if s was null, and the ?: operator uses the right hand side if the left hand side is null. So this prints -1 if the coin flip didn’t yield the string.
@@ -87,7 +86,7 @@ fun printUser(username: String) {
val rec = lookupFromDB(username)
when (rec) {
is Maybe.None -> println("not found")
- is Maybe.Just -> println("${rec.t.age} years old")
+ is Maybe.Just -> println("${"$"}{rec.t.age} years old")
}
}
```
@@ -219,7 +218,7 @@ assertEquals(add5(7), 12)
import org.funktionale.partials.*
val format = { prefix: String, x: String, postfix: String ->
- "${prefix}${x}${postfix}"
+ "${"$"}{prefix}${"$"}{x}${"$"}{postfix}"
}
val prefixAndBang = format(p3 = "!")
@@ -273,7 +272,7 @@ repeat(3) {
val t = measureTimeMillis {
primes(100000)
}
- println("Took $t msec")
+ println("Took ${"$"}t msec")
}
```
@@ -331,11 +330,11 @@ val counter = newRef(10)
try {
atomic {
increment(counter, 1)
- println("counter is ${counter.get()}") // -> 11
+ println("counter is ${"$"}{counter.get()}") // -> 11
throw Exception("roll back!!")
}
} catch(e: Exception) {
- println("counter is ${counter.get()}") // -> 10
+ println("counter is ${"$"}{counter.get()}") // -> 10
}
```
@@ -373,3 +372,19 @@ The atomic method is a higher order function protected by a regular Java synchro
At the moment there is no way to control side effects: any function call can be potentially side effecting. It would be nice if a future version of the language introduced something like the C++ const keyword, or D’s transitive const, to reduce the reliance on actually immutable data structures. The JVM offers features that can seal off common sources of external state, such as the disk and network, however the heap is still available. It may be an interesting project to make the JVM’s sandboxing features easily available via a Kotlin DSL.
There is not at this moment any high performance immutable collections library. Both Clojure and Scala have maps and sets in which mutating the collection returns a new collection, with internal data sharing to make performance practical. The Kotlin standard library does not. If someone were to make one, using [the CHAMP code](http://michael.steindorfer.name/publications/oopsla15.pdf) published this year would give significant improvements over the algorithms used in Scala/Clojure.
+
+"""
+
+Article(
+ title = "Kotlin ❤ FP",
+ url = "https://medium.com/@octskyward/kotlin-fp-3bf63a17d64a",
+ categories = listOf(
+ "Kotlin",
+ "Functional"
+ ),
+ type = article,
+ lang = EN,
+ author = "Mike Hearn",
+ date = LocalDate.of(2015, 9, 18),
+ body = body
+)
diff --git a/app/rss/articles/Production Ready Kotlin.md b/articles/english/2015/Production Ready Kotlin.kts
similarity index 89%
rename from app/rss/articles/Production Ready Kotlin.md
rename to articles/english/2015/Production Ready Kotlin.kts
index 08da5171a..075df1860 100644
--- a/app/rss/articles/Production Ready Kotlin.md
+++ b/articles/english/2015/Production Ready Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'Production Ready Kotlin'
-url: https://www.linkedin.com/grp/post/7417237-6042285669181648896
-categories:
- - Kotlin
-author: Jayson Minard
-date: Aug 26, 2015 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
I see a lot of people asking "Is Kotlin ready for production?" ... maybe these are people that are not already using Kotlin wanting a bit of comfort before they put effort into their own investigation. Most people I know that do actually use Kotlin daily think it is obvious Kotlin is already ready. here is why:
- If it compiles, it runs perfectly
@@ -33,3 +33,18 @@ To help out, my company is open-sourcing anything we can, and are taking this ap
"We will open-source anything we can that does not hurt our competitiveness, we will document it, release it on maven central, we will keep it up to date to any Kotlin milestone/release changes, we will integrate nicely with other Kotlin libraries, we will report all bugs and issues to Kotlin YouTrack and follow up with testing; and we will not stop supporting Kotlin until every one of the key players in Kotlin sphere show up at a bar in Dublin, and we all agree to quit together. Until then, we are all in."
If you are a Kotlin supporter, step up your support because Kotlin can be the biggest player in the JVM space, is the best candidate, and deserves help from those that benefit from its existence.
+
+"""
+
+Article(
+ title = "Production Ready Kotlin",
+ url = "https://www.linkedin.com/grp/post/7417237-6042285669181648896",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Jayson Minard",
+ date = LocalDate.of(2015, 8, 26),
+ body = body
+)
diff --git a/app/rss/articles/Quasar Efficient and Elegant Fibers, Channels and Actors.md b/articles/english/2015/Quasar Efficient and Elegant Fibers, Channels and Actors.kts
similarity index 76%
rename from app/rss/articles/Quasar Efficient and Elegant Fibers, Channels and Actors.md
rename to articles/english/2015/Quasar Efficient and Elegant Fibers, Channels and Actors.kts
index 56f327994..8c7e9a2da 100644
--- a/app/rss/articles/Quasar Efficient and Elegant Fibers, Channels and Actors.md
+++ b/articles/english/2015/Quasar Efficient and Elegant Fibers, Channels and Actors.kts
@@ -1,16 +1,11 @@
----
-title: 'Quasar: Efficient and Elegant Fibers, Channels and Actors'
-url: http://blog.jetbrains.com/kotlin/2015/09/webinar-recording-quasar-efficient-and-elegant-fibers-channels-and-actors/
-type: webinar
-categories:
- - Kotlin
- - Webinar
- - Fibers
- - Channels
- - Actors
-author: Roman Belov
-date: Sep 21, 2015 09:40
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
The recording of our September 16th webinar, **Quasar: Efficient and Elegant Fibers, Channels and Actors**, is now available on [JetBrainsTV YouTube channel](https://youtu.be/Nmob2MB2Qo8).
In this webinar, Fabio Tudone shows how to use Quasar for creation of highly concurrent software. He covers basics of Kotlin syntax and shows how Quasar uses Kotlin strengths to offer concise and expressive API.
@@ -40,3 +35,22 @@ Thanks to all the attendees for the questions! If you still have some, please, c
You are welcome to suggest themes for future webinars in comments.
_Let’s kotlin!_
+
+"""
+
+Article(
+ title = "Quasar: Efficient and Elegant Fibers, Channels and Actors",
+ url = "http://blog.jetbrains.com/kotlin/2015/09/webinar-recording-quasar-efficient-and-elegant-fibers-channels-and-actors/",
+ categories = listOf(
+ "Kotlin",
+ "Webinar",
+ "Fibers",
+ "Channels",
+ "Actors"
+ ),
+ type = webinar,
+ lang = EN,
+ author = "Roman Belov",
+ date = LocalDate.of(2015, 9, 21),
+ body = body
+)
diff --git "a/app/rss/articles/Quasar and Kotlin \342\200\223 a Powerful Match.md" "b/articles/english/2015/Quasar and Kotlin \342\200\223 a Powerful Match.kts"
similarity index 97%
rename from "app/rss/articles/Quasar and Kotlin \342\200\223 a Powerful Match.md"
rename to "articles/english/2015/Quasar and Kotlin \342\200\223 a Powerful Match.kts"
index b43bd0a0f..70ba1d100 100644
--- "a/app/rss/articles/Quasar and Kotlin \342\200\223 a Powerful Match.md"
+++ "b/articles/english/2015/Quasar and Kotlin \342\200\223 a Powerful Match.kts"
@@ -1,13 +1,11 @@
----
-title: 'Quasar and Kotlin - a Powerful Match'
-url: http://blog.paralleluniverse.co/2015/06/04/quasar-kotlin/
-categories:
- - Kotlin
- - Quasar
- - Fibers
-author: Fabio
-date: Jun 04, 2015 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
June 04, 2015
Following the release of [Kotlin M12](http://blog.jetbrains.com/kotlin/2015/05/kotlin-m12-is-out/) and of [Quasar 0.7.0](http://blog.paralleluniverse.co/2015/05/29/quasar-pulsar-0-7-0/) introducing support for it, let’s now have a closer look at how Kotlin and Quasar work together.
@@ -296,3 +294,20 @@ Kotlin has loads of other advanced and convenient features that make it a pleasu
6. This is possible only with inline lambdas. [↩](#fnref:only-inline)
7. This is likely to become only a warning in the future. [↩](#fnref:public-api)
+
+"""
+
+Article(
+ title = "Quasar and Kotlin - a Powerful Match",
+ url = "http://blog.paralleluniverse.co/2015/06/04/quasar-kotlin/",
+ categories = listOf(
+ "Kotlin",
+ "Quasar",
+ "Fibers"
+ ),
+ type = article,
+ lang = EN,
+ author = "Fabio",
+ date = LocalDate.of(2015, 6, 4),
+ body = body
+)
diff --git a/app/rss/articles/RxAndroid and Kotlin (Part 1).md b/articles/english/2015/RxAndroid and Kotlin (Part 1).kts
similarity index 96%
rename from app/rss/articles/RxAndroid and Kotlin (Part 1).md
rename to articles/english/2015/RxAndroid and Kotlin (Part 1).kts
index def58b3b1..bc64794ff 100644
--- a/app/rss/articles/RxAndroid and Kotlin (Part 1).md
+++ b/articles/english/2015/RxAndroid and Kotlin (Part 1).kts
@@ -1,13 +1,11 @@
----
-title: 'RxAndroid and Kotlin (Part 1)'
-url: 'https://medium.com/@ahmedrizwan/rxandroid-and-kotlin-part-1-f0382dc26ed8#.bx3rgamfo'
-categories:
- - Kotlin
- - RxAndroid
- - Android
-author: Ahmed Rizwan
-date: Jun 27, 2015 11:16
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
![](https://d262ilb51hltx0.cloudfront.net/max/2000/1*bTttcFdSLyvWIPg91OaNEw.png)
### RxAndroid and Kotlin (Part 1)
@@ -394,3 +392,20 @@ Here are some awesome resources for Rx that I recommend. Do check these out! I w
* [PhilosophicalHacker Blog on Rx](http://www.philosophicalhacker.com/2015/06/12/an-introduction-to-rxjava-for-android/)
* [Implementing EventBus in Rx](http://nerds.weddingpartyapp.com/tech/2014/12/24/implementing-an-event-bus-with-rxjava-rxbus/)
* [RxKotlin](https://github.com/ReactiveX/RxKotlin)
+
+"""
+
+Article(
+ title = "RxAndroid and Kotlin (Part 1)",
+ url = "https://medium.com/@ahmedrizwan/rxandroid-and-kotlin-part-1-f0382dc26ed8#.bx3rgamfo",
+ categories = listOf(
+ "Kotlin",
+ "RxAndroid",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Ahmed Rizwan",
+ date = LocalDate.of(2015, 6, 27),
+ body = body
+)
diff --git a/app/rss/articles/Setting up Kotlin with Android and tests .md b/articles/english/2015/Setting up Kotlin with Android and tests .kts
similarity index 91%
rename from app/rss/articles/Setting up Kotlin with Android and tests .md
rename to articles/english/2015/Setting up Kotlin with Android and tests .kts
index a4704266b..56c057434 100644
--- a/app/rss/articles/Setting up Kotlin with Android and tests .md
+++ b/articles/english/2015/Setting up Kotlin with Android and tests .kts
@@ -1,12 +1,11 @@
----
-title: 'Setting up Kotlin with Android and tests'
-url: http://engineering.pivotal.io/post/setting-up-kotlin-with-android-and-tests/
-categories:
- - Kotlin
- - Android
-author: Laura Kogler
-date: Nov 11, 2015 14:39
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
I recently heard about [Kotlin](https://kotlinlang.org/) with the release of their 1.0 Beta last week. Kotlin is a modern programming language that runs in the JVM and is interoperable with Java. Kotlin can also be used to create Android apps.
@@ -97,3 +96,19 @@ class ExampleUnitTest : Spek() {
## Conclusion
Kotlin seems like a promising new language with a lot of features that make it nicer to use than Java. Setting up a "Hello World" Android app was extremely simple, and getting tests to run with Robolectric or the Android instrumentation runner was no problem. I look forward to trying it out more in the future!
+
+"""
+
+Article(
+ title = "Setting up Kotlin with Android and tests",
+ url = "http://engineering.pivotal.io/post/setting-up-kotlin-with-android-and-tests/",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Laura Kogler",
+ date = LocalDate.of(2015, 11, 11),
+ body = body
+)
diff --git a/app/rss/articles/Why Kotlin is my next programming language.md b/articles/english/2015/Why Kotlin is my next programming language.kts
similarity index 92%
rename from app/rss/articles/Why Kotlin is my next programming language.md
rename to articles/english/2015/Why Kotlin is my next programming language.kts
index 307527fc1..ede8323f6 100644
--- a/app/rss/articles/Why Kotlin is my next programming language.md
+++ b/articles/english/2015/Why Kotlin is my next programming language.kts
@@ -1,11 +1,11 @@
----
-title: 'Why Kotlin is my next programming language'
-url: https://medium.com/@octskyward/why-kotlin-is-my-next-programming-language-c25c001e26e3
-categories:
- - Kotlin
-author: Mike Hearn
-date: Jul 06, 2015 22:39
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
![](https://d262ilb51hltx0.cloudfront.net/max/1600/1*YnF7hY2ymS54iTNLuxVT8A.jpeg)
_A lighthouse on Kotlin Island, Russia_
@@ -52,3 +52,18 @@ Earlier this year I presented Kotlin to a team of Java and .NET architects at Sw
I think Kotlin hits the sweet spot for enterprise Java devs, so even though Kotlin is free I expect JetBrains to make a killing from increased sales of the commercial version of their IDE. This will incentivise them to keep improving it according to the wishes of their customers.
Contrast this with many other language developers who are subsidised by unrelated products, meaning they have little reason to respond to the demands of their users when those demands conflict with pre-held ideologies.
+
+"""
+
+Article(
+ title = "Why Kotlin is my next programming language",
+ url = "https://medium.com/@octskyward/why-kotlin-is-my-next-programming-language-c25c001e26e3",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Mike Hearn",
+ date = LocalDate.of(2015, 7, 6),
+ body = body
+)
diff --git a/app/rss/articles/10 Features I Wish Java Would Steal From the Kotlin Language.md b/articles/english/2016/10 Features I Wish Java Would Steal From the Kotlin Language.kts
similarity index 97%
rename from app/rss/articles/10 Features I Wish Java Would Steal From the Kotlin Language.md
rename to articles/english/2016/10 Features I Wish Java Would Steal From the Kotlin Language.kts
index a6deb013b..9d4fc3866 100644
--- a/app/rss/articles/10 Features I Wish Java Would Steal From the Kotlin Language.md
+++ b/articles/english/2016/10 Features I Wish Java Would Steal From the Kotlin Language.kts
@@ -1,12 +1,11 @@
----
-title: '10 Features I Wish Java Would Steal From the Kotlin Language'
-url: http://blog.jooq.org/2016/03/31/10-features-i-wish-java-would-steal-from-the-kotlin-language/
-categories:
- - Kotlin
- - Java
-author: Lukas Eder
-date: Mar 31, 2016 12:10
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
This article is overdue. After the hype around the [release of Kotlin 1.0](https://blog.jetbrains.com/kotlin/2016/02/kotlin-1-0-released-pragmatic-language-for-jvm-and-android/) has settled, let’s have a serious look at some Kotlin language features that we should have in Java as well.
In this article, I’m not going to wish for unicorns. But there are some low hanging fruit (as far as I naively can see), which could be introduced into the Java language without great risk. While you’re reading this article, be sure to copy paste examples to [http://try.kotlinlang.org](http://try.kotlinlang.org), an online REPL for Kotlin
@@ -192,8 +191,8 @@ ctx.select(a.FIRST_NAME, a.LAST_NAME, b.TITLE)
.join(b).on(a.ID.eq(b.AUTHOR_ID))
.orderBy(1, 2, 3)
.forEach {
- println("""${it[b.TITLE]}
- by ${it[a.FIRST_NAME]} ${it[a.LAST_NAME]}""")
+ println(\"\"\"${"$"}{it[b.TITLE]}
+ by ${"$"}{it[a.FIRST_NAME]} ${"$"}{it[a.LAST_NAME]}\"\"\")
}
```
@@ -487,3 +486,19 @@ Some of these decisions will hopefully be picked up by the Java language gods an
More info about Kotlin idioms:
[https://kotlinlang.org/docs/reference/idioms.html](https://kotlinlang.org/docs/reference/idioms.html)
+
+"""
+
+Article(
+ title = "10 Features I Wish Java Would Steal From the Kotlin Language",
+ url = "http://blog.jooq.org/2016/03/31/10-features-i-wish-java-would-steal-from-the-kotlin-language/",
+ categories = listOf(
+ "Kotlin",
+ "Java"
+ ),
+ type = article,
+ lang = EN,
+ author = "Lukas Eder",
+ date = LocalDate.of(2016, 3, 31),
+ body = body
+)
diff --git a/app/rss/articles/10 Kotlin Tricks in 10(ish) Minutes by Jake Wharton.md b/articles/english/2016/10 Kotlin Tricks in 10(ish) Minutes by Jake Wharton.kts
similarity index 57%
rename from app/rss/articles/10 Kotlin Tricks in 10(ish) Minutes by Jake Wharton.md
rename to articles/english/2016/10 Kotlin Tricks in 10(ish) Minutes by Jake Wharton.kts
index 1ecc01f56..b14865715 100644
--- a/app/rss/articles/10 Kotlin Tricks in 10(ish) Minutes by Jake Wharton.md
+++ b/articles/english/2016/10 Kotlin Tricks in 10(ish) Minutes by Jake Wharton.kts
@@ -1,15 +1,29 @@
----
-title: '10 Kotlin Tricks in 10(ish) Minutes'
-url: https://www.youtube.com/watch?v=YKzUbeUtTak
-categories:
- - Kotlin
-type: video
-author: Jake Wharton
-date: Nov 10, 2016 10:31
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Kotlin is a new and popular language for Android development. Its major advantages and features are immediately appealing and quick to learn, but it also has a lot of small and thoughtful parts which are harder to discover. This talk will cover 10 of my favorites with real-world examples.
[Slides](https://speakerdeck.com/jakewharton/10-kotlin-tricks-in-10ish-minutes-square-nyc-november-2016) [Post on Authors Site](http://jakewharton.com/10-kotlin-tricks-in-10ish-minutes/)
+
+"""
+
+Article(
+ title = "10 Kotlin Tricks in 10(ish) Minutes",
+ url = "https://www.youtube.com/watch?v=YKzUbeUtTak",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = video,
+ lang = EN,
+ author = "Jake Wharton",
+ date = LocalDate.of(2016, 11, 10),
+ body = body
+)
diff --git a/app/rss/articles/10 Kotlin Tutorials for Beginners Dive Into Kotlin Programming.md b/articles/english/2016/10 Kotlin Tutorials for Beginners Dive Into Kotlin Programming.kts
similarity index 91%
rename from app/rss/articles/10 Kotlin Tutorials for Beginners Dive Into Kotlin Programming.md
rename to articles/english/2016/10 Kotlin Tutorials for Beginners Dive Into Kotlin Programming.kts
index bc86b4665..357cc8040 100644
--- a/app/rss/articles/10 Kotlin Tutorials for Beginners Dive Into Kotlin Programming.md
+++ b/articles/english/2016/10 Kotlin Tutorials for Beginners Dive Into Kotlin Programming.kts
@@ -1,12 +1,11 @@
----
-title: '10 Kotlin Tutorials for Beginners: Dive Into Kotlin Programming'
-url: http://petersommerhoff.com/dev/kotlin/kotlin-beginner-tutorial/
-categories:
- - Kotlin
- - Videos
-author: Peter Sommerhoff
-date: Feb 02, 2016 17:37
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
# 10 Kotlin Tutorials for Beginners: Dive Into Kotlin Programming
@@ -97,3 +96,19 @@ The course will be improved and extended based on student feedback and I’ll be
What do you think about Kotlin? Is it “better than Java” or just yet another JVM language for you?
What else do you want to learn about Kotlin? Let me know in the comments and I’ll respond to you personally.
+
+"""
+
+Article(
+ title = "10 Kotlin Tutorials for Beginners: Dive Into Kotlin Programming",
+ url = "http://petersommerhoff.com/dev/kotlin/kotlin-beginner-tutorial/",
+ categories = listOf(
+ "Kotlin",
+ "Videos"
+ ),
+ type = article,
+ lang = EN,
+ author = "Peter Sommerhoff",
+ date = LocalDate.of(2016, 2, 2),
+ body = body
+)
diff --git a/app/rss/articles/400 percent faster layouts with Anko.md b/articles/english/2016/400 percent faster layouts with Anko.kts
similarity index 92%
rename from app/rss/articles/400 percent faster layouts with Anko.md
rename to articles/english/2016/400 percent faster layouts with Anko.kts
index 195a76b33..72f4dbcb2 100644
--- a/app/rss/articles/400 percent faster layouts with Anko.md
+++ b/articles/english/2016/400 percent faster layouts with Anko.kts
@@ -1,12 +1,11 @@
----
-title: '400% faster layouts with Anko'
-url: https://medium.com/@vergauwen.simon/400-faster-layouts-with-anko-da17f32c45dd#.okv8w4291
-categories:
- - Kotlin
- - Android
-author: Simon Vergauwen
-date: Nov 10, 2016 12:50
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
I’ve been playing with Anko for a while now and I was curious what advantages Anko offered. So I did some performance tests.
![](https://cdn-images-1.medium.com/max/660/1*5ZzaJr-LterwFJUy-Mu40g.png)
@@ -148,3 +147,19 @@ We can now also easily calculate sizes, and the width here will be calculate at
Anko offers several solutions to the traditional way of building layouts in XML. It bypasses all overhead that Android deals with when building xml layouts. You don’t have to deal with `findViewById` nor with casting. And by building layouts at runtime you can add any logic you want. It could improve your MVVM setup, or you could make your layouts more dynamic by adding some logic. And this all for a very small cost, considering all the extreme effort we do for clean and high performing apps.
All code used in this example can be found on [github](https://github.com/nomisRev/FasterLayoutsWithAnko)
+
+"""
+
+Article(
+ title = "400% faster layouts with Anko",
+ url = "https://medium.com/@vergauwen.simon/400-faster-layouts-with-anko-da17f32c45dd#.okv8w4291",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Simon Vergauwen",
+ date = LocalDate.of(2016, 11, 10),
+ body = body
+)
diff --git "a/app/rss/articles/5 small things you probably don\342\200\231t know about Kotlin.md" "b/articles/english/2016/5 small things you probably don\342\200\231t know about Kotlin.kts"
similarity index 93%
rename from "app/rss/articles/5 small things you probably don\342\200\231t know about Kotlin.md"
rename to "articles/english/2016/5 small things you probably don\342\200\231t know about Kotlin.kts"
index 0ba960320..e055976c6 100644
--- "a/app/rss/articles/5 small things you probably don\342\200\231t know about Kotlin.md"
+++ "b/articles/english/2016/5 small things you probably don\342\200\231t know about Kotlin.kts"
@@ -1,11 +1,11 @@
----
-title: '5 small things you probably don’t know about Kotlin'
-url: https://medium.com/@piotr.slesarew/5-small-things-you-probably-dont-know-about-kotlin-255261940de6#.pgfivsdr7
-categories:
- - Kotlin
-author: 'Piotr Ślesarew'
-date: Nov 25, 2016 05:04
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
> There are known knowns. These are things we know that we know. There are known unknowns. That is to say, there are things that we know we don’t know. But there are also unknown unknowns. There are things we don’t know we don’t know. — Donald Rumsfeld
I have been using Kotlin for almost a two years and I started from putting it to toy project intended for my tech talks. Do you remember that time when Kotlin had _traits_ instead of _interfaces_? From the very first line, I knew that this language will change my life, and you know what? I was totally right.
@@ -212,3 +212,18 @@ Sample shows usage of a built-in _vetoable_ delegate. Lambda passed to the _veto
![](https://cdn-images-1.medium.com/max/880/1*gkc1Y_YumE5sIffEmO03Yw.jpeg)
[http://looneytunes.wikia.com/wiki/That's_All_Folks](http://looneytunes.wikia.com/wiki/That%27s_All_Folks)
+
+"""
+
+Article(
+ title = "5 small things you probably don’t know about Kotlin",
+ url = "https://medium.com/@piotr.slesarew/5-small-things-you-probably-dont-know-about-kotlin-255261940de6#.pgfivsdr7",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Piotr Ślesarew",
+ date = LocalDate.of(2016, 11, 25),
+ body = body
+)
diff --git a/app/rss/articles/A DSL Workbench with Gradle and Kotlin.md b/articles/english/2016/A DSL Workbench with Gradle and Kotlin.kts
similarity index 88%
rename from app/rss/articles/A DSL Workbench with Gradle and Kotlin.md
rename to articles/english/2016/A DSL Workbench with Gradle and Kotlin.kts
index 4092f92f5..98d0e7049 100644
--- a/app/rss/articles/A DSL Workbench with Gradle and Kotlin.md
+++ b/articles/english/2016/A DSL Workbench with Gradle and Kotlin.kts
@@ -1,14 +1,11 @@
----
-title: 'A DSL Workbench with Gradle and Kotlin'
-url: http://jonnyzzz.com/blog/2016/03/08/gradle-for-dsl/
-categories:
- - Gradle
- - DSL
- - Teamcity2DSL
- - Kotlin
-author: Eugene Petrenko
-date: Mar 08, 2016 21:02
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Easy to use. This is one of a main tasks to solve then new tool is created. For the world of DSL this
mostly mean it should be easy to a end-user to use the tool and to be able to run the tool within
@@ -115,10 +112,10 @@ project.buildscript.repositories.forEach { project.repositories.add(it) }
To add extra source directory we use the following code (that depends on Gradle's Java plugin)
```groovy
-println("Adding DSL path to Kotlin source set: ${settings.dslPath}")
+println("Adding DSL path to Kotlin source set: ${"$"}{settings.dslPath}")
val sourceSets = project.convention.getPlugin(JavaPluginConvention::class.java).sourceSets
-println("Source sets: ${sourceSets.names}")
+println("Source sets: ${"$"}{sourceSets.names}")
sourceSets.getByName("main").java.srcDir( settings.dslPath!!.path )
```
@@ -140,3 +137,21 @@ leading to easy-to-use and easy-to-adopt solution.
This pattern could be re-used for other applications.
Feel free to try [TeamCity2DSL](https://github.com/jonnyzzz/TeamCity2DSL) for TeamCity project settings domain.
+
+"""
+
+Article(
+ title = "A DSL Workbench with Gradle and Kotlin",
+ url = "http://jonnyzzz.com/blog/2016/03/08/gradle-for-dsl/",
+ categories = listOf(
+ "Gradle",
+ "DSL",
+ "Teamcity2DSL",
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Eugene Petrenko",
+ date = LocalDate.of(2016, 3, 8),
+ body = body
+)
diff --git "a/app/rss/articles/A Developer\342\200\231s Look at Kotlin.md" "b/articles/english/2016/A Developer\342\200\231s Look at Kotlin.kts"
similarity index 90%
rename from "app/rss/articles/A Developer\342\200\231s Look at Kotlin.md"
rename to "articles/english/2016/A Developer\342\200\231s Look at Kotlin.kts"
index ab61ac4d8..c1b28a29c 100644
--- "a/app/rss/articles/A Developer\342\200\231s Look at Kotlin.md"
+++ "b/articles/english/2016/A Developer\342\200\231s Look at Kotlin.kts"
@@ -1,11 +1,11 @@
----
-title: 'A Developer’s Look at Kotlin'
-url: http://insights.dice.com/2016/09/09/developers-look-kotlin/
-categories:
- - Kotlin
-author: David Bolton
-date: Sep 9, 2016 02:02
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
![shutterstock_379642018](http://insights.dice.com/wp-content/uploads/2016/09/shutterstock_379642018.jpg)
Named after an island near St. Petersburg, Russia (take a gander at its spectacular sunset, above), [Kotlin](https://kotlinlang.org/) is a statically typed open-source programming language that runs on the JVM, just like Java. JetBrains released version 1 in February 2016, after five years of development.
@@ -40,7 +40,7 @@ val a: Int = 10000 // read-only
val b: Int = 0x0F // hexadecimal read-only
var c = 0b1011 // binary also type inferred
-println("a = $a b = $b c = $c")
+println("a = ${"$"}a b = ${"$"}b c = ${"$"}c")
```
This outputs:
@@ -143,9 +143,9 @@ class LazySample {
fun main(args: Array) {
val sample = LazySample()
- println("lazy = ${sample.lazy}")
- println("lazy = ${sample.lazy}")
- println("inc = ${sample.inc}")
+ println("lazy = ${"$"}{sample.lazy}")
+ println("lazy = ${"$"}{sample.lazy}")
+ println("inc = ${"$"}{sample.inc}")
}
```
@@ -168,7 +168,7 @@ import kotlin.properties.Delegates
class TaxRate {
var value: Float by Delegates.observable(18.5f) { d, old, new ->
- println("Rate changed from $old% to $new%")
+ println("Rate changed from ${"$"}old% to ${"$"}new%")
}
}
@@ -192,3 +192,18 @@ I’m a great believer that reduced cognitive load is good for programmers. It
Kotlin has been compared to Scala, though is somewhat simpler and compiles a lot faster. It’s not quite a snapshot of the language, [but the Idioms page](http://kotlinlang.org/docs/reference/idioms.html) tells you a lot about features and syntax in one go.
Any developers wanting to know differences between Kotlin and Java at a glance can refer to the [Comparison to Java page](https://kotlinlang.org/docs/reference/comparison-to-java.html) via Kotlin’s reference materials.
+
+"""
+
+Article(
+ title = "A Developer’s Look at Kotlin",
+ url = "http://insights.dice.com/2016/09/09/developers-look-kotlin/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "David Bolton",
+ date = LocalDate.of(2016, 9, 9),
+ body = body
+)
diff --git a/app/rss/articles/A Geospatial Messenger with Kotlin, Spring Boot and PostgreSQL.md b/articles/english/2016/A Geospatial Messenger with Kotlin, Spring Boot and PostgreSQL.kts
similarity index 94%
rename from app/rss/articles/A Geospatial Messenger with Kotlin, Spring Boot and PostgreSQL.md
rename to articles/english/2016/A Geospatial Messenger with Kotlin, Spring Boot and PostgreSQL.kts
index 050777f79..0390a4a49 100644
--- a/app/rss/articles/A Geospatial Messenger with Kotlin, Spring Boot and PostgreSQL.md
+++ b/articles/english/2016/A Geospatial Messenger with Kotlin, Spring Boot and PostgreSQL.kts
@@ -1,12 +1,11 @@
----
-title: 'A Geospatial Messenger with Kotlin, Spring Boot and PostgreSQL'
-url: https://spring.io/blog/2016/03/20/a-geospatial-messenger-with-kotlin-spring-boot-and-postgresql
-categories:
- - Kotlin
- - Spring
-author: 'Sébastien Deleuze'
-date: Mar 20, 2016 10:51
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Following my first [Kotlin blog post](https://spring.io/blog/2016/02/15/developing-spring-boot-applications-with-kotlin), today I want introduce the new Spring Boot + Kotlin application I have developed for my upcoming [Spring I/O 2016 conference](http://www.springio.net/) talk “Developing Geospatial Web Services with Kotlin and Spring Boot”.
@@ -162,3 +161,19 @@ The few pain points I have encountered ([array annotation attributes](https://yo
And keep in mind that officially supported [Spring Data projects](http://projects.spring.io/spring-data/) works well with Kotlin as shown in the [spring-boot-kotlin-demo](https://github.com/sdeleuze/spring-boot-kotlin-demo) project in my [previous blog post](https://spring.io/blog/2016/02/15/developing-spring-boot-applications-with-kotlin).
If you happen to be in Barcelona mid May (never a bad time to be in Barcelona anyway!), don’t miss the chance to join the [Spring I/O conference](http://www.springio.net/). Also, the registration for [SpringOne Platform](http://springoneplatform.io/) (early August, Las Vegas) has opened recently, in case you want to benefit from early bird ticket pricing. The latter is also still open for talk proposals. So if you’re interested to give a talk about Spring or Pivotal-related technologies, feel free to submit!
+
+"""
+
+Article(
+ title = "A Geospatial Messenger with Kotlin, Spring Boot and PostgreSQL",
+ url = "https://spring.io/blog/2016/03/20/a-geospatial-messenger-with-kotlin-spring-boot-and-postgresql",
+ categories = listOf(
+ "Kotlin",
+ "Spring"
+ ),
+ type = article,
+ lang = EN,
+ author = "Sébastien Deleuze",
+ date = LocalDate.of(2016, 3, 20),
+ body = body
+)
diff --git a/app/rss/articles/A Very Peculiar, but Possibly Cunning Kotlin Language Feature.md b/articles/english/2016/A Very Peculiar, but Possibly Cunning Kotlin Language Feature.kts
similarity index 91%
rename from app/rss/articles/A Very Peculiar, but Possibly Cunning Kotlin Language Feature.md
rename to articles/english/2016/A Very Peculiar, but Possibly Cunning Kotlin Language Feature.kts
index 354d6a3e5..9003a0937 100644
--- a/app/rss/articles/A Very Peculiar, but Possibly Cunning Kotlin Language Feature.md
+++ b/articles/english/2016/A Very Peculiar, but Possibly Cunning Kotlin Language Feature.kts
@@ -1,12 +1,11 @@
----
-title: 'A Very Peculiar, but Possibly Cunning Kotlin Language Feature.'
-url: http://blog.jooq.org/2016/02/22/a-very-peculiar-but-possibly-cunning-kotlin-language-feature/
-categories:
- - Kotlin
- - Puzzlers
-author: Lukas Eder
-date: Feb 22, 2016 15:33
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
This has caught me by surprise. After studying the [Kotlin language](https://kotlinlang.org/) to learn about how to best leverage this interesting new language for [jOOQ](http://www.jooq.org/), I stumbled upon this puzzler. What do you think the following program will print?
```kotlin
@@ -147,3 +146,19 @@ Weird. Cunning. Clever. But a bit unexpected.
Is this a good idea? Or will the language designers regret this, later on? Are all lambdas / closures potentially “language construct-ish”, where such a return statement is expected to leave the outer scope? Or are there clear cases where this inline behaviour just makes total sense?
We’ll see. In any case, it is very interesting for a language to have chosen this path.
+
+"""
+
+Article(
+ title = "A Very Peculiar, but Possibly Cunning Kotlin Language Feature.",
+ url = "http://blog.jooq.org/2016/02/22/a-very-peculiar-but-possibly-cunning-kotlin-language-feature/",
+ categories = listOf(
+ "Kotlin",
+ "Puzzlers"
+ ),
+ type = article,
+ lang = EN,
+ author = "Lukas Eder",
+ date = LocalDate.of(2016, 2, 22),
+ body = body
+)
diff --git a/app/rss/articles/A Whirlwind Tour of the Kotlin Type Hierarchy.md b/articles/english/2016/A Whirlwind Tour of the Kotlin Type Hierarchy.kts
similarity index 95%
rename from app/rss/articles/A Whirlwind Tour of the Kotlin Type Hierarchy.md
rename to articles/english/2016/A Whirlwind Tour of the Kotlin Type Hierarchy.kts
index 93b8f1544..920ff2057 100644
--- a/app/rss/articles/A Whirlwind Tour of the Kotlin Type Hierarchy.md
+++ b/articles/english/2016/A Whirlwind Tour of the Kotlin Type Hierarchy.kts
@@ -1,11 +1,11 @@
----
-title: 'A Whirlwind Tour of the Kotlin Type Hierarchy'
-url: http://natpryce.com/articles/000818.html
-categories:
- - Kotlin
-author: Nat Pryce
-date: Oct 28, 2016 03:23
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Kotlin has plenty of good [language documentation](https://kotlinlang.org/docs/reference/) and [tutorials](https://kotlinlang.org/docs/tutorials/). But I’ve not found an article that describes in one place how Kotlin’s type hierarchy fits together. That’s a shame, because I find it to be really neat[1](#fn1).
Kotlin’s type hierarchy has very few rules to learn. Those rules combine together consistently and predictably. Thanks to those rules, Kotlin can provide useful, user extensible language features – null safety, polymorphism, and unreachable code analysis – without resorting to special cases and ad-hoc checks in the compiler and IDE.
@@ -149,7 +149,7 @@ By having Nothing as a subtype of every other type, the type system allows any e
```kotlin
fun formatCell(value: Double): String =
if (value.isNaN())
- throw IllegalArgumentException("$value is not a number")
+ throw IllegalArgumentException("${"$"}value is not a number")
else
value.toString()
```
@@ -209,3 +209,18 @@ I hope this article has demonstrated that Kotlin has a simple and consistent typ
2. Apart from loops, which are statements. Variable assignments are also statements.
+
+"""
+
+Article(
+ title = "A Whirlwind Tour of the Kotlin Type Hierarchy",
+ url = "http://natpryce.com/articles/000818.html",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Nat Pryce",
+ date = LocalDate.of(2016, 10, 28),
+ body = body
+)
diff --git a/app/rss/articles/A clean status bar with Android System UI and QuickDemo.md b/articles/english/2016/A clean status bar with Android System UI and QuickDemo.kts
similarity index 95%
rename from app/rss/articles/A clean status bar with Android System UI and QuickDemo.md
rename to articles/english/2016/A clean status bar with Android System UI and QuickDemo.kts
index 355d25e6c..96246a52f 100644
--- a/app/rss/articles/A clean status bar with Android System UI and QuickDemo.md
+++ b/articles/english/2016/A clean status bar with Android System UI and QuickDemo.kts
@@ -1,12 +1,11 @@
----
-title: 'A clean status bar with Android System UI and QuickDemo'
-url: https://pspdfkit.com/blog/2016/clean-statusbar-with-systemui-and-quickdemo/
-categories:
- - Kotlin
- - Android
-author: David Schreiber‑Ranner
-date: Nov 17, 2016 11:56
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
More often than necessary, screenshots and videos of Android apps suffer from showing an untidy status bar with unwanted notification icons, a drained battery indicator, and a different time on every screenshot. In this blog post, we take a look at the Android System UI demo mode that remedies the aforementioned problems and present a tool [_QuickDemo_](https://github.com/PSPDFKit-labs/QuickDemo) for fast and convenient status bar cleansing.
> A special _Thank You_ to everyone who joined this month's [Android Heads Meetup](https://www.meetup.com/de-DE/AndroidHeads/events/234524954/) at Google Vienna. It was a real pleasure talking to you. You can [find my talk's slides here](https://speakerdeck.com/davidschreiberranner/writing-a-system-ui-demo-mode-quick-settings-tile-in-kotlin). For all of you that couldn't listen to my presentation, check out this blog post! 😉
@@ -157,3 +156,19 @@ class DemoModeTileService : TileService() {
```
That's it! You can check out the full source code of [QuickDemo on GitHub](https://github.com/PSPDFKit-labs/QuickDemo). If you have any questions on the System UI Demo Mode or the Android tiles API, feel free to [ping me on Twitter](https://twitter.com/Flashmasterdash) or [Google+](https://plus.google.com/112371263315253005287).
+
+"""
+
+Article(
+ title = "A clean status bar with Android System UI and QuickDemo",
+ url = "https://pspdfkit.com/blog/2016/clean-statusbar-with-systemui-and-quickdemo/",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "David Schreiber‑Ranner",
+ date = LocalDate.of(2016, 11, 17),
+ body = body
+)
diff --git a/app/rss/articles/A new hope for the JVM Kotlin.md b/articles/english/2016/A new hope for the JVM Kotlin.kts
similarity index 93%
rename from app/rss/articles/A new hope for the JVM Kotlin.md
rename to articles/english/2016/A new hope for the JVM Kotlin.kts
index 241cbc2b8..cbe2ee393 100644
--- a/app/rss/articles/A new hope for the JVM Kotlin.md
+++ b/articles/english/2016/A new hope for the JVM Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'A new hope for the JVM: Kotlin'
-url: http://engineering.facile.it/blog/eng/kotlin-intro/
-categories:
- - Kotlin
-author: Giacomo Bresciani
-date: Oct 17, 2016 10:08
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
![Kotlin](http://engineering.facile.it/images/kotlin-intro/logo_Kotlin.svg)
## Premise
@@ -67,3 +67,18 @@ data class City(val name: String, val state: String)
Java has to maintain backward compatibility with previous versions and still has to support the huge amount of developers and codebases present all around the world; therefore it is natural that every new feature and design change is to be considered, weighted and reasoned really carefully, inevitably **slowing down its evolution**. But this does not have to mean that us, as Android developers, “tied” to the JVM, should not try more modern and advanced languages such as Kotlin. At bottom, a part of our job (one of the best!) is to try and **experiment** new technologies and to **learn** new concepts and techniques that improve our ability to address problems in the best possible way (and of course, to have some fun 😄).
I think that it is fundamental for a software engineer to be **exposed to more than a single programming language**: learning new patterns, exploring other programming paradigms or simply using and understanding a never-seen syntax has an immeasurable value for our growth and most of the times it turns out to be unexpectedly useful even when coding with ”our” language. So why not do it with a language that allows us to continue working on projects targeting our beloved JVM?
+
+"""
+
+Article(
+ title = "A new hope for the JVM: Kotlin",
+ url = "http://engineering.facile.it/blog/eng/kotlin-intro/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Giacomo Bresciani",
+ date = LocalDate.of(2016, 10, 17),
+ body = body
+)
diff --git a/app/rss/articles/Ad-hoc polymorphism in Kotlin.md b/articles/english/2016/Ad-hoc polymorphism in Kotlin.kts
similarity index 95%
rename from app/rss/articles/Ad-hoc polymorphism in Kotlin.md
rename to articles/english/2016/Ad-hoc polymorphism in Kotlin.kts
index abde65f18..b2c1f252f 100644
--- a/app/rss/articles/Ad-hoc polymorphism in Kotlin.md
+++ b/articles/english/2016/Ad-hoc polymorphism in Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'Ad-hoc polymorphism in Kotlin'
-url: http://beust.com/weblog/2016/06/20/ad-hoc-polymorphism-in-kotlin/
-categories:
- - Kotlin
-author: Cédric Beust
-date: Jun 20, 2016 08:47
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Even though Kotlin doesn’t natively support ad-hoc polymorphism today, it’s actually pretty straightforward to use it with little effort. Doing so is not as straightforward as it is in Haskell, obviously, but it’s been simple enough that I haven’t really encountered situations in Kotlin where the lack of native support in the language was a showstopper. In this article, I present two techniques you can use to leverage ad-hoc polymorphism in Kotlin.
## Extending for “fun” and some profit
@@ -116,3 +116,18 @@ The more I think about it, the more convinced I am that the value offered by ad-
Another important aspect of deciding how useful ad-hoc polymorphism would be in a language is whether that language supports higher kinds (type families). Without higher kinds, your ability to abstract is limited, which lessens the value of ad-hoc polymorphism significantly. And since Kotlin doesn’t support higher kinds as of this writing, the importance of native support for ad-hoc polymorphism is questionable, or at least, certainly not as high a priority as other features.
At any rate, I have used the two techniques described above in my own code bases with reasonable benefit, so I hope they will be useful to others as well.
+
+"""
+
+Article(
+ title = "Ad-hoc polymorphism in Kotlin",
+ url = "http://beust.com/weblog/2016/06/20/ad-hoc-polymorphism-in-kotlin/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Cédric Beust",
+ date = LocalDate.of(2016, 6, 20),
+ body = body
+)
diff --git a/app/rss/articles/Algebraic Data Types In Kotlin.md b/articles/english/2016/Algebraic Data Types In Kotlin.kts
similarity index 87%
rename from app/rss/articles/Algebraic Data Types In Kotlin.md
rename to articles/english/2016/Algebraic Data Types In Kotlin.kts
index 91279b5a8..b1d9679ea 100644
--- a/app/rss/articles/Algebraic Data Types In Kotlin.md
+++ b/articles/english/2016/Algebraic Data Types In Kotlin.kts
@@ -1,12 +1,11 @@
----
-title: 'Algebraic Data Types In Kotlin'
-url: http://engineering.pivotal.io/post/algebraic-data-types-in-kotlin/
-categories:
- - Kotlin
- - Functional Programming
-author: Mike Gehard
-date: Mar 19, 2016 12:15
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Lately I have been doing a good amount of reading on functional programming, specifically [Haskell](http://haskellbook.com/) and [Elm](http://elm-lang.org/). As part of this reading, I've been exposed to the wonderful world of type systems more advanced than the ones that I am used to, i.e. the Java type system. Exposure to [algebraic data types (ADTs)](https://en.wikipedia.org/wiki/Algebraic_data_type) is one of the things that I've enjoyed about these readings. In the rest of this article, I will demonstrate how ADTs can be used in the Kotlin type system to assure that you've handled all of the possible outcomes from a business use case. For those already familiar with the [`Either` type](https://hackage.haskell.org/package/base-4.8.2.0/docs/Data-Either.html) much of this will be old news to you.
@@ -52,3 +51,19 @@ By using the type system to do this, I enable a faster feedback loop than had I
One place I have been experimenting with this type of pattern is in my [Spring controllers](https://github.com/mikegehard/user-management-evolution-kotlin/blob/master/applications/ums/src/main/kotlin/com/example/ums/subscriptions/SubscriptionsController.kt#L36-L47). I like how it makes the code that handles the outcomes easy to read and understand. Another benefit is that I now have an explicit contract between the use case and the consumer that outlines all of the possible outcomes for the use case. When I combine this contract with the `when` keyword, the compiler will enforce that the client either handles each outcome or decides to explicitly punt on some by using the `else` keyword.
Have some feedback? I'd love to hear it. Reach out to me on Twitter @mikegehard and we can have a conversation about it.
+
+"""
+
+Article(
+ title = "Algebraic Data Types In Kotlin",
+ url = "http://engineering.pivotal.io/post/algebraic-data-types-in-kotlin/",
+ categories = listOf(
+ "Kotlin",
+ "Functional Programming"
+ ),
+ type = article,
+ lang = EN,
+ author = "Mike Gehard",
+ date = LocalDate.of(2016, 3, 19),
+ body = body
+)
diff --git a/app/rss/articles/An Introduction to Kotlin.md b/articles/english/2016/An Introduction to Kotlin.kts
similarity index 95%
rename from app/rss/articles/An Introduction to Kotlin.md
rename to articles/english/2016/An Introduction to Kotlin.kts
index 51d78a043..8337283ac 100644
--- a/app/rss/articles/An Introduction to Kotlin.md
+++ b/articles/english/2016/An Introduction to Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'An Introduction to Kotlin'
-url: https://objectpartners.com/2016/02/23/an-introduction-to-kotlin/
-categories:
- - Kotlin
-author: Mike Plummer
-date: Feb 23, 2016 12:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
[Kotlin](https://kotlinlang.org/) is a relatively new language that keeps the good parts of Java while eliminating boilerplate and encouraging better Object Oriented programming style while still allowing a Functional paradigm. Best of all, it’s 100% Java-compatible which allows you to mix it with Java, Groovy, or any other Java-bytecode language. Kotlin is similar in many ways to Groovy by handling a lot of the more mundane aspects of coding in Java but unlike Groovy, which took a Dynamic Typing approach, Kotlin doubled-down on Static typing to help eliminate many of the common annoyances in Java.
## Kotlin Features
@@ -73,7 +73,7 @@ Extension functions can be added to any class at runtime which enables you to ad
```kotlin
// Anywhere this function is imported all Duration objects will gain this function
fun Duration.prettyPrint(): String {
- return "${toHours()}:${toMinutes() % 60}:${get(ChronoUnit.SECONDS) % 60}"
+ return "${"$"}{toHours()}:${"$"}{toMinutes() % 60}:${"$"}{get(ChronoUnit.SECONDS) % 60}"
}
Duration.ZERO.prettyPrint() // Outputs '0:0:0'
@@ -115,7 +115,7 @@ var adhoc = object {
val second = "secondValue"
}
-println("${adhoc.first}, ${adhoc.second}") // Prints "firstValue, secondValue"
+println("${"$"}{adhoc.first}, ${"$"}{adhoc.second}") // Prints "firstValue, secondValue"
```
#### Singleton
@@ -256,3 +256,18 @@ I’ve coded up a simple example of using Kotlin in a standalone program [out on
## Conclusion
I hope I’ve shown you a few reasons to get excited about Kotlin and want to use it in your next project. Especially now that version 1.0 has dropped it’s never been a better time. Popular frameworks like Spring Boot are [adding support](https://spring.io/blog/2016/02/15/developing-spring-boot-applications-with-kotlin) which makes it downright easy to gain the power and expressiveness of Kotlin. If you have any questions leave a comment below. If you would like to see more detail on specific Kotlin features leave that below too; if there’s enough interest I will explore them in future posts. In the meantime, take a look at the [example code](https://github.com/mike-plummer/KotlinCalendar) and [Kotlin docs](https://kotlinlang.org/docs/). Happy coding!
+
+"""
+
+Article(
+ title = "An Introduction to Kotlin",
+ url = "https://objectpartners.com/2016/02/23/an-introduction-to-kotlin/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Mike Plummer",
+ date = LocalDate.of(2016, 2, 23),
+ body = body
+)
diff --git "a/app/rss/articles/An in-depth look at Kotlin\342\200\231s initializers.md" "b/articles/english/2016/An in-depth look at Kotlin\342\200\231s initializers.kts"
similarity index 91%
rename from "app/rss/articles/An in-depth look at Kotlin\342\200\231s initializers.md"
rename to "articles/english/2016/An in-depth look at Kotlin\342\200\231s initializers.kts"
index db86bc503..83748f172 100644
--- "a/app/rss/articles/An in-depth look at Kotlin\342\200\231s initializers.md"
+++ "b/articles/english/2016/An in-depth look at Kotlin\342\200\231s initializers.kts"
@@ -1,11 +1,11 @@
----
-title: 'An in-depth look at Kotlin’s initializers'
-url: https://medium.com/keepsafe-engineering/an-in-depth-look-at-kotlins-initializers-a0420fcbf546#.bf7j3he2b
-categories:
- - Kotlin
-author: AJ Alt
-date: Sep 23, 2016 10:30
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Yesterday I had a co-worker come to me with an interesting bug in a Kotlin class he was writing. He had a read-only property with an inline initializerlike this:
```kotlin
@@ -129,3 +129,18 @@ As you can see, initializers are run top to bottom at the beginning of a class
The crash I talked about at the beginning of the article was due to the fact that the parent constructor was calling a method that was overridden in the child class. That overridden method tried to access a property it had defined with an initializer. But since subclass initializers don’t run until the superclass constructor finishes, the property hadn’t been initialized yet.
So there you have it: Kotlin’s execution order for constructors and initializers is straight forward, but there are a lot of pieces that come in to play. Since it’s not documented very explicitly, it’s easy to get tripped up.
+
+"""
+
+Article(
+ title = "An in-depth look at Kotlin’s initializers",
+ url = "https://medium.com/keepsafe-engineering/an-in-depth-look-at-kotlins-initializers-a0420fcbf546#.bf7j3he2b",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "AJ Alt",
+ date = LocalDate.of(2016, 9, 23),
+ body = body
+)
diff --git a/articles/english/2016/Andrey Breslav Kotlin Coroutines, JVMLS 2016.kts b/articles/english/2016/Andrey Breslav Kotlin Coroutines, JVMLS 2016.kts
new file mode 100644
index 000000000..949146a77
--- /dev/null
+++ b/articles/english/2016/Andrey Breslav Kotlin Coroutines, JVMLS 2016.kts
@@ -0,0 +1,26 @@
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
+
+
+
+"""
+
+Article(
+ title = "Andrey Breslav: Kotlin Coroutines, JVMLS 2016",
+ url = "https://www.youtube.com/watch?v=4W3ruTWUhpw",
+ categories = listOf(
+ "Kotlin",
+ "Coroutines"
+ ),
+ type = video,
+ lang = EN,
+ author = "Andrey Breslav",
+ date = LocalDate.of(2016, 8, 3),
+ body = body
+)
diff --git a/app/rss/articles/Android And Kotlin.md b/articles/english/2016/Android And Kotlin.kts
similarity index 91%
rename from app/rss/articles/Android And Kotlin.md
rename to articles/english/2016/Android And Kotlin.kts
index 9543eb687..e6d821ffa 100644
--- a/app/rss/articles/Android And Kotlin.md
+++ b/articles/english/2016/Android And Kotlin.kts
@@ -1,12 +1,11 @@
----
-title: 'Android And Kotlin'
-url: https://stxnext.com/blog/android-and-kotlin/
-categories:
- - Android
- - Kotlin
-author: Bartosz Kosarzycki
-date: Apr 07, 2016 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
**Kotlin** – one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice for Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, has clear benefits for developers on one hand and keeps short compile times on the other.
@@ -40,3 +39,19 @@ Kotlin really shines in Android development when one looks at “Enum translatio
### Bartosz Kosarzycki
Senior developer focused on new technologies and particularly interested in mobile development. Has 3 years experience in Android platform. Bartosz enjoys problem solving, is a huge fan of Agile methodologies and functional programming. For some time already is vividly interested in JVM-based languages like Scala & Kotlin.
+
+"""
+
+Article(
+ title = "Android And Kotlin",
+ url = "https://stxnext.com/blog/android-and-kotlin/",
+ categories = listOf(
+ "Android",
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Bartosz Kosarzycki",
+ date = LocalDate.of(2016, 4, 7),
+ body = body
+)
diff --git a/app/rss/articles/Android development with Kotlin.md b/articles/english/2016/Android development with Kotlin.kts
similarity index 88%
rename from app/rss/articles/Android development with Kotlin.md
rename to articles/english/2016/Android development with Kotlin.kts
index 98ebf0208..675adab00 100644
--- a/app/rss/articles/Android development with Kotlin.md
+++ b/articles/english/2016/Android development with Kotlin.kts
@@ -1,12 +1,11 @@
----
-title: 'Android development with Kotlin'
-url: http://inaka.net/blog/2016/01/15/android-development-with-kotlin/
-categories:
- - Kotlin
- - Android
-author: Fernando Ramirez
-date: Jan 15, 2016 21:54
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
## What is Kotlin?
@@ -60,8 +59,8 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${"$"}kotlin_version"
+ classpath "org.jetbrains.kotlin:kotlin-android-extensions:${"$"}kotlin_version"
}
}
@@ -72,7 +71,7 @@ repositories {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
- compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ compile "org.jetbrains.kotlin:kotlin-stdlib:${"$"}kotlin_version"
}
```
@@ -174,7 +173,7 @@ Then you can call MainActivity.PICK_CONTACT and it will receive the value 100.
```kotlin
fun printFirst(array: Array) {
if (array.size == 0) return
- print("First value: ${array[0]}")
+ print("First value: ${"$"}{array[0]}")
}
```
@@ -232,3 +231,19 @@ textView1.text = "example text"
* [RxKotlin](https://github.com/ReactiveX/RxKotlin)
* [kotterknife](https://github.com/JakeWharton/kotterknife)
* [kotlin-nosql](https://github.com/cheptsov/kotlin-nosql)
+
+"""
+
+Article(
+ title = "Android development with Kotlin",
+ url = "http://inaka.net/blog/2016/01/15/android-development-with-kotlin/",
+ categories = listOf(
+ "Kotlin",
+ "Android"
+ ),
+ type = article,
+ lang = EN,
+ author = "Fernando Ramirez",
+ date = LocalDate.of(2016, 1, 15),
+ body = body
+)
diff --git a/app/rss/articles/App State as a tree.md b/articles/english/2016/App State as a tree.kts
similarity index 91%
rename from app/rss/articles/App State as a tree.md
rename to articles/english/2016/App State as a tree.kts
index 59d44bb59..85acbb6cf 100644
--- a/app/rss/articles/App State as a tree.md
+++ b/articles/english/2016/App State as a tree.kts
@@ -1,11 +1,11 @@
----
-title: 'App State as a tree'
-url: https://medium.com/lewisrhine/app-state-as-a-tree-a8eb6b26dd1b#.f9j7p0x89
-categories:
- - Kotlin
-author: Lewis Rhine
-date: Nov 21, 2016 02:08
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
We tend to think of app state as just the current values at a given time. But what if we thought about state at a higher level? Wouldn’t it be useful to have more information, not just of the values of our properties, but the state of an application as a whole.
Image your whole app broken into trees. Let’s say for example, a restaurant review app, why a restaurant review app? I don’t know! I’m just trying to think of anything that’s not a To Do app, okay. Let’s draw out what the state tree of this kind of app would be.
@@ -84,3 +84,18 @@ when (restaurantNearby) {
```
Now there is a big part of this idea that is missing. How do you pass these classes around? How should you set it? Should it be immutable? The idea of building your state’s into trees is part of a library I am working on called [Akorn](https://github.com/LewisRhine/Akorn). It is a Flux style architecture, open source library, that uses RxJava to reactivity pass your state trees. Akron is still a little baby and I would love for people check it out.
+
+"""
+
+Article(
+ title = "App State as a tree",
+ url = "https://medium.com/lewisrhine/app-state-as-a-tree-a8eb6b26dd1b#.f9j7p0x89",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Lewis Rhine",
+ date = LocalDate.of(2016, 11, 21),
+ body = body
+)
diff --git a/app/rss/articles/Better Android Development with Kotlin and Gradle.md b/articles/english/2016/Better Android Development with Kotlin and Gradle.kts
similarity index 79%
rename from app/rss/articles/Better Android Development with Kotlin and Gradle.md
rename to articles/english/2016/Better Android Development with Kotlin and Gradle.kts
index 7e0c286ee..c4a66b028 100644
--- a/app/rss/articles/Better Android Development with Kotlin and Gradle.md
+++ b/articles/english/2016/Better Android Development with Kotlin and Gradle.kts
@@ -1,14 +1,11 @@
----
-title: 'Better Android Development with Kotlin and Gradle'
-url: https://www.youtube.com/watch?v=bVSeKexyzhs
-type: video
-categories:
- - Kotlin
- - Android
- - Gradle
-author: Ty Smith
-date: Oct 3, 2016 11:53
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
# v1
@@ -30,3 +27,20 @@ Ty Smith, Uber
In this talk, Ty will walk you through setting up and using Kotlin with Gradle to streamline your workflow for Android development, both within the build tool phase and within the application itself, so that you can use a consistent language through the entire Android stack. After a brief overview of Kotlin, we’ll dive into how it can be used with Gradle to accelerate Android Development with a consistent language. I'll walk through a real world example of building a Gradle plugin in and scripts in Groovy, then I'll convert those into Kotlin. An open source repo of the sample will be provided to follow along.
+
+"""
+
+Article(
+ title = "Better Android Development with Kotlin and Gradle",
+ url = "https://www.youtube.com/watch?v=bVSeKexyzhs",
+ categories = listOf(
+ "Kotlin",
+ "Android",
+ "Gradle"
+ ),
+ type = video,
+ lang = EN,
+ author = "Ty Smith",
+ date = LocalDate.of(2016, 10, 3),
+ body = body
+)
diff --git a/app/rss/articles/Building DSL Instead of an IDE Plugin.md b/articles/english/2016/Building DSL Instead of an IDE Plugin.kts
similarity index 91%
rename from app/rss/articles/Building DSL Instead of an IDE Plugin.md
rename to articles/english/2016/Building DSL Instead of an IDE Plugin.kts
index 9d4ca5ba0..e8755d6e1 100644
--- a/app/rss/articles/Building DSL Instead of an IDE Plugin.md
+++ b/articles/english/2016/Building DSL Instead of an IDE Plugin.kts
@@ -1,14 +1,14 @@
----
-title: 'Building DSL Instead of an IDE Plugin'
-url: http://jonnyzzz.com/blog/2016/09/02/dsl-building/
-categories:
- - Kotlin
- - DSL
-author: Eugene Petrenko
-date: Sep 02, 2016 03:04
-features:
- - mathjax
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.ArticleFeature
+import link.kotlin.scripts.ArticleFeature.highlightjs
+import link.kotlin.scripts.ArticleFeature.mathjax
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
An alternative way of doing IDE support without any IDE plugin code for not yet supported and specific languages.
Problem Statement
@@ -177,3 +177,20 @@ You may follow to [this post](http://jonnyzzz.com/blog/2016/03/08/gradle-for-dsl
for The DSL Way toolset
*PS*. Do you have more examples for \\(Original Language\\)? Please share in comments below
+
+"""
+
+Article(
+ title = "Building DSL Instead of an IDE Plugin",
+ url = "http://jonnyzzz.com/blog/2016/09/02/dsl-building/",
+ categories = listOf(
+ "Kotlin",
+ "DSL"
+ ),
+ type = article,
+ lang = EN,
+ author = "Eugene Petrenko",
+ date = LocalDate.of(2016, 9, 2),
+ body = body,
+ features = listOf(mathjax, highlightjs)
+)
diff --git a/app/rss/articles/Building a Kotlin project 1-2.md b/articles/english/2016/Building a Kotlin project 1-2.kts
similarity index 85%
rename from app/rss/articles/Building a Kotlin project 1-2.md
rename to articles/english/2016/Building a Kotlin project 1-2.kts
index 0ca055a44..3437fb704 100644
--- a/app/rss/articles/Building a Kotlin project 1-2.md
+++ b/articles/english/2016/Building a Kotlin project 1-2.kts
@@ -1,12 +1,11 @@
----
-title: 'Building a Kotlin project 1/2'
-url: http://cirorizzo.net/2016/03/04/building-a-kotlin-project/
-categories:
- - Android
- - Kotlin
-author: Ciro Rizzo
-date: Mar 04, 2016 21:19
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
### Part 1
The best way to learn a new language is to use it in a real use case.
That's way this new series of posts are focused on building a proper Android project using Kotlin.
@@ -106,7 +105,7 @@ buildscript {
}
dependencies {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_ver"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${"$"}kotlin_ver"
}
}
```
@@ -123,15 +122,15 @@ Before adding the dependencies for the libraries we're going to use in the proje
```groovy
android {
- compileSdkVersion "$compileSdkVersion_ver".toInteger()
- buildToolsVersion "$buildToolsVersion_ver"
+ compileSdkVersion "${"$"}compileSdkVersion_ver".toInteger()
+ buildToolsVersion "${"$"}buildToolsVersion_ver"
defaultConfig {
applicationId "com.github.cirorizzo.kshows"
- minSdkVersion "$minSdkVersion_ver".toInteger()
- targetSdkVersion "$targetSdkVersion_ver".toInteger()
- versionCode "$versionCode_ver".toInteger()
- versionName "$versionName_ver"
+ minSdkVersion "${"$"}minSdkVersion_ver".toInteger()
+ targetSdkVersion "${"$"}targetSdkVersion_ver".toInteger()
+ versionCode "${"$"}versionCode_ver".toInteger()
+ versionName "${"$"}versionName_ver"
}
...
```
@@ -165,25 +164,25 @@ Next step is to declare the Libraries used in the project
```groovy
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
- testCompile "junit:junit:$junit_ver"
+ testCompile "junit:junit:${"$"}junit_ver"
- compile "com.android.support:appcompat-v7:$support_ver"
- compile "com.android.support:cardview-v7:$support_ver"
- compile "com.android.support:recyclerview-v7:$support_ver"
- compile "com.github.bumptech.glide:glide:$glide_ver"
+ compile "com.android.support:appcompat-v7:${"$"}support_ver"
+ compile "com.android.support:cardview-v7:${"$"}support_ver"
+ compile "com.android.support:recyclerview-v7:${"$"}support_ver"
+ compile "com.github.bumptech.glide:glide:${"$"}glide_ver"
- compile "com.squareup.retrofit2:retrofit:$retrofit_ver"
- compile ("com.squareup.retrofit2:converter-simplexml:$retrofit_ver") {
+ compile "com.squareup.retrofit2:retrofit:${"$"}retrofit_ver"
+ compile ("com.squareup.retrofit2:converter-simplexml:${"$"}retrofit_ver") {
exclude module: 'xpp3'
exclude group: 'stax'
}
- compile "io.reactivex:rxjava:$rxjava_ver"
- compile "io.reactivex:rxandroid:$rxandroid_ver"
- compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_ver"
+ compile "io.reactivex:rxjava:${"$"}rxjava_ver"
+ compile "io.reactivex:rxandroid:${"$"}rxandroid_ver"
+ compile "com.squareup.retrofit2:adapter-rxjava:${"$"}retrofit_ver"
- compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_ver"
- compile "org.jetbrains.anko:anko-common:$anko_ver"
+ compile "org.jetbrains.kotlin:kotlin-stdlib:${"$"}kotlin_ver"
+ compile "org.jetbrains.anko:anko-common:${"$"}anko_ver"
}
```
@@ -214,3 +213,19 @@ A special thanks for the translation to the gold.xitu.io Team
+
+"""
+
+Article(
+ title = "Building a Kotlin project 1/2",
+ url = "http://cirorizzo.net/2016/03/04/building-a-kotlin-project/",
+ categories = listOf(
+ "Android",
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Ciro Rizzo",
+ date = LocalDate.of(2016, 3, 4),
+ body = body
+)
diff --git a/app/rss/articles/Building a Kotlin project 2-2.md b/articles/english/2016/Building a Kotlin project 2-2.kts
similarity index 97%
rename from app/rss/articles/Building a Kotlin project 2-2.md
rename to articles/english/2016/Building a Kotlin project 2-2.kts
index 51508b544..dc4b2962e 100644
--- a/app/rss/articles/Building a Kotlin project 2-2.md
+++ b/articles/english/2016/Building a Kotlin project 2-2.kts
@@ -1,12 +1,11 @@
----
-title: 'Building a Kotlin project 2/2'
-url: http://cirorizzo.net/2016/03/04/building-a-kotlin-project-2/
-categories:
- - Android
- - Kotlin
-author: Ciro Rizzo
-date: Mar 04, 2016 21:22
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
###### _Part 2_
In the previous [post](http://www.cirorizzo.net/building-a-kotlin-project/) we started a new project from scratch, and adjusted the `build.gradle` for the Kitten App purpose.
@@ -379,3 +378,19 @@ The same project has been written in Java as well [JShows](https://github.com/ci
This post is also available in Chinese on [gold.xitu.io](https://goo.gl/3YpGoR)
A special thanks for the translation to the **gold.xitu.io** Team
+
+"""
+
+Article(
+ title = "Building a Kotlin project 2/2",
+ url = "http://cirorizzo.net/2016/03/04/building-a-kotlin-project-2/",
+ categories = listOf(
+ "Android",
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Ciro Rizzo",
+ date = LocalDate.of(2016, 3, 4),
+ body = body
+)
diff --git a/app/rss/articles/Building a compiler for your own language validation.md b/articles/english/2016/Building a compiler for your own language validation.kts
similarity index 82%
rename from app/rss/articles/Building a compiler for your own language validation.md
rename to articles/english/2016/Building a compiler for your own language validation.kts
index 23a36c207..9f9f658f0 100644
--- a/app/rss/articles/Building a compiler for your own language validation.md
+++ b/articles/english/2016/Building a compiler for your own language validation.kts
@@ -1,11 +1,11 @@
----
-title: 'Building a compiler for your own language: validation'
-url: http://tomassetti.me/building-compiler-language-validation/
-categories:
- - Kotlin
-author: Federico Tomassetti
-date: Sep 06, 2016 01:20
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
![validation_for_your_own_programming_language](http://i0.wp.com/tomassetti.me/wp-content/uploads/2016/08/validation_for_your_own_programming_language.jpg?resize=730%2C489)
So you have parsed your code and built a clean AST for it. Now it is time to check if what the user has expressed make sense at all. We should perform validation, identifying semantical errors, to communicate together with lexical and syntactical errors (provided by the parser).
@@ -49,7 +49,7 @@ fun SandyFile.validate() : List {
val varsByName = HashMap()
this.specificProcess(VarDeclaration::class.java) {
if (varsByName.containsKey(it.varName)) {
- errors.add(Error("A variable named '${it.varName}' has been already declared at ${varsByName[it.varName]!!.position!!.start}",
+ errors.add(Error("A variable named '${"$"}{it.varName}' has been already declared at ${"$"}{varsByName[it.varName]!!.position!!.start}",
it.position!!.start))
} else {
varsByName[it.varName] = it
@@ -59,16 +59,16 @@ fun SandyFile.validate() : List {
// check a variable is not referred before being declared
this.specificProcess(VarReference::class.java) {
if (!varsByName.containsKey(it.varName)) {
- errors.add(Error("There is no variable named '${it.varName}'", it.position!!.start))
+ errors.add(Error("There is no variable named '${"$"}{it.varName}'", it.position!!.start))
} else if (it.isBefore(varsByName[it.varName]!!)) {
- errors.add(Error("You cannot refer to variable '${it.varName}' before its declaration", it.position!!.start))
+ errors.add(Error("You cannot refer to variable '${"$"}{it.varName}' before its declaration", it.position!!.start))
}
}
this.specificProcess(Assignment::class.java) {
if (!varsByName.containsKey(it.varName)) {
- errors.add(Error("There is no variable named '${it.varName}'", it.position!!.start))
+ errors.add(Error("There is no variable named '${"$"}{it.varName}'", it.position!!.start))
} else if (it.isBefore(varsByName[it.varName]!!)) {
- errors.add(Error("You cannot refer to variable '${it.varName}' before its declaration", it.position!!.start))
+ errors.add(Error("You cannot refer to variable '${"$"}{it.varName}' before its declaration", it.position!!.start))
}
}
@@ -167,8 +167,8 @@ _Will it fly? _Let’s verify that.
class ValidationTest {
@test fun duplicateVar() {
- val errors = SandyParserFacade.parse("""var a = 1
- |var a =2""".trimMargin("|")).errors
+ val errors = SandyParserFacade.parse(\"\"\"var a = 1
+ |var a =2\"\"\".trimMargin("|")).errors
assertEquals(listOf(Error("A variable named 'a' has been already declared at Line 1, Column 0", Point(2,0))), errors)
}
@@ -178,8 +178,8 @@ class ValidationTest {
}
@test fun varReferenceBeforeDeclaration() {
- val errors = SandyParserFacade.parse("""var a = b + 2
- |var b = 2""".trimMargin("|")).errors
+ val errors = SandyParserFacade.parse(\"\"\"var a = b + 2
+ |var b = 2\"\"\".trimMargin("|")).errors
assertEquals(listOf(Error("You cannot refer to variable 'b' before its declaration", Point(1,8))), errors)
}
@@ -189,8 +189,8 @@ class ValidationTest {
}
@test fun varAssignmentBeforeDeclaration() {
- val errors = SandyParserFacade.parse("""a = 1
- |var a =2""".trimMargin("|")).errors
+ val errors = SandyParserFacade.parse(\"\"\"a = 1
+ |var a =2\"\"\".trimMargin("|")).errors
assertEquals(listOf(Error("You cannot refer to variable 'a' before its declaration", Point(1,0))), errors)
}
@@ -199,3 +199,18 @@ class ValidationTest {
## Conclusions
This is all nice and well: with a simple call we can get a list of all errors we have. For each of them we have a description and the position. This is enough for our compiler but we would now need to show these errors in the editor. We will do that in out of the future posts.
+
+"""
+
+Article(
+ title = "Building a compiler for your own language: validation",
+ url = "http://tomassetti.me/building-compiler-language-validation/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Federico Tomassetti",
+ date = LocalDate.of(2016, 9, 6),
+ body = body
+)
diff --git a/app/rss/articles/Building microservices with Kotlin and Spring Boot.md b/articles/english/2016/Building microservices with Kotlin and Spring Boot.kts
similarity index 87%
rename from app/rss/articles/Building microservices with Kotlin and Spring Boot.md
rename to articles/english/2016/Building microservices with Kotlin and Spring Boot.kts
index 988c581c2..7cb95eb30 100644
--- a/app/rss/articles/Building microservices with Kotlin and Spring Boot.md
+++ b/articles/english/2016/Building microservices with Kotlin and Spring Boot.kts
@@ -1,11 +1,11 @@
----
-title: 'Building microservices with Kotlin and Spring Boot'
-url: http://www.thedevpiece.com/building-microservices-with-kotlin-and-springboot/
-categories:
- - Kotlin
-author: Gabriel Francisco
-date: Dec 15, 2016 02:16
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
![Kotlin and Spring-Boot Logo.](http://www.thedevpiece.com/content/images/2016/12/kotlin-springboot.png)
It's been a while since Kotlin arrived. Kotlin is a JVM language created by JetBrains developed to be interoperate with Java libraries and apis.
@@ -28,7 +28,7 @@ buildscript {
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE"
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${"$"}kotlin_version"
}
}
@@ -47,7 +47,7 @@ sourceSets {
}
dependencies {
- compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ compile "org.jetbrains.kotlin:kotlin-stdlib:${"$"}kotlin_version"
compile 'org.slf4j:slf4j-api:1.7.14'
@@ -146,3 +146,18 @@ And I guess that's all. As you can see, Kotlin is a interesting language, very p
Thank you and, any questions, please, leave a comment.
[]'s
+
+"""
+
+Article(
+ title = "Building microservices with Kotlin and Spring Boot",
+ url = "http://www.thedevpiece.com/building-microservices-with-kotlin-and-springboot/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Gabriel Francisco",
+ date = LocalDate.of(2016, 12, 15),
+ body = body
+)
diff --git a/app/rss/articles/Calling on EAPers.md b/articles/english/2016/Calling on EAPers.kts
similarity index 87%
rename from app/rss/articles/Calling on EAPers.md
rename to articles/english/2016/Calling on EAPers.kts
index f56571fa1..fc0063948 100644
--- a/app/rss/articles/Calling on EAPers.md
+++ b/articles/english/2016/Calling on EAPers.kts
@@ -1,12 +1,11 @@
----
-title: 'Calling on EAPers'
-url: https://blog.jetbrains.com/kotlin/2016/08/calling-on-eapers/
-categories:
- - Kotlin
- - EAP
-author: Roman Belov
-date: Aug 04, 2016 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
At JetBrains we’ve always believed in our Early Access Program for our tools, giving developers a chance to use the latest features or fixes as soon as they’re ready. We’ve followed the same philosophy with Kotlin, knowing of course that with a language, some decisions can haunt you for life.
That is why during the pre-release days of Kotlin, we’d have milestone releases with features and important changes for our early adopters (including ourselves at JetBrains), collect feedback on whether things were working as designed. This release-feedback-adjust cycle has proven invaluable in so many occasions and has definitely helped shape Kotlin 1.0.
@@ -28,3 +27,19 @@ Most of the Kotlin team are available on our public ([Slack community](http://ko
One of our main goals with Kotlin has always been to make it an industrial language that is pragmatic. And it’s by using Kotlin in many types of applications and scenarios that will help us achieve this goal. For this, we continue to need your help!
Thank you and let’s Kotlin!
+
+"""
+
+Article(
+ title = "Calling on EAPers",
+ url = "https://blog.jetbrains.com/kotlin/2016/08/calling-on-eapers/",
+ categories = listOf(
+ "Kotlin",
+ "EAP"
+ ),
+ type = article,
+ lang = EN,
+ author = "Roman Belov",
+ date = LocalDate.of(2016, 8, 4),
+ body = body
+)
diff --git a/app/rss/articles/Christina Lee Kotlin in Production.md b/articles/english/2016/Christina Lee Kotlin in Production.kts
similarity index 70%
rename from app/rss/articles/Christina Lee Kotlin in Production.md
rename to articles/english/2016/Christina Lee Kotlin in Production.kts
index 1447c9ce5..d7801ac9c 100644
--- a/app/rss/articles/Christina Lee Kotlin in Production.md
+++ b/articles/english/2016/Christina Lee Kotlin in Production.kts
@@ -1,12 +1,11 @@
----
-title: 'Christina Lee: Kotlin in Production'
-url: https://www.youtube.com/watch?v=xRDqDe4rxkM
-categories:
- - Kotlin
-author: Android Dialogs
-type: video
-date: Oct 18, 2016 05:39
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
# v1
While in New York for Droidcon NYC, Huyen hangs out with Christina Lee, Pinterest Android engineer and cross-country runner, to talk about bringing Kotlin into your production apps.
@@ -19,3 +18,18 @@ Christina Lee, Pinterest
It is hard to argue that Kotlin is not an amazing language. What is easy to argue is that there are many unknowns about its performance in the wild and at scale, which makes it hard to make an informed decision about incorporating it into your app. Fortunately for you, we went there and have lived to tell the tale. After more than a year of maintaining a pure Kotlin app at Highlight, and more recently helping Pinterest ramp up Kotlin in Android, we've learned much about the ramifications of moving away from Java. Come learn from our mistakes and successes as we cover the highs, and lows, of using Kotlin in the wild!
+
+"""
+
+Article(
+ title = "Christina Lee: Kotlin in Production",
+ url = "https://www.youtube.com/watch?v=xRDqDe4rxkM",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = video,
+ lang = EN,
+ author = "Android Dialogs",
+ date = LocalDate.of(2016, 10, 18),
+ body = body
+)
diff --git a/app/rss/articles/Code Swarm for kotlin.md b/articles/english/2016/Code Swarm for kotlin.kts
similarity index 55%
rename from app/rss/articles/Code Swarm for kotlin.md
rename to articles/english/2016/Code Swarm for kotlin.kts
index 03d2abaad..75064dd99 100644
--- a/app/rss/articles/Code Swarm for kotlin.md
+++ b/articles/english/2016/Code Swarm for kotlin.kts
@@ -1,12 +1,11 @@
----
-title: 'Code Swarm for Kotlin'
-url: https://www.youtube.com/watch?v=UTN2_YXEzL4
-categories:
- - Kotlin
-type: video
-author: Landon Wilkins
-date: Nov 24, 2016 11:54
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
@@ -21,3 +20,18 @@ https://github.com/rictic/code_swarm
Why make this visualization?
- I'm studying how popular projects evolve
+
+"""
+
+Article(
+ title = "Code Swarm for Kotlin",
+ url = "https://www.youtube.com/watch?v=UTN2_YXEzL4",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = video,
+ lang = EN,
+ author = "Landon Wilkins",
+ date = LocalDate.of(2016, 11, 24),
+ body = body
+)
diff --git a/app/rss/articles/Code improvements with Kotlin.md b/articles/english/2016/Code improvements with Kotlin.kts
similarity index 93%
rename from app/rss/articles/Code improvements with Kotlin.md
rename to articles/english/2016/Code improvements with Kotlin.kts
index 057c5097c..f2cfdd446 100644
--- a/app/rss/articles/Code improvements with Kotlin.md
+++ b/articles/english/2016/Code improvements with Kotlin.kts
@@ -1,12 +1,11 @@
----
-title: 'Code improvements with Kotlin'
-url: https://blog.frankel.ch/code-improvement-kotlin
-categories:
- - Kotlin
- -
-author: Nicolas Frankel
-date: Apr 17, 2016 16:23
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
[![](https://blog.frankel.ch/wp-content/resources/code-improvement-kotlin/icon_Kotlin.png)](https://kotlinlang.org/)This week, I tried to improve my pet Android application developed in Kotlin. As I was very new to Kotlin when I started it, most of the code just looks like Java written in Kotlin.
### Starting simple
@@ -185,3 +184,19 @@ Learning a new programming language is easy: many books promise to do that in 21
* sdtlib functions [reference](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/#functions)
* [Safe calls](https://kotlinlang.org/docs/reference/null-safety.html#safe-calls)
* [Local functions](https://kotlinlang.org/docs/reference/functions.html#local-functions)
+
+"""
+
+Article(
+ title = "Code improvements with Kotlin",
+ url = "https://blog.frankel.ch/code-improvement-kotlin",
+ categories = listOf(
+ "Kotlin",
+ "null"
+ ),
+ type = article,
+ lang = EN,
+ author = "Nicolas Frankel",
+ date = LocalDate.of(2016, 4, 17),
+ body = body
+)
diff --git a/app/rss/articles/Composing functions in Kotlin with extensions and operators.md b/articles/english/2016/Composing functions in Kotlin with extensions and operators.kts
similarity index 90%
rename from app/rss/articles/Composing functions in Kotlin with extensions and operators.md
rename to articles/english/2016/Composing functions in Kotlin with extensions and operators.kts
index a39296cc1..3f234c279 100644
--- a/app/rss/articles/Composing functions in Kotlin with extensions and operators.md
+++ b/articles/english/2016/Composing functions in Kotlin with extensions and operators.kts
@@ -1,11 +1,11 @@
----
-title: 'Composing functions in Kotlin with extensions and operators'
-url: https://medium.com/@fourlastor/composing-functions-in-kotlin-with-extensions-and-operators-76a499f5b4b7#.72408kmql
-categories:
- - Kotlin
-author: Daniele Conti
-date: Oct 27, 2016 02:15
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Today I was wondering if I could achieve a more elegant way to compose functions with Kotlin. Let’s imagine we have this:
```kotlin
@@ -126,3 +126,18 @@ fun composed(val: Int) = (::trice..::twice..::same) (val)
We’re applying the `..` operator to `trice`, `twice`, and `same`, in order. Since the return type is a function, the result of `::trice..::twice` can be then chained with `::same`. The result of this last operation is again a function, which then we invoke with `(val)` as an argument.
Kotlin metaprogramming features are extremely intersting, and give you the chance to make your code more expressive, especially when you combine features like extensions and operator overloading. This is only a small example of what you can achieve, so start playing with it if you aren’t already!
+
+"""
+
+Article(
+ title = "Composing functions in Kotlin with extensions and operators",
+ url = "https://medium.com/@fourlastor/composing-functions-in-kotlin-with-extensions-and-operators-76a499f5b4b7#.72408kmql",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Daniele Conti",
+ date = LocalDate.of(2016, 10, 27),
+ body = body
+)
diff --git a/app/rss/articles/Concurrency Primitives in Kotlin.md b/articles/english/2016/Concurrency Primitives in Kotlin.kts
similarity index 84%
rename from app/rss/articles/Concurrency Primitives in Kotlin.md
rename to articles/english/2016/Concurrency Primitives in Kotlin.kts
index e4ab3a73e..795295612 100644
--- a/app/rss/articles/Concurrency Primitives in Kotlin.md
+++ b/articles/english/2016/Concurrency Primitives in Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'Concurrency Primitives in Kotlin'
-url: https://blog.egorand.me/concurrency-primitives-in-kotlin/
-categories:
- - Kotlin
-author: Egor Andreevici
-date: Dec 23, 2016 01:03
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
I've recently started reading ["Android Concurrency" by G. Blake Meike](https://www.goodreads.com/book/show/26260944-android-concurrency), and so far I can highly recommend this great book: it contains quite a lot of insight into how various Android concurrency mechanisms work, when to prefer one approach over the other and how to get the best of the tools at your disposal. I decided to follow along with the code examples and recreate them on my computer, and since I'm deeply in love with Kotlin, I thought it would be a great idea to translate the examples into Kotlin on the go. In one of the first chapters the author revisits concurrency basics in Java, and when I started rewriting the code examples in Kotlin, I was quite surprised to find out that:
* There's no `synchronized` keyword in Kotlin
@@ -25,7 +25,7 @@ There are two ways to create a thread in Java: extending the `Thread` class, or
```kotlin
object : Thread() {
override fun run() {
- println("running from Thread: ${Thread.currentThread()}")
+ println("running from Thread: ${"$"}{Thread.currentThread()}")
}
}.start()
```
@@ -34,7 +34,7 @@ This code uses Kotlin's [`Object Expressions`](https://kotlinlang.org/docs/refer
```kotlin
Thread({
- println("running from lambda: ${Thread.currentThread()}")
+ println("running from lambda: ${"$"}{Thread.currentThread()}")
}).start()
```
@@ -42,7 +42,7 @@ You don't see a `Runnable` here: in Kotlin it can easily be replaced with a [lam
```kotlin
thread(start = true) {
- println("running from thread(): ${Thread.currentThread()}")
+ println("running from thread(): ${"$"}{Thread.currentThread()}")
}
```
@@ -77,7 +77,7 @@ It's just a very convenient wrapper function that's a joy to use.
```kotlin
@Synchronized fun synchronizedMethod() {
- println("inside a synchronized method: ${Thread.currentThread()}")
+ println("inside a synchronized method: ${"$"}{Thread.currentThread()}")
}
```
@@ -85,9 +85,9 @@ The annotation has the same effect as Java's `synchronized`: it'll mark the JVM
```kotlin
fun methodWithSynchronizedBlock() {
- println("outside of a synchronized block: ${Thread.currentThread()}")
+ println("outside of a synchronized block: ${"$"}{Thread.currentThread()}")
synchronized(this) {
- println("inside a synchronized block: ${Thread.currentThread()}")
+ println("inside a synchronized block: ${"$"}{Thread.currentThread()}")
}
}
```
@@ -105,14 +105,14 @@ fun start() {
running = true
thread(start = true) {
while (running) {
- println("Still running: ${Thread.currentThread()}")
+ println("Still running: ${"$"}{Thread.currentThread()}")
}
}
}
fun stop() {
running = false
- println("Stopped: ${Thread.currentThread()}")
+ println("Stopped: ${"$"}{Thread.currentThread()}")
}
```
@@ -131,7 +131,7 @@ fun produce() = synchronized(lock) {
}
Thread.sleep(rand.nextInt(100).toLong())
items++
- println("Produced, count is $items: ${Thread.currentThread()}")
+ println("Produced, count is ${"$"}items: ${"$"}{Thread.currentThread()}")
lock.notifyAll()
}
@@ -141,7 +141,7 @@ fun consume() = synchronized(lock) {
}
Thread.sleep(rand.nextInt(100).toLong())
items--
- println("Consumed, count is $items: ${Thread.currentThread()}")
+ println("Consumed, count is ${"$"}items: ${"$"}{Thread.currentThread()}")
lock.notifyAll()
}
```
@@ -155,3 +155,18 @@ All code samples from this article are available on [GitHub](https://github.com/
Although they're not used frequently, it's still important to know and understand the basic concurrency tools. Turns out those work a bit differently in Kotlin than in Java, but all major mechanisms are supported. And remember that Kotlin interacts really well with Java, so you can just rely on Java classes if the Kotlin counterparts are missing. Have fun!
If you've enjoyed this short article, please share it with your network using one of the buttons below. Thanks, and have a Merry Christmas!
+
+"""
+
+Article(
+ title = "Concurrency Primitives in Kotlin",
+ url = "https://blog.egorand.me/concurrency-primitives-in-kotlin/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Egor Andreevici",
+ date = LocalDate.of(2016, 12, 23),
+ body = body
+)
diff --git a/app/rss/articles/Crafting Log4j Configuration DSL.md b/articles/english/2016/Crafting Log4j Configuration DSL.kts
similarity index 94%
rename from app/rss/articles/Crafting Log4j Configuration DSL.md
rename to articles/english/2016/Crafting Log4j Configuration DSL.kts
index d30710491..ac3afd7a4 100644
--- a/app/rss/articles/Crafting Log4j Configuration DSL.md
+++ b/articles/english/2016/Crafting Log4j Configuration DSL.kts
@@ -1,14 +1,13 @@
----
-title: 'Crafting Log4j Configuration DSL'
-url: http://jonnyzzz.com/blog/2016/09/09/log4j-dsl/
-categories:
- - Kotlin
- - DSL
-author: Eugene Petrenko
-date: Sep 9, 2016 02:45
-features:
- - mathjax
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.ArticleFeature.highlightjs
+import link.kotlin.scripts.ArticleFeature.mathjax
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
In this post I show how to implement The DSL Way to manage
Log4j configuration and extend an IDE without writing a plugin for it
@@ -330,3 +329,20 @@ You may have a look (or contribute) to the project sources on [my GitHub](https:
You may follow to [this post](http://jonnyzzz.com/blog/2016/03/08/gradle-for-dsl/) for details on how to create
a zero-configuration package for such DSLs and for The DSL Way approach.
+
+"""
+
+Article(
+ title = "Crafting Log4j Configuration DSL",
+ url = "http://jonnyzzz.com/blog/2016/09/09/log4j-dsl/",
+ categories = listOf(
+ "Kotlin",
+ "DSL"
+ ),
+ type = article,
+ lang = EN,
+ author = "Eugene Petrenko",
+ date = LocalDate.of(2016, 9, 9),
+ body = body,
+ features = listOf(mathjax, highlightjs)
+)
diff --git a/app/rss/articles/Creating an AndroidWear watchface using Kotlin.md b/articles/english/2016/Creating an AndroidWear watchface using Kotlin.kts
similarity index 93%
rename from app/rss/articles/Creating an AndroidWear watchface using Kotlin.md
rename to articles/english/2016/Creating an AndroidWear watchface using Kotlin.kts
index 159e7c0cf..a2c054962 100644
--- a/app/rss/articles/Creating an AndroidWear watchface using Kotlin.md
+++ b/articles/english/2016/Creating an AndroidWear watchface using Kotlin.kts
@@ -1,13 +1,11 @@
----
-title: 'Creating an AndroidWear watchface using Kotlin'
-url: https://medium.com/@robj.perez/creating-an-androidwear-watchface-using-kotlin-e5f725813fa9#.xcftwvys6
-categories:
- - Android
- - Android Wear
- - Kotlin
-author: Roberto Perez
-date: Mar 28, 2016 09:19
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
### Creating an AndroidWear watchface using Kotlin
![](https://d262ilb51hltx0.cloudfront.net/max/600/1*78W0Fk8Ca3OGCdZiebTvSw.png)
@@ -122,3 +120,20 @@ One of the important things when using a new technology is the how its users com
#### Conclusions
I could be talking about the features of Kotlin which we used while developing the watch face for hours, things like the functional features of Kotlin, the pattern matching of “switch” clauses, the bugs that optional types and immutability has saved us time of debugging and so on. In our experience choosing of Kotlin has been a great decision, it made our code more readable and one of the most important outcomes, we enjoyed a lot while developing the application which at the end is all that matters, isn’t it? :).
+
+"""
+
+Article(
+ title = "Creating an AndroidWear watchface using Kotlin",
+ url = "https://medium.com/@robj.perez/creating-an-androidwear-watchface-using-kotlin-e5f725813fa9#.xcftwvys6",
+ categories = listOf(
+ "Android",
+ "Android Wear",
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Roberto Perez",
+ date = LocalDate.of(2016, 3, 28),
+ body = body
+)
diff --git a/app/rss/articles/DSL builder in Kotlin.md b/articles/english/2016/DSL builder in Kotlin.kts
similarity index 90%
rename from app/rss/articles/DSL builder in Kotlin.md
rename to articles/english/2016/DSL builder in Kotlin.kts
index 9adf65818..0b5f65a87 100644
--- a/app/rss/articles/DSL builder in Kotlin.md
+++ b/articles/english/2016/DSL builder in Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'DSL builder in Kotlin'
-url: https://medium.com/@piotr.slesarew/dsl-builder-in-kotlin-be5816ba3ca7#.xbcofn4hp
-categories:
- - Kotlin
-author: Piotr Ślesarew
-date: Oct 21, 2016 02:27
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
> Design patterns describe simple and elegant solutions to specific problems in object-oriented software design. (GoF)
We all use design patterns even if we do not know their names. Builder pattern is one of the most famous and liked patterns for creating objects in an easy and scalable way. Being Java engineer I have had a lot of opportunities to master it. After a few times, I realized there is no fun in writing a builder. Thanks to IntelliJ IDEA we can generate it.
@@ -124,3 +124,18 @@ This sample shows how amazing Kotlin is and what kind of crazy structures we can
> Functional programming is like a blessed curse. Purity feels amazing but you feel like you can’t program the “dirty” way anymore. — ([André Staltz](https://twitter.com/andrestaltz/status/696716396626124801))
_If this was interesting to you, please do hit the heart button ❤ or_ [_let me know on Twitter_](https://twitter.com/SliskiCode)_._
+
+"""
+
+Article(
+ title = "DSL builder in Kotlin",
+ url = "https://medium.com/@piotr.slesarew/dsl-builder-in-kotlin-be5816ba3ca7#.xbcofn4hp",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Piotr Ślesarew",
+ date = LocalDate.of(2016, 10, 21),
+ body = body
+)
diff --git a/app/rss/articles/Data Binding in Anko.md b/articles/english/2016/Data Binding in Anko.kts
similarity index 91%
rename from app/rss/articles/Data Binding in Anko.md
rename to articles/english/2016/Data Binding in Anko.kts
index 699237474..e6ce1bfb5 100644
--- a/app/rss/articles/Data Binding in Anko.md
+++ b/articles/english/2016/Data Binding in Anko.kts
@@ -1,12 +1,11 @@
----
-title: 'Data Binding in Anko'
-url: https://medium.com/lewisrhine/data-binding-in-anko-77cd11408cf9#.ym6ibevib
-categories:
- - Kotlin
- - Anko
-author: Lewis Rhine
-date: Dec 01, 2016 10:36
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Ever since Google announced their data binding library there has been a debate in the community whether it is “the best thing since fragments” or “the worst thing since fragments”. (I knew you would see that coming, but I did it anyways)
@@ -24,7 +23,7 @@ class MainActivityUI : AnkoComponent {
verticalLayout {
val name = editText()
button("Say Hello") {
- onClick { ctx.toast("Hello, ${name.text}!") }
+ onClick { ctx.toast("Hello, ${"$"}{name.text}!") }
}
}
}
@@ -85,7 +84,7 @@ class MainActivityUI(private val bindText: Binder) : AnkoComponent
- bindText.item = “$charSequence”
+ bindText.item = “${"$"}charSequence”
}
}
}
@@ -166,3 +165,19 @@ This was mostly a proof of concept. I’m sure there are better ways of doing th
The source code is up on my GitHub.
Thank you.
+
+"""
+
+Article(
+ title = "Data Binding in Anko",
+ url = "https://medium.com/lewisrhine/data-binding-in-anko-77cd11408cf9#.ym6ibevib",
+ categories = listOf(
+ "Kotlin",
+ "Anko"
+ ),
+ type = article,
+ lang = EN,
+ author = "Lewis Rhine",
+ date = LocalDate.of(2016, 12, 1),
+ body = body
+)
diff --git a/app/rss/articles/Data Driven Testing with Spek.md b/articles/english/2016/Data Driven Testing with Spek.kts
similarity index 93%
rename from app/rss/articles/Data Driven Testing with Spek.md
rename to articles/english/2016/Data Driven Testing with Spek.kts
index e2269ad25..724fdf826 100644
--- a/app/rss/articles/Data Driven Testing with Spek.md
+++ b/articles/english/2016/Data Driven Testing with Spek.kts
@@ -1,12 +1,11 @@
----
-title: 'Data Driven Testing with Spek '
-url: http://engineering.pivotal.io/post/spek-data-driven-tests/
-categories:
- - Kotlin
- - Testing
-author: Konstantin Semenov
-date: Jul 3, 2016 03:25
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Several days ago, when we were developing a parser in Kotlin, we found ourselves copying and pasting series of tests with slight adjustments. This has become really annoying, especially when we thought of all the tests we would need to change every time the behaviour of our parser is going to change. As we have used Spock on previous projects, we wanted to replicate Spock's [Data Driven Testing](https://spockframework.github.io/spock/docs/1.0/data_driven_testing.html) approach in [Spek](https://jetbrains.github.io/spek/).
## Spock Example
@@ -83,7 +82,7 @@ class HeroTests: Spek({
listOf("when standing", false, false, true, Hero().apply { stand() })
).forEach { test ->
describe(test.first) {
- fun testLabel(flag: Boolean, action: String): String = "${if (flag) "should" else "shouldn't"} be $action"
+ fun testLabel(flag: Boolean, action: String): String = "${"$"}{if (flag) "should" else "shouldn't"} be ${"$"}action"
it(testLabel(test[1], "running")) {
expect(test[1]) { test[4].isRunning }
@@ -120,9 +119,9 @@ data class HeroQueryTest(val state: String, val subject: Hero, val isRunning: Bo
val runningTestLabel = testLabel(isRunning, "running")
val standingTestLabel = testLabel(isStanding, "standing")
val jumpingTestLabel = testLabel(isJumping, "jumping")
- val testGroupLabel = "when $state"
+ val testGroupLabel = "when ${"$"}state"
- private fun testLabel(condition: Boolean, action: String) = if (condition) "should be $action" else "shouldn't be $action"
+ private fun testLabel(condition: Boolean, action: String) = if (condition) "should be ${"$"}action" else "shouldn't be ${"$"}action"
}
```
@@ -135,10 +134,10 @@ data class HeroQueryTest(val state: String, val subject: Hero, val isRunning: Bo
val runningTestLabel = HeroQueryTest::isRunning.testLabel(this)
val standingTestLabel = HeroQueryTest::isStanding.testLabel(this)
val jumpingTestLabel = HeroQueryTest::isJumping.testLabel(this)
- val testGroupLabel = "when $state"
+ val testGroupLabel = "when ${"$"}state"
private val KProperty.action: String get() = this.name.substring(2).toLowerCase()
- private fun KProperty.testLabel(owner: Any): String = if (this.getter.call(owner)) "should be ${this.action}" else "shouldn't be ${this.action}"
+ private fun KProperty.testLabel(owner: Any): String = if (this.getter.call(owner)) "should be ${"$"}{this.action}" else "shouldn't be ${"$"}{this.action}"
}
```
@@ -235,7 +234,7 @@ class MathTests : Spek({
MaxTest(a = 7, b = 4, c = 4),
MaxTest(a = 0, b = 0, c = 0)
).forEach { test ->
- it("calculates maximum of ${test.a} and ${test.b} as ${test.c}") {
+ it("calculates maximum of ${"$"}{test.a} and ${"$"}{test.b} as ${"$"}{test.c}") {
expect(test.c) { Math.max(test.a, test.b) }
}
}
@@ -274,7 +273,7 @@ class MathTests : Spek({
0 I 0 I 0
).forEach { data ->
maxTest(data).apply {
- it("calculates maximum of $a and $b as $c") {
+ it("calculates maximum of ${"$"}a and ${"$"}b as ${"$"}c") {
expect(c) { Math.max(a, b) }
}
}
@@ -290,3 +289,19 @@ Although we were unable to fully replicate the simplicity of Spock's data tables
The shortest implementation can be made by using lists of arbitrary objects to hold the test data, but it would be hard to maintain. By introducing a few DTOs and a factory object, we have been able to increase both usability and maintainability of the test suite. And although the DTOs are tightly coupled to the test, the factory could be easily reused elsewhere in the test suite. Even so, the size of the whole test case is still kept under 50 lines of code, as opposed to a hundred lines of duplicated unmaintainable test code for the regular, non-data-driven approach.
+
+"""
+
+Article(
+ title = "Data Driven Testing with Spek ",
+ url = "http://engineering.pivotal.io/post/spek-data-driven-tests/",
+ categories = listOf(
+ "Kotlin",
+ "Testing"
+ ),
+ type = article,
+ lang = EN,
+ author = "Konstantin Semenov",
+ date = LocalDate.of(2016, 7, 3),
+ body = body
+)
diff --git a/app/rss/articles/Decision Trees with Kotlin.md b/articles/english/2016/Decision Trees with Kotlin.kts
similarity index 96%
rename from app/rss/articles/Decision Trees with Kotlin.md
rename to articles/english/2016/Decision Trees with Kotlin.kts
index 19c10ab9b..b3a299e86 100644
--- a/app/rss/articles/Decision Trees with Kotlin.md
+++ b/articles/english/2016/Decision Trees with Kotlin.kts
@@ -1,13 +1,13 @@
----
-title: 'Decision Trees with Kotlin'
-url: http://cloudmark.github.io/Decision-Trees/
-categories:
- - Kotlin
-author: Mark Galea
-date: Aug 20, 2016 03:28
-features:
- - mathjax
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.ArticleFeature.highlightjs
+import link.kotlin.scripts.ArticleFeature.mathjax
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
It has been quite a while since my last post; things have been pretty busy in preparation for the launch of our new product [VoodooDreams](https://www.voodoodreams.com). Now that we have shipped our baby, I am super eager to try out [Kotlin](https://www.kotlin.com) - a new programming language from JetBrains targeting the JVM. One interesting aspect about Kotlin (similar to Scala and other JVM-based languages) is that it treats functions as first class citizens (_IMO Functional Interfaces just patch the gap_). In order to try out this language we will create a Decision Tree Learning algorithm which is one of the most used and practical methods for learning inductive inference.
@@ -334,3 +334,19 @@ Note that `it.first` will contain the attribute value (e.g. Sunny) whilst the it
# Conclusion
In this post we have looked at some of Kotlin's key features and we have used these to build an ID3 decision tree. If you are further interested in learning about Kotlin I'd suggest you have a look at the [reference guide](https://kotlinlang.org/docs/reference/). If you are interested in learn more about Decision Tree Learning consider buying the book linked above. It is an absolute classic! Stay safe and keep hacking!
+
+"""
+
+Article(
+ title = "Decision Trees with Kotlin",
+ url = "http://cloudmark.github.io/Decision-Trees/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Mark Galea",
+ date = LocalDate.of(2016, 8, 20),
+ body = body,
+ features = listOf(mathjax, highlightjs)
+)
diff --git a/app/rss/articles/Developing Spring Boot applications with Kotlin.md b/articles/english/2016/Developing Spring Boot applications with Kotlin.kts
similarity index 89%
rename from app/rss/articles/Developing Spring Boot applications with Kotlin.md
rename to articles/english/2016/Developing Spring Boot applications with Kotlin.kts
index 992c4cda8..6e04b3b4f 100644
--- a/app/rss/articles/Developing Spring Boot applications with Kotlin.md
+++ b/articles/english/2016/Developing Spring Boot applications with Kotlin.kts
@@ -1,12 +1,11 @@
----
-title: Developing Spring Boot applications with Kotlin.
-url: https://spring.io/blog/2016/02/15/developing-spring-boot-applications-with-kotlin
-categories:
- - Kotlin
- - Spring
-author: 'Sébastien Deleuze'
-date: Feb 15, 2016 12:58
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Just in time for [Kotlin 1.0 release](http://blog.jetbrains.com/kotlin/2016/02/kotlin-1-0-released-pragmatic-language-for-jvm-and-android/), we are adding support for Kotlin language to [https://start.spring.io](https://start.spring.io/#!language=kotlin) in order to make it easier to start new Spring Boot projects with this language.
This blog post is also an opportunity for me to explain why I find this language interesting, to show you a sample project in detail and to give you some tips.
@@ -119,7 +118,7 @@ class CustomerController {
### Property placeholders
-`$` is used for [String interpolation](https://kotlinlang.org/docs/reference/basic-types.html#string-templates) in Kotlin, so you should escape it when using property placeholders: `@Value("\${some.property}")`. As an alternative you can also use `@ConfigurationProperties` instead, see [this Stack Overflow](http://stackoverflow.com/a/33883230/1092077) answer for more details.
+`${"$"}` is used for [String interpolation](https://kotlinlang.org/docs/reference/basic-types.html#string-templates) in Kotlin, so you should escape it when using property placeholders: `@Value("\${"$"}{some.property}")`. As an alternative you can also use `@ConfigurationProperties` instead, see [this Stack Overflow](http://stackoverflow.com/a/33883230/1092077) answer for more details.
### Array annotation attribute
@@ -152,3 +151,19 @@ Last tip, the Java to Kotlin converter available in IntelliJ IDEA (Menu Code ->
## Feedbacks
We are interested by your feedbacks about developing Spring applications with Kotlin. This blog post is just an introduction, there is much more to say especially about using Spring Boot with more Kotlin idiomatic code like with [Exposed](https://github.com/JetBrains/Exposed) SQL library, so stay tuned ...
+
+"""
+
+Article(
+ title = "Developing Spring Boot applications with Kotlin.",
+ url = "https://spring.io/blog/2016/02/15/developing-spring-boot-applications-with-kotlin",
+ categories = listOf(
+ "Kotlin",
+ "Spring"
+ ),
+ type = article,
+ lang = EN,
+ author = "Sébastien Deleuze",
+ date = LocalDate.of(2016, 2, 15),
+ body = body
+)
diff --git a/app/rss/articles/Developing a Geospatial Webservice with Kotlin and Spring Boot.md b/articles/english/2016/Developing a Geospatial Webservice with Kotlin and Spring Boot.kts
similarity index 68%
rename from app/rss/articles/Developing a Geospatial Webservice with Kotlin and Spring Boot.md
rename to articles/english/2016/Developing a Geospatial Webservice with Kotlin and Spring Boot.kts
index 6d22cb536..bc05b4819 100644
--- a/app/rss/articles/Developing a Geospatial Webservice with Kotlin and Spring Boot.md
+++ b/articles/english/2016/Developing a Geospatial Webservice with Kotlin and Spring Boot.kts
@@ -1,13 +1,11 @@
----
-title: 'Developing a Geospatial Webservice with Kotlin and Spring Boot'
-url: https://www.youtube.com/watch?v=tTTEiQj4BHA
-type: video
-categories:
- - Kotlin
- - Spring
-author: Sébastien Deleuze
-date: Nov 25, 2016 02:33
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Spring I/O 2016 - 19 -20 May Barcelona
As described in this announcement I made on [Spring blog](https://spring.io/blog/2016/02/15/developing-spring-boot-applications-with-kotlin), it is now easy to create a Spring Boot application using Kotlin.
@@ -23,3 +21,19 @@ That talk will also provide an opportunity to show how to use a relational datab
Update Nov 25 2016: Also see new version of this talk at Spring One Platform
[Developing a Geospatial Webservice with Kotlin and Spring Boot](https://www.infoq.com/presentations/geospatial-kotlin-boot)
+
+"""
+
+Article(
+ title = "Developing a Geospatial Webservice with Kotlin and Spring Boot",
+ url = "https://www.youtube.com/watch?v=tTTEiQj4BHA",
+ categories = listOf(
+ "Kotlin",
+ "Spring"
+ ),
+ type = video,
+ lang = EN,
+ author = "Sébastien Deleuze",
+ date = LocalDate.of(2016, 11, 25),
+ body = body
+)
diff --git a/app/rss/articles/Developing on Android sucks a lot less with Kotlin.md b/articles/english/2016/Developing on Android sucks a lot less with Kotlin.kts
similarity index 92%
rename from app/rss/articles/Developing on Android sucks a lot less with Kotlin.md
rename to articles/english/2016/Developing on Android sucks a lot less with Kotlin.kts
index f312e5356..4749e34cf 100644
--- a/app/rss/articles/Developing on Android sucks a lot less with Kotlin.md
+++ b/articles/english/2016/Developing on Android sucks a lot less with Kotlin.kts
@@ -1,12 +1,11 @@
----
-title: 'Developing on Android sucks a lot less with Kotlin'
-url: https://wiredcraft.com/blog/android-apps-development-kotlin/
-categories:
- - Android
- - Kotlin
-author: Kuno Qing
-date: Mar 01, 2016 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
![Kotlin](https://wiredcraft.com/images/posts/Android-app-development-Kotlin.jpg)
While Android development has improved tremendously in the past few years, many think that it still sucks when compared to iOS. A lot of folks are working hard to make it better, maybe even enjoyable. And [Kotlin](https://kotlinlang.org/), a new programming language, seems to be headed in that direction. Having been brought onboard by Starbucks in China to work on their mobile apps, we've been experimenting with Kotlin as a viable option to improving the UX of the Android app and making it overall more maintainable.
@@ -133,4 +132,19 @@ Kotlin probably isn't as hot in the Android community as Swift is for the iOS wo
Kotlin fixed a lot of the issues we had with developing for Android. There's still room for improvement, but I encourage all of you out there who shared the frustrations of building Android apps to give it a try on your next project.
-And finally, if you're looking for a rock-solid team of nerds and creatives in NYC, Berlin, or Shanghai to work on your next Android or iOS project, [reach out on Twitter](http://twitter.com/wiredcraft) or shoot us an email either [on our site](https://wiredcraft.typeform.com/to/GG4GQz) or at [info@wiredcraft.com](mailto:info@wiredcraft.com).
\ No newline at end of file
+And finally, if you're looking for a rock-solid team of nerds and creatives in NYC, Berlin, or Shanghai to work on your next Android or iOS project, [reach out on Twitter](http://twitter.com/wiredcraft) or shoot us an email either [on our site](https://wiredcraft.typeform.com/to/GG4GQz) or at [info@wiredcraft.com](mailto:info@wiredcraft.com).
+"""
+
+Article(
+ title = "Developing on Android sucks a lot less with Kotlin",
+ url = "https://wiredcraft.com/blog/android-apps-development-kotlin/",
+ categories = listOf(
+ "Android",
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Kuno Qing",
+ date = LocalDate.of(2016, 3, 1),
+ body = body
+)
diff --git a/app/rss/articles/Easy DSL design with Kotlin.md b/articles/english/2016/Easy DSL design with Kotlin.kts
similarity index 87%
rename from app/rss/articles/Easy DSL design with Kotlin.md
rename to articles/english/2016/Easy DSL design with Kotlin.kts
index 2bd0c7eb4..9cf4f7bae 100644
--- a/app/rss/articles/Easy DSL design with Kotlin.md
+++ b/articles/english/2016/Easy DSL design with Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'Easy DSL design with Kotlin'
-url: https://blog.frankel.ch/easy-dsl-design-with-kotlin/
-categories:
- - Kotlin
-author: Nicolas Fränkel
-date: Oct 30, 2016 01:32
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
In Android, every tutorial teaching you the basics describe how to design screen through XML files. It’s also possible to achieve the same result with Java (or any JVM-based language). Android screen design is not the only domain where XML and Java are valid options. For example, Spring configuration and Vaadin screen design allow both. In all those domains, there’s however a trade-off involved: on one hand, XML has a quite rigid structure enforced by an XML-schema while Java gives power to do pretty well anything at the cost of readability. “With great power comes great responsibility”. In the latter case, it’s up to the individual developer to exercise his/her judgement in order to keep the code as readable as possible.
[Domain-Specific Languages](https://en.wikipedia.org/wiki/Domain-specific_language) sit between those two ends of the spectrum, as they offer a structured syntax close to the problem at hand but with the full support of the underlying language constructs when necessary. As an example, the AssertJ library provides a DSL for assertions, using a fluent API. The following snippet is taken from its documentation:
@@ -29,7 +29,7 @@ DSLs can be provided in any language, even if some feel more natural. Scala natu
verticalLayout {
val name = editText()
button("Say Hello") {
- onClick { toast("Hello, ${name.text}!") }
+ onClick { toast("Hello, ${"$"}{name.text}!") }
}
}
```
@@ -81,7 +81,7 @@ Getting back to the [Anko snippet above](#anko), let’s check how the `vertical
```kotlin
inline fun ViewManager.verticalLayout(theme: Int = 0, init: _LinearLayout.() -> Unit): LinearLayout {
- return ankoView(`$Anko$Factories$CustomViews`.VERTICAL_LAYOUT_FACTORY, theme, init)
+ return ankoView(`${"$"}Anko${"$"}Factories${"$"}CustomViews`.VERTICAL_LAYOUT_FACTORY, theme, init)
}
```
@@ -94,3 +94,18 @@ The second paragraph explained what represents the content of the braces: the `i
Hopefully, this post show how easy it is to create DSL with Kotlin thanks to its syntax.
I developed one such DSL to create GUI for the [Vaadin](https://vaadin.com/) framework: the name is Kaadin and the result is [available online](https://nfrankel.github.io/kaadin/).
+
+"""
+
+Article(
+ title = "Easy DSL design with Kotlin",
+ url = "https://blog.frankel.ch/easy-dsl-design-with-kotlin/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Nicolas Fränkel",
+ date = LocalDate.of(2016, 10, 30),
+ body = body
+)
diff --git a/app/rss/articles/Exercises in Kotlin Part 1 - Getting Started.md b/articles/english/2016/Exercises in Kotlin Part 1 - Getting Started.kts
similarity index 95%
rename from app/rss/articles/Exercises in Kotlin Part 1 - Getting Started.md
rename to articles/english/2016/Exercises in Kotlin Part 1 - Getting Started.kts
index 6013ef345..f91572e6e 100644
--- a/app/rss/articles/Exercises in Kotlin Part 1 - Getting Started.md
+++ b/articles/english/2016/Exercises in Kotlin Part 1 - Getting Started.kts
@@ -1,11 +1,11 @@
----
-title: 'Exercises in Kotlin: Part 1 - Getting Started'
-url: http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-1-getting-started/
-categories:
- - Kotlin
-author: Dhananjay Nene
-date: Apr 18, 2016 05:32
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Kotlin is an exciting new language I have been working with for a couple of months now. I believe it has a lot of features going for it, and I think many will be benefited from learning a bit more about it. Hence this series of posts.
This post helps you with getting the necessary software installed on your desktop for compiling and running kotlin code
@@ -148,7 +148,7 @@ Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/jvm/internal/I
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
- at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
+ at sun.misc.Launcher${"$"}AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
```
@@ -229,3 +229,18 @@ Hello World!
```
Congratulations you are now able to compile and run Kotlin programs. In the next post in this series, we shall attempt to understand the code that we just wrote, and explore the Kotlin language further.
+
+"""
+
+Article(
+ title = "Exercises in Kotlin: Part 1 - Getting Started",
+ url = "http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-1-getting-started/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Dhananjay Nene",
+ date = LocalDate.of(2016, 4, 18),
+ body = body
+)
diff --git a/app/rss/articles/Exercises in Kotlin Part 2 - High level syntax and Variables.md b/articles/english/2016/Exercises in Kotlin Part 2 - High level syntax and Variables.kts
similarity index 89%
rename from app/rss/articles/Exercises in Kotlin Part 2 - High level syntax and Variables.md
rename to articles/english/2016/Exercises in Kotlin Part 2 - High level syntax and Variables.kts
index e3601a6c3..571eb507c 100644
--- a/app/rss/articles/Exercises in Kotlin Part 2 - High level syntax and Variables.md
+++ b/articles/english/2016/Exercises in Kotlin Part 2 - High level syntax and Variables.kts
@@ -1,11 +1,11 @@
----
-title: 'Exercises in Kotlin: Part 2 - High level syntax and Variables'
-url: http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-2-high-level-syntax-and-variables/
-categories:
- - Kotlin
-author: Dhananjay Nene
-date: Apr 19, 2016 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
This post first discusses the code that was written so far in the last post, [Exercises in Kotlin: Part 1 - Getting Started](http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-1-getting-started/). Subsequently it focuses on the basic syntax of variables, discusses a bit about packaging and also about Type Inference
## A review of code so far
@@ -82,9 +82,9 @@ fun main(args: Array) {
var radius: Double = 1.0
val increment = 1
// increment = increment + 1 <-- will not compile since increment is a val
- println("The radius of a circle with radius ${radius} is ${circleArea(radius)}")
+ println("The radius of a circle with radius ${"$"}{radius} is ${"$"}{circleArea(radius)}")
radius = radius + increment
- println("The radius of a circle with radius ${radius} is ${circleArea(radius)}")
+ println("The radius of a circle with radius ${"$"}{radius} is ${"$"}{circleArea(radius)}")
}
```
@@ -123,7 +123,7 @@ Note the following:
#### String templates
-* String interpolation is supported by allowing expressions to be embedded in strings using the ${`expr`} syntax as in the arguments to `println()`. This feature is called string templates in Kotlinspeak
+* String interpolation is supported by allowing expressions to be embedded in strings using the ${"$"}{`expr`} syntax as in the arguments to `println()`. This feature is called string templates in Kotlinspeak
## (Optional) Some more advanced aspects about variables
@@ -148,12 +148,12 @@ val area: Double
fun main(args: Array) {
var radius = 1.0
val increment = 1
- println("The radius of a circle with radius ${radius} is ${circleArea(radius)}")
+ println("The radius of a circle with radius ${"$"}{radius} is ${"$"}{circleArea(radius)}")
radius = radius + increment
- println("The radius of a circle with radius ${radius} is ${circleArea(radius)}")
- println("The radius of a circle with radius 5.0 is ${area}")
+ println("The radius of a circle with radius ${"$"}{radius} is ${"$"}{circleArea(radius)}")
+ println("The radius of a circle with radius 5.0 is ${"$"}{area}")
defaultRadius = 6.0
- println("The radius of a circle with radius 6.0 is ${area}")
+ println("The radius of a circle with radius 6.0 is ${"$"}{area}")
}
```
@@ -174,3 +174,18 @@ Things to be noted.
* _package namespaces and visibility_: Just like top level functions, you can also have top level variables/constants being declared. Also note that all the standalone functions get declared in the namespace of the package. So if you have multiple files with the same package and also same function (or top level variable) names, that will be treated as an error since one of them will end up attempting to redeclare the other. On the other hand if you declare a top level variable as private, it is not private to that package namespace, but is instead treated as private within a file
We shall be reviewing functions in the next post [Exercises in Kotlin: Part 3 - Functions](http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-3-functions/)
+
+"""
+
+Article(
+ title = "Exercises in Kotlin: Part 2 - High level syntax and Variables",
+ url = "http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-2-high-level-syntax-and-variables/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Dhananjay Nene",
+ date = LocalDate.of(2016, 4, 19),
+ body = body
+)
diff --git a/app/rss/articles/Exercises in Kotlin Part 3 - Functions.md b/articles/english/2016/Exercises in Kotlin Part 3 - Functions.kts
similarity index 96%
rename from app/rss/articles/Exercises in Kotlin Part 3 - Functions.md
rename to articles/english/2016/Exercises in Kotlin Part 3 - Functions.kts
index fbc6a863f..d2f83eb75 100644
--- a/app/rss/articles/Exercises in Kotlin Part 3 - Functions.md
+++ b/articles/english/2016/Exercises in Kotlin Part 3 - Functions.kts
@@ -1,11 +1,11 @@
----
-title: 'Exercises in Kotlin: Part 3 - Functions'
-url: http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-3-functions/
-categories:
- - Kotlin
-author: Dhananjay Nene
-date: Apr 20, 2016 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
We looked at a bit of syntax and variable declarations in the last post [Exercises in Kotlin: Part 2 - High level syntax and Variables](http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-2-high-level-syntax-and-variables/). We explore functions in this post. Here's how a typical function in Kotlin would look like.
```kotlin
@@ -282,3 +282,18 @@ inline fun doubleAndThen(n: Int, noinline then: (Int) -> Int): Int = then(n * 2)
If a function is inlined, then the lambdas passed to it are allowed to have a `return`
The next post in the series is [Exercises in Kotlin: Part 4 - Control flows and return](http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-4-control-flows-and-return/)
+
+"""
+
+Article(
+ title = "Exercises in Kotlin: Part 3 - Functions",
+ url = "http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-3-functions/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Dhananjay Nene",
+ date = LocalDate.of(2016, 4, 20),
+ body = body
+)
diff --git a/app/rss/articles/Exercises in Kotlin Part 4 - Control flows and return.md b/articles/english/2016/Exercises in Kotlin Part 4 - Control flows and return.kts
similarity index 91%
rename from app/rss/articles/Exercises in Kotlin Part 4 - Control flows and return.md
rename to articles/english/2016/Exercises in Kotlin Part 4 - Control flows and return.kts
index 77a4a3755..596e1a102 100644
--- a/app/rss/articles/Exercises in Kotlin Part 4 - Control flows and return.md
+++ b/articles/english/2016/Exercises in Kotlin Part 4 - Control flows and return.kts
@@ -1,11 +1,11 @@
----
-title: 'Exercises in Kotlin: Part 4 - Control flows and return'
-url: http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-4-control-flows-and-return/
-categories:
- - Kotlin
-author: Dhananjay Nene
-date: Apr 27, 2016 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
After [Exercises in Kotlin: Part 3 - Functions](http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-3-functions/) we now take a look at control flows and actually doing some basic exercises.
## if/else
@@ -175,7 +175,7 @@ fun sundaysInTwentiethCentury(): Int {
year % 4 == 0 -> 29
else -> 28
}
- else -> throw Exception("Invalid Month ${month}")
+ else -> throw Exception("Invalid Month ${"$"}{month}")
}
fun daysInYear(year: Int): Int {
var days = 0
@@ -196,3 +196,18 @@ fun sundaysInTwentiethCentury(): Int {
return totalSundays
}
```
+
+"""
+
+Article(
+ title = "Exercises in Kotlin: Part 4 - Control flows and return",
+ url = "http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-4-control-flows-and-return/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Dhananjay Nene",
+ date = LocalDate.of(2016, 4, 27),
+ body = body
+)
diff --git a/app/rss/articles/Exercises in Kotlin Part 5 - Classes.md b/articles/english/2016/Exercises in Kotlin Part 5 - Classes.kts
similarity index 95%
rename from app/rss/articles/Exercises in Kotlin Part 5 - Classes.md
rename to articles/english/2016/Exercises in Kotlin Part 5 - Classes.kts
index 92d753daa..1b0e1b24f 100644
--- a/app/rss/articles/Exercises in Kotlin Part 5 - Classes.md
+++ b/articles/english/2016/Exercises in Kotlin Part 5 - Classes.kts
@@ -1,11 +1,11 @@
----
-title: 'Exercises in Kotlin: Part 5 - Classes'
-url: http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-5-classes/
-categories:
- - Kotlin
-author: Dhananjay Nene
-date: Apr 29, 2016 00:00
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
After the last post [Exercises in Kotlin: Part 4 - Control flows and return](http://dnblog.ddesk/2016/04/exercises-in-kotlin-part-4-control-flows-and-return/), we shall be exploring classes and objects in the exercises in this post. While retaining many similarities to Java classes, there are actually significant differences in syntax as well and these help classes become a little easier to work with in Kotlin. And save a lot of unnecessary boilerplate code.
## Minimalist Syntax
@@ -281,3 +281,18 @@ enum class Color(r: Int, g: Int, b: Int) {
```
We have looked at the basics of classes in this post. We will look at inheritance next.
+
+"""
+
+Article(
+ title = "Exercises in Kotlin: Part 5 - Classes",
+ url = "http://blog.dhananjaynene.com/2016/04/exercises-in-kotlin-part-5-classes/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Dhananjay Nene",
+ date = LocalDate.of(2016, 4, 29),
+ body = body
+)
diff --git a/app/rss/articles/Experimental Kotlin and mutation testing.md b/articles/english/2016/Experimental Kotlin and mutation testing.kts
similarity index 84%
rename from app/rss/articles/Experimental Kotlin and mutation testing.md
rename to articles/english/2016/Experimental Kotlin and mutation testing.kts
index 58f0d8d6f..aeb5b3c45 100644
--- a/app/rss/articles/Experimental Kotlin and mutation testing.md
+++ b/articles/english/2016/Experimental Kotlin and mutation testing.kts
@@ -1,13 +1,11 @@
----
-title: 'Experimental: Kotlin and mutation testing'
-url: https://blog.frankel.ch/experimental-kotlin-mutation-testing
-categories:
- - Testing
- - Mutation Testing
- - Kotlin
-author: Nicolas Frankel
-date: Apr 03, 2016 15:36
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LanguageCodes.EN
+import link.kotlin.scripts.LinkType.article
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
[![](https://blog.frankel.ch/wp-content/resources/experimental-kotlin-mutation-testing/icon_Kotlin.png)](https://kotlinlang.org/)Since about a year and a half, I do a [lot](https://player.vimeo.com/video/105758362) [of](https://youtu.be/uC_8l69ArXs) [presentations](https://youtu.be/biLyXaJwO3c) on [Mutation Testing](https://en.wikipedia.org/wiki/Mutation_testing). In those, my point is to show that [Code Coverage](https://en.wikipedia.org/wiki/Code_coverage)‘s only benefit is that it’s easy to compute but that it’s meaningless – hence Mutation Testing.
Since some time, I’ve been interested in [Kotlin](http://kotlinlang.org), a language from JetBrains that runs on the JVM. It’s only natural that I wanted to check how Mutation Testing could be applied to the Kotlin language. As Kotlin is too young to have its own dedicated mutation testing tool, I used [Pit](http://pitest.org), a Java dedicated tool. I didn’t expected much, here are my findings.
@@ -50,7 +48,7 @@ Here’s a sample of the report:
Again, Pit is able to bind the real lines to the problems found. Isn’t life good? If you stop at this point, it probably is. But running Pit on another project – say, ktor-features/ktor-locations fails miserably.
```
-The class org.jetbrains.ktor.locations.Locations$WhenMappings does not contain a source debug information. All classes must be compiled with source and line number debug information
+The class org.jetbrains.ktor.locations.Locations${"$"}WhenMappings does not contain a source debug information. All classes must be compiled with source and line number debug information
```
It seems using the `when` construct in Kotlin generates an inner class that doesn’t contain debug information, which Pit need to works its magic. Let’s exclude the offending class and its inner mappings class:
@@ -64,3 +62,20 @@ It works again and produces expected results:
![](https://blog.frankel.ch/wp-content/resources/experimental-kotlin-mutation-testing/conversionservice.png)
There are no mutation testing tools for Kotlin (yet), and considering Java ecosystem’s history, there might never be one. However, mutation testing is an invaluable tool to assert the real quality of your tests. Even if Pit is not a perfect match for Kotlin, it would be foolish to discard it.
+
+"""
+
+Article(
+ title = "Experimental: Kotlin and mutation testing",
+ url = "https://blog.frankel.ch/experimental-kotlin-mutation-testing",
+ categories = listOf(
+ "Testing",
+ "Mutation Testing",
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Nicolas Frankel",
+ date = LocalDate.of(2016, 4, 3),
+ body = body
+)
diff --git a/app/rss/articles/Experimenting with mutation testing and Kotlin.md b/articles/english/2016/Experimenting with mutation testing and Kotlin.kts
similarity index 87%
rename from app/rss/articles/Experimenting with mutation testing and Kotlin.md
rename to articles/english/2016/Experimenting with mutation testing and Kotlin.kts
index 726460e1e..9bbe33924 100644
--- a/app/rss/articles/Experimenting with mutation testing and Kotlin.md
+++ b/articles/english/2016/Experimenting with mutation testing and Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'Experimenting with “mutation testing” and Kotlin'
-url: https://medium.com/@s4n1ty/experimenting-with-mutation-testing-and-kotlin-b515d77e85b5#.9ps78uqer
-categories:
- - Kotlin
-author: Ian Clarke
-date: Oct 16, 2016 11:30
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
The most common approach to measuring how comprehensive your unit tests are is to look at “code coverage”, literally the number of lines of your code that are executed by your unit tests.
While this isn’t a bad approach, it really only tests what code is executed by your tests, it doesn’t directly measure their ability to detect bugs in your code, which is their purpose. You could easily write unit tests that execute every line of code, and yet will pass regardless of what your code actually does.
@@ -45,3 +45,18 @@ If you mouseover this you can see that reversing the condition (>= becomes <=) d
Every instance where a code mutation doesn’t result in a unit test failure prompts an interesting train of thought about why not. Is it because the code is unimportant (like a toString() method only really used for debugging)? Is it because the change is too subtle and the difference in code behavior is unimportant? Or is it something that should really have been tested? This is a very healthy thought process if you really care about the correctness of your code.
If I was working on code where I needed a very high degree of reliability, I think mutation coverage is an excellent way to ensure that your unit tests are effective, and at pointing out areas where they might require further work.
+
+"""
+
+Article(
+ title = "Experimenting with “mutation testing” and Kotlin",
+ url = "https://medium.com/@s4n1ty/experimenting-with-mutation-testing-and-kotlin-b515d77e85b5#.9ps78uqer",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "Ian Clarke",
+ date = LocalDate.of(2016, 10, 16),
+ body = body
+)
diff --git a/app/rss/articles/Exploring Delegation in Kotlin.md b/articles/english/2016/Exploring Delegation in Kotlin.kts
similarity index 88%
rename from app/rss/articles/Exploring Delegation in Kotlin.md
rename to articles/english/2016/Exploring Delegation in Kotlin.kts
index 0c4050c76..278737b4d 100644
--- a/app/rss/articles/Exploring Delegation in Kotlin.md
+++ b/articles/english/2016/Exploring Delegation in Kotlin.kts
@@ -1,11 +1,11 @@
----
-title: 'Exploring Delegation in Kotlin'
-url: http://codemonkeyism.com/exploring-delegation-in-kotlin/
-categories:
- - Kotlin
-author: '@codemonkeyism'
-date: Apr 04, 2016 09:49
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
I’m a huge fan of interfaces in Java and also of composition over inheritance. Inheritance is some magic wiring with tight coupling that creates lots of friction when evolving a code base. I’ve written about interfaces before several times, for example [here](http://codemonkeyism.com/how-to-improve-programming-with-interfaces/) or [here](http://codemonkeyism.com/generation-java-programming-style/). Looking at Kotlin I wanted to see what I can do with interfaces and composition.
Take this example:
@@ -134,3 +134,18 @@ class Person(n:String): HasName {
```
where I have access to name and more control over it. It would also be nice to have a way to access other Mixins from a Mixin. But overall, some nice functionality in Kotlin.
+
+"""
+
+Article(
+ title = "Exploring Delegation in Kotlin",
+ url = "http://codemonkeyism.com/exploring-delegation-in-kotlin/",
+ categories = listOf(
+ "Kotlin"
+ ),
+ type = article,
+ lang = EN,
+ author = "@codemonkeyism",
+ date = LocalDate.of(2016, 4, 4),
+ body = body
+)
diff --git a/app/rss/articles/Exploring an Either Monad in Kotlin.md b/articles/english/2016/Exploring an Either Monad in Kotlin.kts
similarity index 91%
rename from app/rss/articles/Exploring an Either Monad in Kotlin.md
rename to articles/english/2016/Exploring an Either Monad in Kotlin.kts
index 82aad55da..077139ac7 100644
--- a/app/rss/articles/Exploring an Either Monad in Kotlin.md
+++ b/articles/english/2016/Exploring an Either Monad in Kotlin.kts
@@ -1,12 +1,11 @@
----
-title: 'Exploring an Either Monad in Kotlin'
-url: https://blog.exallium.com/exploring-an-either-monad-in-kotlin-92618b9c4623#.nlt1cxd96
-categories:
- - Kotlin
- - FP
-author: Alex Hart
-date: Nov 22, 2016 11:11
----
+
+import link.kotlin.scripts.Article
+import link.kotlin.scripts.LinkType.*
+import link.kotlin.scripts.LanguageCodes.*
+import java.time.LocalDate
+
+// language=Markdown
+val body = """
Recently, I was enlightened. I finally, fully grasped how the Either Monad works. At least I think I do. In this post, I am looking to report my findings, both for the education of others of this powerful tool, as well as to see if my understanding of this monadic concept really holds water.
### What’s an Either Monad?
@@ -32,11 +31,11 @@ An example, written in Kotlin:
```kotlin
sealed class Either {
class Left(val l: L) : Either() {
- override fun toString(): String = "Left $l"
+ override fun toString(): String = "Left ${"$"}l"
}
class Right(val r: R) : Either() {
- override fun toString(): String = "Right $r"
+ override fun toString(): String = "Right ${"$"}r"
}
infix fun