|
1 | | -@(title: String = "Try Play")(implicit requestHeader: RequestHeader) |
| 1 | +@(examples: PlayExamples)(implicit requestHeader: RequestHeader) |
2 | 2 |
|
3 | | -@main(title, "getting-started") { |
| 3 | + |
| 4 | +@renderProject(project: ExampleProject) = { |
| 5 | + <tr> |
| 6 | + <td><a href="@project.downloadUrl" target="_blank">@project.displayName</a></td> |
| 7 | + <td><a href="@project.downloadUrl" target="_blank">Download (zip)</a></td> |
| 8 | + <td><a href="@project.gitHubUrl" target="_blank">View on GitHub</a></td> |
| 9 | + </tr> |
| 10 | +} |
| 11 | + |
| 12 | +@main("Getting Started with Play Framework", "getting-started") { |
4 | 13 | <header id="top"> |
5 | 14 | <div class="wrapper"> |
6 | | - <h1>It's quick and easy to get started</h1> |
| 15 | + <h1>Getting Started with Play Framework</h1> |
7 | 16 | </div> |
8 | 17 | </header> |
9 | 18 | <section id="content"> |
10 | 19 | <article> |
11 | | - <h2>What would you like to do?</h2> |
12 | | - <p>To learn about Play hands-on, try the examples as described below. When you are ready to build your own app, use a <a href="@controllers.documentation.ReverseRouter.latest(None, "NewApplication")">seed template</a> that sets up the project structure and dev environment for you. You can easily integrate Play projects into your <a href="@controllers.documentation.ReverseRouter.latest(None, "IDE")">favorite IDE</a>. </p> |
13 | | - |
14 | | - <hr /> |
15 | | - |
16 | | - <h3>Downloading and building examples</h3> |
17 | | - <p>Lightbend <a href="//developer.lightbend.com/start/?group=play" target="_blank" rel="noopener noreferrer">Tech Hub</a> offers a variety of Play examples for Java and Scala. We recommend trying the Play Starter Example first.</p> |
18 | | - <p>The downloadable zip files include everything you need to build and run the examples, including a distribution of the <a href="//www.scala-sbt.org/index.html" target="_blank" rel="noopener noreferrer">sbt</a>. If you have <a href="//gradle.org/" target="_blank" rel="noopener noreferrer">Gradle</a>, you can use it as a build tool instead.</p> |
19 | | - |
20 | | - <p>After choosing an example from <a href="//developer.lightbend.com/start/?group=play" target="_blank" rel="noopener noreferrer">Tech Hub</a> follow these steps:</p> |
21 | | - <ol> |
22 | | - <li>Click CREATE A PROJECT FOR ME to download the zipped project.</li> |
23 | | - <li>Unzip the project in a convenient location.</li> |
24 | | - <li>In a command window, navigate to the top level project directory.</li> |
25 | | - <li>Enter one of the following commands: |
26 | | - <ul> |
27 | | - <li>On OSx or Linux systems: <code>./sbt run</code> or <code>./gradle runPlayBinary</code></li> |
28 | | - <li>On Windows systems: <code>sbt.bat run</code> or <code>gradlew.bat runPlayBinary</code></li> |
29 | | - </ul> |
30 | | - <p>The build tool downloads dependencies and compiles the project.</p> |
31 | | - </li> |
32 | | - <li> |
33 | | - After the build finishes, enter the following URL in a browser to view the app: |
34 | | - <p><a href="http://localhost:9000"><code>http://localhost:9000/</code></a></p> |
35 | | - </li> |
36 | | - </ol> |
37 | | - <p>Check out the readme file in the top level project directory to learn more about the example.</p> |
| 20 | + |
| 21 | + <div class="try-section"> |
| 22 | + <h2>New to Play?</h2> |
| 23 | + <p>Start with <a href="@controllers.documentation.ReverseRouter.latest(None)">our documentation</a> or the <a href="@controllers.documentation.ReverseRouter.latest(None, "HelloWorldTutorial")">Hello World Tutorial</a>.</p> |
| 24 | + |
| 25 | + <div class="try-option"> |
| 26 | + <h3><span>»</span> Learn whether Play Framework is right for your project</h3> |
| 27 | + <div class="try-option-content"> |
| 28 | + <ul> |
| 29 | + <li><a href="@controllers.documentation.ReverseRouter.latest(None, "Introduction")">Introduction to Play</a></li> |
| 30 | + <li><a href="@controllers.documentation.ReverseRouter.latest(None, "Requirements")">Requirements for using Play</a></li> |
| 31 | + <li><a href="@controllers.documentation.ReverseRouter.latest(None, "Philosophy")">Our philosophy</a></li> |
| 32 | + </ul> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + |
| 36 | + <div class="try-option"> |
| 37 | + <h3><span>»</span> Follow the Hello World Tutorial</h3> |
| 38 | + <div class="try-option-content"> |
| 39 | + <p>Play requires Java 8 or higher. You can check your version with the <code>java -version</code> command or install it from <a href="//www.oracle.com/technetwork/java/javase/downloads/index.html" rel="noopener">Oracle's site</a>. See details about <a href="@controllers.documentation.ReverseRouter.latest(None, "Requirements")">Play's system requirement</a>.</p> |
| 40 | + <p>First, download the starter project:</p> |
| 41 | + <table> |
| 42 | + @examples.sections.map { case (version, section) => |
| 43 | + <tbody> |
| 44 | + <tr><th><h4>Play @version Starter Projects</h4></th></tr> |
| 45 | + @section.starters.getOrElse("java", Seq.empty).map { (project) => |
| 46 | + @renderProject(project) |
| 47 | + } |
| 48 | + @section.starters.getOrElse("scala", Seq.empty).map { (project) => |
| 49 | + @renderProject(project) |
| 50 | + } |
| 51 | + </tbody> |
| 52 | + } |
| 53 | + </table> |
| 54 | + <p>Then, unzip the project in a convenient location and follow the directions in the <code>README.md</code> file to build and run the tutorial.</p> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | + |
| 59 | + <div class="try-section"> |
| 60 | + <h2>Already know a bit about Play?</h2> |
| 61 | + <p>Check out our <a href="//developer.lightbend.com/start/?group=play">example projects for Java or Scala</a>. The downloadable zip files include everything you need, including <a href="//www.scala-sbt.org/index.html">sbt</a>, Play Framework, and an HTTP server. Examples also support <a href="//docs.gradle.org/current/userguide/play_plugin.html">Gradle</a>. You can also create a Play project from the command line using a template if you have sbt installed already.</p> |
| 62 | + <p>Play requires Java 8 or higher. You can check your version with the <code>java -version</code> command or install it from <a href="//www.oracle.com/technetwork/java/javase/downloads/index.html" rel="noopener">Oracle's site</a>. See details about the <a href="@controllers.documentation.ReverseRouter.latest(None, "Requirements")">requirements to work with Play</a>.</p> |
| 63 | + |
| 64 | + <div class="try-option"> |
| 65 | + <h3><span>»</span> Try a focused example</h3> |
| 66 | + <div class="try-option-content"> |
| 67 | + <p>Follow these steps to try an example project:</p> |
| 68 | + <ol> |
| 69 | + <li>Choose an example from <a href="https://developer.lightbend.com/start/?group=play">Lightbend's Tech Hub</a>.</li> |
| 70 | + <li>Click "CREATE A PROJECT FOR ME" to download the zipped project.</li> |
| 71 | + <li>Unzip the project in a convenient location.</li> |
| 72 | + <li>In a command window, navigate to the top level project directory.</li> |
| 73 | + <li>Enter one of the following commands: |
| 74 | + <ul> |
| 75 | + <li>On macOS or Linux systems: <code>./sbt run</code> or <code>./gradlew runPlayBinary</code></li> |
| 76 | + <li>On Windows systems: <code>sbt.bat run</code> or <code>gradlew.bat runPlayBinary</code></li> |
| 77 | + </ul> |
| 78 | + </li> |
| 79 | + <li>The build tool downloads dependencies and compiles the project.</li> |
| 80 | + <li>After the build finishes, enter the following URL in a browser to view the app: <a href="http://localhost:9000/">http://localhost:9000/</a></li> |
| 81 | + |
| 82 | + </ol> |
| 83 | + <p>Check out the <code>README.md</code> file in the top level project directory to learn more about the example.</p> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + |
| 87 | + <div class="try-option"> |
| 88 | + <h3><span>»</span> Create a Play Java or Scala project using <code>sbt new</code></h3> |
| 89 | + <div class="try-option-content"> |
| 90 | + <p>In a command window, enter one of the following lines to create a new project:</p> |
| 91 | + |
| 92 | + <h4>Java seed template</h4> |
| 93 | + <pre>sbt new playframework/play-java-seed.g8</pre> |
| 94 | + |
| 95 | + <h4>Scala seed template</h4> |
| 96 | + <pre>sbt new playframework/play-scala-seed.g8</pre> |
| 97 | + |
| 98 | + <p>After the template creates the project:</p> |
| 99 | + <ol> |
| 100 | + <li>Enter <code>sbt run</code> command to download dependencies and start the system.</li> |
| 101 | + <li>In a browser, enter <a href="http://localhost:9000">http://localhost:9000</a> to view the welcome page.</li> |
| 102 | + </ol> |
| 103 | + </div> |
| 104 | + </div> |
| 105 | + </div> |
| 106 | + |
38 | 107 | </article> |
39 | 108 | <aside> |
40 | 109 | @commonSidebar() |
|
0 commit comments