play-doc


License

License

GroupId

GroupId

com.typesafe.play
ArtifactId

ArtifactId

play-doc_2.12
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

play-doc
play-doc
Project URL

Project URL

https://github.com/playframework/play-doc
Project Organization

Project Organization

com.typesafe.play
Source Code Management

Source Code Management

https://github.com/playframework/play-doc

Download play-doc_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.typesafe.play/play-doc_2.12/ -->
<dependency>
    <groupId>com.typesafe.play</groupId>
    <artifactId>play-doc_2.12</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.typesafe.play/play-doc_2.12/
implementation 'com.typesafe.play:play-doc_2.12:2.1.0'
// https://jarcasting.com/artifacts/com.typesafe.play/play-doc_2.12/
implementation ("com.typesafe.play:play-doc_2.12:2.1.0")
'com.typesafe.play:play-doc_2.12:jar:2.1.0'
<dependency org="com.typesafe.play" name="play-doc_2.12" rev="2.1.0">
  <artifact name="play-doc_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.typesafe.play', module='play-doc_2.12', version='2.1.0')
)
libraryDependencies += "com.typesafe.play" % "play-doc_2.12" % "2.1.0"
[com.typesafe.play/play-doc_2.12 "2.1.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.10
com.typesafe.play : twirl-api_2.12 jar 1.5.0
org.pegdown : pegdown jar 1.6.0
commons-io : commons-io jar 2.6

test (1)

Group / Artifact Type Version
org.specs2 : specs2-core_2.12 jar 4.8.1

Project Modules

There are no modules declared in this project.

play-doc

This project implements Plays documentation parsing and generating. Documentation is in markdown with an extension that allows code snippets to come from external files. It is used by Play to allow us to have all our documentation code snippets in external compiled and tested files, ensuring that they are accurate and up to date.

Markdown Syntax

Referencing code in an external file looks like this:

@[label](some/relative/path)

Code snippet syntax

Code snippets are identified using the hash symbol prepended to the label, like this:

//#label
println("Hello world")
//#label

The label can be anywhere in a line, and the code snippet will be every line between the start and end labels, exclusive. Typically the snippet might be part of a test, for example:

"List" should {
    "support fold" in {
    //#fold
    val list = List(1, 2, 3)
    val sum = list.fold { (a, b) => a + b }
    //#fold
    sum must_== 6
    }
}

In some rare cases, you may need to slightly modify the snippet as it stands. Typically this might be when naming conflicts exist in the code, for example, if you want to show an entire Java class with its package name, and you have multiple places in your docs where you want to do similar, you might do this:

//#label
//#replace package foo.bar;
package foo.bar.docs.sec1;

class Foo {
    ...
}
//#label

The supported directives are replace, skip (followed by the number of lines to skip) and insert.

Play Version

Any %PLAY_VERSION% variables will be substituted with the current version of Play.

com.typesafe.play

Play Framework

Versions

Version
2.1.0
2.1.0-M2
2.1.0-M1
2.0.2
2.0.1
2.0.0
2.0.0-RC1
1.8.2
1.8.1
1.8.0
1.7.0