From 3d0d1d2d5dcf110da710820695302b23fe2537ec Mon Sep 17 00:00:00 2001 From: Max Rosenbaum Date: Fri, 4 Feb 2022 09:15:43 +1100 Subject: [PATCH 1/3] Updates to getting started documentation. --- app/controllers/Application.scala | 17 +----- app/views/gettingStarted.scala.html | 94 ----------------------------- public/markdown/getting-started.md | 43 +++++++++++++ 3 files changed, 46 insertions(+), 108 deletions(-) delete mode 100644 app/views/gettingStarted.scala.html create mode 100644 public/markdown/getting-started.md diff --git a/app/controllers/Application.scala b/app/controllers/Application.scala index 1e34c0ec..22c2f1f3 100644 --- a/app/controllers/Application.scala +++ b/app/controllers/Application.scala @@ -81,20 +81,9 @@ class Application @Inject()( MovedPermanently(routes.Application.gettingStarted.path) } - def gettingStarted = Action.async { implicit request => - exampleProjectsService.cached() match { - case Some(cached) => - val examples = toExamples(cached) - Future.successful { - Ok(html.gettingStarted(examples)) - } - case None => - exampleProjectsService.examples().map { live => - val examples = toExamples(live) - Ok(html.gettingStarted(examples)) - } - } - } + def gettingStarted = markdownAction("public/markdown/getting-started.md", { implicit request => markdown => + views.html.markdownPage("Community process", markdown) + }) def allreleases(platform: Option[String] = None) = Action { implicit request => val selectedPlatform = Platform(platform.orElse(request.headers.get("User-Agent"))) diff --git a/app/views/gettingStarted.scala.html b/app/views/gettingStarted.scala.html deleted file mode 100644 index 0cdf5efb..00000000 --- a/app/views/gettingStarted.scala.html +++ /dev/null @@ -1,94 +0,0 @@ -@import controllers.documentation.ReverseRouter -@(examples: PlayExamples)(implicit requestHeader: RequestHeader, reverseRouter: ReverseRouter) - -@renderProject(project: ExampleProject) = { - - @project.displayName - View on GitHub - -} - -@main("Getting Started with Play Framework", "getting-started") { -
-
-

Getting Started with Play Framework

-
-
-
-
- -
-

New to Play?

-
-

» Learn whether Play Framework is right for your project

- -
-
-

» Try the Hello World Tutorial

-
-

The Java and Scala Hello World projects are self-contained tutorials that include a distribution of the sbt build tool.

-

Play requires Java 8 or higher. Check your version with the java -version command and if needed, install it from Adoptium.

-

To try the tutorial, first download the Java or Scala project:

- - @examples.sections.map { case (version, section) => - - - @section.tutorials.getOrElse("java", Seq.empty).map { (project) => - @renderProject(project) - } - @section.tutorials.getOrElse("scala", Seq.empty).map { (project) => - @renderProject(project) - } - - } -

Play @version Hello World Projects

-

To run the tutorial:

-
    -
  1. Unzip the project in a convenient location.
  2. -
  3. In a command window, change to the top-level project directory.
  4. -
  5. Enter sbt run.
  6. -
  7. After the message Server started, ... displays, enter the following URL in a browser: http://localhost:9000
  8. -
-

The tutorial welcome page displays.

-
-
-
- -
-

Already know a bit about Play?

-

Lightbend offers a variety of Play example projects for Java and Scala that are focused on a particular use case. These include everything you need, including sbt, Play Framework, and an HTTP server. The examples also support Gradle.

-

If you are ready to start your own project and have sbt installed, you can create a Play project from the command line.

- -
-

» Create a Play Java or Scala project using sbt new

-
-

In a command window, enter one of the following and respond to the prompts to create a new project:

- -

Java seed template

-
sbt new playframework/play-java-seed.g8
- -

Scala seed template

-
sbt new playframework/play-scala-seed.g8
- -

After the template creates the project:

-
    -
  1. Change into the top level project directory.
  2. -
  3. Enter sbt run to download dependencies and start the system.
  4. -
  5. In a browser, enter http://localhost:9000 to view the welcome page.
  6. -
-
-
-
- -
- -
-} diff --git a/public/markdown/getting-started.md b/public/markdown/getting-started.md new file mode 100644 index 00000000..cf7a88c6 --- /dev/null +++ b/public/markdown/getting-started.md @@ -0,0 +1,43 @@ +# Getting started with Play framework + +## Learn whether Play Framework is right for your project + +- [What is play?](documentation/2.8.x/Introduction) + +## First time Play user? + +Check out the [getting started guide](documentation/2.8.x/Home) to install system dependencies and run a minimal +play application! This is the best place to start if you are new to Scala, Java or Play. + +## Already know a bit about Play? + +[In the play-samples repository](https://github.com/playframework/play-samples) there are a variety of example +projects in both Java and Scala for a particular use case. These include everything you need, including sbt, Play +Framework and 3rd part dependencies. + +If you have all [system requirements](documentation/2.8.x/Home) installed, and you are ready to start your own project +you can create a Play project from the command line. Go to you projects folder and run one of the following commands: + +### Java seed template + +```bash +sbt new playframework/play-java-seed.g8 +``` + +## Scala seed template + +```bash +sbt new playframework/play-scala-seed.g8 +``` + +For more information on setting up the seed project, [Check out the documentation](documentation/2.8.x/Home). + +## Community + +[Check out our forum, Discord and Open Collective!](get-involved) + +## Contribute + +Play is a community run project, and we are always happy to have people contribute Play is hosted on +[Github](https://github.com/playframework). If you have found an issue with Play or a problem with the documentation +please report that [on the github issue tracker](https://github.com/playframework/playframework/issues). From d1c347031fa20f5301cb388397b3a4039a04be07 Mon Sep 17 00:00:00 2001 From: Max Rosenbaum Date: Fri, 4 Feb 2022 09:17:21 +1100 Subject: [PATCH 2/3] Update markdown page title. --- app/controllers/Application.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/Application.scala b/app/controllers/Application.scala index 22c2f1f3..e6b1fc4a 100644 --- a/app/controllers/Application.scala +++ b/app/controllers/Application.scala @@ -82,7 +82,7 @@ class Application @Inject()( } def gettingStarted = markdownAction("public/markdown/getting-started.md", { implicit request => markdown => - views.html.markdownPage("Community process", markdown) + views.html.markdownPage("Getting started", markdown) }) def allreleases(platform: Option[String] = None) = Action { implicit request => From 09a004c4191c60a5ffc9fb7b5db2f9414c5f29d6 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 25 Mar 2022 15:28:37 +1100 Subject: [PATCH 3/3] Update getting-started.md --- public/markdown/getting-started.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/markdown/getting-started.md b/public/markdown/getting-started.md index cf7a88c6..c7479f07 100644 --- a/public/markdown/getting-started.md +++ b/public/markdown/getting-started.md @@ -38,6 +38,7 @@ For more information on setting up the seed project, [Check out the documentatio ## Contribute -Play is a community run project, and we are always happy to have people contribute Play is hosted on -[Github](https://github.com/playframework). If you have found an issue with Play or a problem with the documentation -please report that [on the github issue tracker](https://github.com/playframework/playframework/issues). +Play is a community run project, and we are always happy to have people contribute to the project! Play is hosted on +[Github](https://github.com/playframework), so, issues with Play or a problems with the documentation +can be reported [on the github issue tracker](https://github.com/playframework/playframework/issues). +