Ver código fonte

Update macro declarations with leading markdown

Note, this was processed using the following command line:

    fpp --input=README.ftl.md --output=README.md

and output suffers from the bug detailed at:

    https://www.pivotaltracker.com/story/show/52221207
Chris Beams 13 anos atrás
pai
commit
d4f85b7fa1
2 arquivos alterados com 21 adições e 13 exclusões
  1. 10
    7
      README.ftl.md
  2. 11
    6
      README.md

+ 10
- 7
README.ftl.md Ver arquivo

@@ -1,3 +1,5 @@
1
+<#assign project_id="gs-rest-service">
2
+
1 3
 # Getting Started: Building a RESTful Web Service
2 4
 
3 5
 What you'll build
@@ -24,9 +26,10 @@ What you'll need
24 26
 ----------------
25 27
 
26 28
  - About 15 minutes
27
-<@prereq_editor_jdk_buildtools/>
29
+ - <@prereq_editor_jdk_buildtools/>
30
+
28 31
 
29
-<@how_to_complete_this_guide/>
32
+## <@how_to_complete_this_guide/>
30 33
 
31 34
 
32 35
 <a name="scratch"></a>
@@ -39,7 +42,7 @@ Set up the project
39 42
 
40 43
 ### Create a Maven POM
41 44
 
42
-<@snippet path="pom.xml" prefix="initial"/>
45
+    <@snippet path="pom.xml" prefix="initial"/>
43 46
 
44 47
 <@bootstrap_starter_pom_disclaimer/>
45 48
 
@@ -63,7 +66,7 @@ The `id` field is a unique identifier for the greeting, and `content` is the tex
63 66
 
64 67
 To model the greeting representation, you create a _resource representation class_. To do this, you simply create a plain old java object with fields, constructors, and accessors for the `id` and `content` data:
65 68
 
66
-<@snippet path="src/main/java/hello/Greeting.java" prefix="complete"/>
69
+    <@snippet path="src/main/java/hello/Greeting.java" prefix="complete"/>
67 70
 
68 71
 > **Note:** As you'll see in steps below, Spring will use the _Jackson_ JSON library to automatically marshal instances of type `Greeting` into JSON.
69 72
 
@@ -75,7 +78,7 @@ Create a resource controller
75 78
 
76 79
 In Spring's approach to building RESTful web services, HTTP requests are handled by a _controller_. These components are easily identified by the [`@Controller`][] annotation, and the `GreetingController` below handles `GET` requests for `/greeting` by returning a new instance of the `Greeting` class:
77 80
 
78
-<@snippet path="src/main/java/hello/GreetingController.java" prefix="complete"/>
81
+    <@snippet path="src/main/java/hello/GreetingController.java" prefix="complete"/>
79 82
 
80 83
 This controller is concise and simple, but there's plenty going on under the hood. Let's break it down step by step.
81 84
 
@@ -101,7 +104,7 @@ Although it is possible to package this service as a traditional _web applicatio
101 104
 
102 105
 ### Create a main class
103 106
 
104
-<@snippet path="src/main/java/hello/Application.java" prefix="complete"/>
107
+    <@snippet path="src/main/java/hello/Application.java" prefix="complete"/>
105 108
 
106 109
 The `main()` method defers to the [`SpringApplication`][] helper class, providing `Application.class` as an argument to its `run()` method. This tells Spring to read the annotation metadata from `Application` and to manage it as a component in the _[Spring application context][u-application-context]_.
107 110
 
@@ -109,7 +112,7 @@ The `@ComponentScan` annotation tells Spring to search recursively through the `
109 112
 
110 113
 The [`@EnableAutoConfiguration`][] annotation switches on reasonable default behaviors based on the content of your classpath. For example, because the application depends on the embeddable version of Tomcat (tomcat-embed-core.jar), a Tomcat server is set up and configured with reasonable defaults on your behalf. And because the application also depends on Spring MVC (spring-webmvc.jar), a Spring MVC [`DispatcherServlet`][] is configured and registered for you — no `web.xml` necessary! Auto-configuration is a powerful, flexible mechanism. See the [API documentation][`@EnableAutoConfiguration`] for further details.
111 114
 
112
-<@build_an_executable_jar/>
115
+### <@build_an_executable_jar/>
113 116
 
114 117
 
115 118
 Run the service

+ 11
- 6
README.md Ver arquivo

@@ -1,3 +1,4 @@
1
+
1 2
 # Getting Started: Building a RESTful Web Service
2 3
 
3 4
 What you'll build
@@ -24,14 +25,16 @@ What you'll need
24 25
 ----------------
25 26
 
26 27
  - About 15 minutes
27
- - A favorite text editor or IDE
28
+ -  - A favorite text editor or IDE
28 29
  - [JDK 6][jdk] or later
29 30
  - [Maven 3.0][mvn] or later
30 31
 
31 32
 [jdk]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
32 33
 [mvn]: http://maven.apache.org/download.cgi
33 34
 
34
-How to complete this guide
35
+
36
+
37
+## How to complete this guide
35 38
 --------------------------
36 39
 
37 40
 Like all Spring's [Getting Started guides](/getting-started), you can start from scratch and complete each step, or you can bypass basic setup steps that are already familiar to you. Either way, you end up with working code.
@@ -41,11 +44,12 @@ To **start from scratch**, move on to [Set up the project](#scratch).
41 44
 To **skip the basics**, do the following:
42 45
 
43 46
  - [Download][zip] and unzip the source repository for this guide, or clone it using [git](/understanding/git):
44
-`git clone https://github.com/springframework-meta/{@project-name}.git`
45
- - cd into `{@project-name}/initial`
47
+`git clone https://github.com/springframework-meta/gs-rest-service.git`
48
+ - cd into `gs-rest-service/initial`
46 49
  - Jump ahead to [Create a resource representation class](#initial).
47 50
 
48
-**When you're finished**, you can check your results against the code in `{@project-name}/complete`.
51
+**When you're finished**, you can check your results against the code in `gs-rest-service/complete`.
52
+
49 53
 
50 54
 
51 55
 <a name="scratch"></a>
@@ -242,7 +246,7 @@ The `@ComponentScan` annotation tells Spring to search recursively through the `
242 246
 
243 247
 The [`@EnableAutoConfiguration`][] annotation switches on reasonable default behaviors based on the content of your classpath. For example, because the application depends on the embeddable version of Tomcat (tomcat-embed-core.jar), a Tomcat server is set up and configured with reasonable defaults on your behalf. And because the application also depends on Spring MVC (spring-webmvc.jar), a Spring MVC [`DispatcherServlet`][] is configured and registered for you — no `web.xml` necessary! Auto-configuration is a powerful, flexible mechanism. See the [API documentation][`@EnableAutoConfiguration`] for further details.
244 248
 
245
-### Build an executable JAR
249
+### ### Build an executable JAR
246 250
 
247 251
 Now that your `Application` class is ready, you simply instruct the build system to create a single, executable jar containing everything. This makes it easy to ship, version, and deploy the service as an application throughout the development lifecycle, across different environments, and so forth.
248 252
 
@@ -275,6 +279,7 @@ Now run the following to produce a single executable JAR file containing all nec
275 279
 [maven-shade-plugin]: https://maven.apache.org/plugins/maven-shade-plugin
276 280
 
277 281
 
282
+
278 283
 Run the service
279 284
 ---------------
280 285