From 297b658e55a60253e5addc73a12d96a1a5e031a7 Mon Sep 17 00:00:00 2001 From: Heather Miller Date: Fri, 28 Jul 2017 00:42:36 +0200 Subject: [PATCH] Cheatsheets finished --- {ba => _ba}/cheatsheets/index.md | 8 +++--- _config.yml | 3 +++ _data/doc-nav-header.yml | 6 ++--- _data/docnames.yml | 3 +++ {fr => _fr}/cheatsheets/index.md | 8 +++--- {ja => _ja}/cheatsheets/index.md | 9 ++++--- _layouts/cheatsheet.html | 25 ++++++++++++++++++- .../cheatsheets}/index.md | 7 +++++- {pl => _pl}/cheatsheets/index.md | 8 +++--- {pt-br => _pt-br}/cheatsheets/index.md | 8 +++--- {zh-cn => _zh-cn}/cheatsheets/index.md | 13 +++++----- 11 files changed, 72 insertions(+), 26 deletions(-) rename {ba => _ba}/cheatsheets/index.md (97%) rename {fr => _fr}/cheatsheets/index.md (97%) rename {ja => _ja}/cheatsheets/index.md (98%) rename {cheatsheets => _overviews/cheatsheets}/index.md (99%) rename {pl => _pl}/cheatsheets/index.md (97%) rename {pt-br => _pt-br}/cheatsheets/index.md (97%) rename {zh-cn => _zh-cn}/cheatsheets/index.md (97%) diff --git a/ba/cheatsheets/index.md b/_ba/cheatsheets/index.md similarity index 97% rename from ba/cheatsheets/index.md rename to _ba/cheatsheets/index.md index e336e31a23..0a7e59790f 100644 --- a/ba/cheatsheets/index.md +++ b/_ba/cheatsheets/index.md @@ -1,16 +1,18 @@ --- layout: cheatsheet -istranslation: true title: Scalacheat + +partof: cheatsheet + by: Brendan O'Connor about: Zahvaljujući Brendan O'Connoru ovaj cheatsheet teži da bude kratki pregled sintakse Scale. Licenca pripada Brendan O'Connor-u, pod CC-BY-SA 3.0 licencom. + language: ba --- ###### Doprinio {{ page.by }} +{{ page.about }} -| | | -| ------ | ------ | | varijable | | | `var x = 5` | varijabla. | | Dobro `val x = 5`
Loše `x=6` | konstanta. | diff --git a/_config.yml b/_config.yml index 34430c308e..5ac67b2191 100644 --- a/_config.yml +++ b/_config.yml @@ -63,6 +63,9 @@ collections: zh-tw: # Taiwanese translations output: true permalink: /:collection/:path.html + fr: # French translations + output: true + permalink: /:collection/:path.html defaults: - diff --git a/_data/doc-nav-header.yml b/_data/doc-nav-header.yml index 514c8fbc68..086d0a6924 100644 --- a/_data/doc-nav-header.yml +++ b/_data/doc-nav-header.yml @@ -13,9 +13,9 @@ - title: Getting Started url: http://google.com - title: Tour of Scala - url: http://google.com + url: "/tour/tour-of-scala.html" - title: Scala for Java Programmers - url: http://google.com + url: "/tutorials/scala-for-java-programmers.html" - title: Reference url: "#!" submenu: @@ -28,7 +28,7 @@ - title: Style Guide url: "/style/index.html" - title: Cheatsheet - url: https://www.scala-lang.org/contribute/ + url: "/cheatsheets/index.html" - title: Glossary url: "/glossary/index.html" - title: SIPs diff --git a/_data/docnames.yml b/_data/docnames.yml index 3511026f14..7a8ddf97b9 100644 --- a/_data/docnames.yml +++ b/_data/docnames.yml @@ -3,3 +3,6 @@ scala-tour: futures: name: "Futures" + +cheatsheet: + name: "Scala Cheatsheet" diff --git a/fr/cheatsheets/index.md b/_fr/cheatsheets/index.md similarity index 97% rename from fr/cheatsheets/index.md rename to _fr/cheatsheets/index.md index d6a828a6d6..9cb47c6f8d 100644 --- a/fr/cheatsheets/index.md +++ b/_fr/cheatsheets/index.md @@ -1,16 +1,18 @@ --- layout: cheatsheet -istranslation: true title: Scalacheat + +partof: cheatsheet + by: Brendan O'Connor about: Grâce à Brendan O'Connor, ce memento vise à être un guide de référence rapide pour les constructions syntaxiques en Scala. Licencié par Brendan O'Connor sous licence CC-BY-SA 3.0. + language: fr --- ###### Contribué par {{ page.by }} +{{ page.about }} -| | | -| ------ | ------ | | variables | | | `var x = 5` | variable | | Good `val x = 5`
Bad `x=6` | constante | diff --git a/ja/cheatsheets/index.md b/_ja/cheatsheets/index.md similarity index 98% rename from ja/cheatsheets/index.md rename to _ja/cheatsheets/index.md index 605ea191b1..b133ef48e4 100644 --- a/ja/cheatsheets/index.md +++ b/_ja/cheatsheets/index.md @@ -1,16 +1,19 @@ --- layout: cheatsheet -istranslation: true title: Scalacheat + +partof: cheatsheet + by: Kenji Ohtsuka about: Thanks to Brendan O'Connor. このチートシートは Scala 構文 のクイックリファレンスとして作成されました。 Licensed by Brendan O'Connor under a CC-BY-SA 3.0 license. + language: ja --- ###### Contributed by {{ page.by }} +{{ page.about }} + -| | | -| ------ | ------ | | 変数 | | | `var x = 5` | 変数 | | Good `val x = 5`
Bad `x=6` | 定数 | diff --git a/_layouts/cheatsheet.html b/_layouts/cheatsheet.html index d3796ae2e6..3e6e9cd3ec 100644 --- a/_layouts/cheatsheet.html +++ b/_layouts/cheatsheet.html @@ -1,5 +1,5 @@ --- -layout: inner-page-parent +layout: inner-page-parent-dropdown ---
@@ -7,6 +7,29 @@
{{content}} + {% if page.languages %} + + {% elsif page.language %} + {% assign engPath = page.id | remove_first: "/" | remove_first: page.language | append: '.html' %} + {% assign engPg = site.overviews | where: 'partof', page.partof | first %} + {{ engPg.languages }} + + {% endif %}
diff --git a/cheatsheets/index.md b/_overviews/cheatsheets/index.md similarity index 99% rename from cheatsheets/index.md rename to _overviews/cheatsheets/index.md index 99c2c2380e..f069308031 100644 --- a/cheatsheets/index.md +++ b/_overviews/cheatsheets/index.md @@ -1,9 +1,14 @@ --- layout: cheatsheet title: Scalacheat + +partof: cheatsheet + by: Brendan O'Connor about: Thanks to Brendan O'Connor, this cheatsheet aims to be a quick reference of Scala syntactic constructions. Licensed by Brendan O'Connor under a CC-BY-SA 3.0 license. -languages: [ba, fr, ja, pl, pt-br] + +languages: [ba, fr, ja, pl, pt-br, zh-cn] +permalink: /cheatsheets/index.html --- diff --git a/pl/cheatsheets/index.md b/_pl/cheatsheets/index.md similarity index 97% rename from pl/cheatsheets/index.md rename to _pl/cheatsheets/index.md index 37201bcf85..96b924cc4e 100644 --- a/pl/cheatsheets/index.md +++ b/_pl/cheatsheets/index.md @@ -1,16 +1,18 @@ --- layout: cheatsheet -istranslation: true title: Scalacheat + +partof: cheatsheet + by: Filip Czaplicki about: Podziękowania dla Brendan O'Connor. Ten cheatsheet ma być szybkim podsumowaniem konstrukcji składniowych Scali. Licencjonowany przez Brendan O'Connor pod licencją CC-BY-SA 3.0. + language: pl --- ###### Contributed by {{ page.by }} +{{ page.about }} -| | | -| ------ | ------ | | zmienne | | | `var x = 5` | zmienna | | Dobrze `val x = 5`
Źle `x=6` | stała | diff --git a/pt-br/cheatsheets/index.md b/_pt-br/cheatsheets/index.md similarity index 97% rename from pt-br/cheatsheets/index.md rename to _pt-br/cheatsheets/index.md index 9ae93150df..5d3176bda0 100644 --- a/pt-br/cheatsheets/index.md +++ b/_pt-br/cheatsheets/index.md @@ -1,16 +1,18 @@ --- layout: cheatsheet -istranslation: true title: Scalacheat + +partof: cheatsheet + by: Reginaldo Russinholi about: Agradecimentos a Brendan O'Connor, este 'cheatsheet' se destina a ser uma referência rápida às construções sintáticas de Scala. Licenciado por Brendan O'Connor sobre a licença CC-BY-SA 3.0. + language: pt-br --- ###### Contribuição de {{ page.by }} +{{ page.about }} -| | | -| ------ | ------ | | variáveis | | | `var x = 5` | variável | | Bom `val x = 5`
Ruim `x=6` | constante | diff --git a/zh-cn/cheatsheets/index.md b/_zh-cn/cheatsheets/index.md similarity index 97% rename from zh-cn/cheatsheets/index.md rename to _zh-cn/cheatsheets/index.md index 156103e494..0559d37acd 100644 --- a/zh-cn/cheatsheets/index.md +++ b/_zh-cn/cheatsheets/index.md @@ -1,16 +1,19 @@ --- layout: cheatsheet -istranslation: true title: Scalacheat + +partof: cheatsheet + by: Brendan O'Connor about: 感谢 Brendan O'Connor, 本速查表可以用于快速地查找Scala语法结构。Licensed by Brendan O'Connor under a CC-BY-SA 3.0 license. -languages: [zh-cn] + +language: "zh-cn" --- ###### Contributed by {{ page.by }} +{{ page.about }} + -| | | -| ------ | ------ | | 变量 | | |  `var x = 5`                                                                                             | 可变量       | | Good `val x = 5`
Bad `x=6` | 常量 | @@ -84,5 +87,3 @@ languages: [zh-cn] | `x.isInstanceOf[String]` | 类型检查 (运行时) | | `x.asInstanceOf[String]` | 类型强制转换 (运行时) | | `x: String` | 归属 (编译时) | - -