Inform users about the newly available Corda training programs at startup and in the docsite.

This commit is contained in:
Mike Hearn 2017-02-28 16:29:21 +01:00
parent df6b9add6e
commit cc61be5b6a
4 changed files with 18 additions and 6 deletions

View File

@ -19,7 +19,8 @@ object Emoji {
@JvmStatic val CODE_PAPERCLIP: String = codePointsString(0x1F4CE) @JvmStatic val CODE_PAPERCLIP: String = codePointsString(0x1F4CE)
@JvmStatic val CODE_COOL_GUY: String = codePointsString(0x1F60E) @JvmStatic val CODE_COOL_GUY: String = codePointsString(0x1F60E)
@JvmStatic val CODE_NO_ENTRY: String = codePointsString(0x1F6AB) @JvmStatic val CODE_NO_ENTRY: String = codePointsString(0x1F6AB)
@JvmStatic val SKULL_AND_CROSSBONES: String = codePointsString(0x2620) @JvmStatic val CODE_SKULL_AND_CROSSBONES: String = codePointsString(0x2620)
@JvmStatic val CODE_BOOKS: String = codePointsString(0x1F4DA)
/** /**
* When non-null, toString() methods are allowed to use emoji in the output as we're going to render them to a * When non-null, toString() methods are allowed to use emoji in the output as we're going to render them to a
@ -35,6 +36,7 @@ object Emoji {
val leftArrow: String get() = if (emojiMode.get() != null) "$CODE_LEFT_ARROW " else "" val leftArrow: String get() = if (emojiMode.get() != null) "$CODE_LEFT_ARROW " else ""
val paperclip: String get() = if (emojiMode.get() != null) "$CODE_PAPERCLIP " else "" val paperclip: String get() = if (emojiMode.get() != null) "$CODE_PAPERCLIP " else ""
val coolGuy: String get() = if (emojiMode.get() != null) "$CODE_COOL_GUY " else "" val coolGuy: String get() = if (emojiMode.get() != null) "$CODE_COOL_GUY " else ""
val books: String get() = if (emojiMode.get() != null) "$CODE_BOOKS " else ""
inline fun <T> renderIfSupported(body: () -> T): T { inline fun <T> renderIfSupported(body: () -> T): T {
emojiMode.set(this) // Could be any object. emojiMode.set(this) // Could be any object.

View File

@ -13,6 +13,8 @@ is the `Introduction to Corda webinar <https://vimeo.com/192757743/c2ec39c1e1>`_
they become more familiar with Corda, readers with a technical background will also want to dive into the `Technical white paper`_, they become more familiar with Corda, readers with a technical background will also want to dive into the `Technical white paper`_,
which describes the platform's envisioned end-state. which describes the platform's envisioned end-state.
.. note:: Corda training is now available in London, New York and Singapore! `Learn more. <https://www.corda.net/corda-training/>`_
Corda is designed so that developers can easily extend its functionality by writing CorDapps Corda is designed so that developers can easily extend its functionality by writing CorDapps
(**Cor**\ da **D**\ istributed **App**\ lication\ **s**\ ). Some example CorDapps are available in the Corda repo's (**Cor**\ da **D**\ istributed **App**\ lication\ **s**\ ). Some example CorDapps are available in the Corda repo's
`samples <https://github.com/corda/corda/tree/master/samples>`_ directory. To run these yourself, make `samples <https://github.com/corda/corda/tree/master/samples>`_ directory. To run these yourself, make

View File

@ -164,14 +164,21 @@ private fun drawBanner() {
// This line makes sure ANSI escapes work on Windows, where they aren't supported out of the box. // This line makes sure ANSI escapes work on Windows, where they aren't supported out of the box.
AnsiConsole.systemInstall() AnsiConsole.systemInstall()
val (msg1, msg2) = Emoji.renderIfSupported { messageOfTheDay() } Emoji.renderIfSupported {
val (msg1, msg2) = messageOfTheDay()
println(Ansi.ansi().fgBrightRed().a( println(Ansi.ansi().fgBrightRed().a(
""" """
______ __ ______ __
/ ____/ _________/ /___ _ / ____/ _________/ /___ _
/ / __ / ___/ __ / __ `/ """).fgBrightBlue().a(msg1).newline().fgBrightRed().a( / / __ / ___/ __ / __ `/ """).fgBrightBlue().a(msg1).newline().fgBrightRed().a(
"/ /___ /_/ / / / /_/ / /_/ / ").fgBrightBlue().a(msg2).newline().fgBrightRed().a( "/ /___ /_/ / / / /_/ / /_/ / ").fgBrightBlue().a(msg2).newline().fgBrightRed().a(
"""\____/ /_/ \__,_/\__,_/""").reset().newline().newline().fgBrightDefault().bold(). """\____/ /_/ \__,_/\__,_/""").reset().newline().newline().fgBrightDefault().bold().
a("--- DEVELOPER SNAPSHOT ------------------------------------------------------------").newline().reset()) a("--- MILESTONE 9 -------------------------------------------------------------------").
newline().
newline().
a("${Emoji.books}New! ").reset().a("Training now available worldwide, see https://corda.net/corda-training/").
newline().
reset())
}
} }

View File

@ -3,7 +3,7 @@ package net.corda.node.utilities
import net.corda.core.utilities.Emoji.CODE_GREEN_TICK import net.corda.core.utilities.Emoji.CODE_GREEN_TICK
import net.corda.core.utilities.Emoji.CODE_NO_ENTRY import net.corda.core.utilities.Emoji.CODE_NO_ENTRY
import net.corda.core.utilities.Emoji.CODE_RIGHT_ARROW import net.corda.core.utilities.Emoji.CODE_RIGHT_ARROW
import net.corda.core.utilities.Emoji.SKULL_AND_CROSSBONES import net.corda.core.utilities.Emoji.CODE_SKULL_AND_CROSSBONES
import net.corda.core.utilities.ProgressTracker import net.corda.core.utilities.ProgressTracker
import net.corda.node.utilities.ANSIProgressRenderer.progressTracker import net.corda.node.utilities.ANSIProgressRenderer.progressTracker
import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.LogManager
@ -128,7 +128,8 @@ object ANSIProgressRenderer {
var newLinesDrawn = 1 + pt.renderLevel(ansi, 0, error != null) var newLinesDrawn = 1 + pt.renderLevel(ansi, 0, error != null)
if (error != null) { if (error != null) {
ansi.a("$SKULL_AND_CROSSBONES $error") // TODO: This should be using emoji only on supported platforms.
ansi.a("$CODE_SKULL_AND_CROSSBONES $error")
ansi.eraseLine(Ansi.Erase.FORWARD) ansi.eraseLine(Ansi.Erase.FORWARD)
ansi.newline() ansi.newline()
newLinesDrawn++ newLinesDrawn++