forked from pkainulainen/maven-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c754d1
commit b3ff0ae
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
This is the example application of my blog post: | ||
|
||
* [Generating HTML Documentation From RAML Documents With Maven]() - Not published yet | ||
|
||
Prerequisites | ||
============= | ||
|
||
You need to install the following tools if you want to run this application: | ||
|
||
Java Tools | ||
--------- | ||
|
||
* [JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) | ||
* [Maven](http://maven.apache.org/) (this application is tested with Maven 3.3.3) | ||
|
||
Other Tools | ||
---------- | ||
|
||
* [Node.js](http://nodejs.org/) | ||
* [NPM](https://www.npmjs.com/) | ||
* [raml2html](https://github.com/raml2html/raml2html) | ||
|
||
Don't know how to install these tools? [Read my blog post](). | ||
|
||
Creating the HTML API Documentation | ||
=================================== | ||
|
||
You can create the HTML API documentation by running the following command at the command prompt: | ||
|
||
mvn clean package | ||
|
||
This creates the _api.html_ file to the _target_ directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>net.petrikainulainen.maven</groupId> | ||
<artifactId>raml-to-html</artifactId> | ||
<version>0.0.1</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>RAML To HTML</name> | ||
<description> | ||
This example demonstrates how you can generate HTML documentation from RAML documents with Maven. | ||
</description> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.4.0</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<executable>raml2html</executable> | ||
<commandlineArgs>-i src/docs/api.raml -o target/api.html</commandlineArgs> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#%RAML 0.8 | ||
title: Example API | ||
version: v1 | ||
baseUri: http://localhost:8080 | ||
protocols: [HTTP] | ||
/api/todo: | ||
get: | ||
description: Finds the information of todo entries whose title or description contains the given searchTerm. | ||
queryParameters: | ||
searchTerm: | ||
description: The used search term. | ||
type: string | ||
required: true | ||
example: RAML | ||
responses: | ||
200: | ||
description: Search was completed successfully. | ||
body: | ||
application/json: | ||
example: | | ||
{ | ||
"id": 1, | ||
"title": "Write RAML blog post", | ||
"description": "Write a blog post that describes how you can convert RAML documents into HTML." | ||
} |