Skip to content

Commit d6e3fa5

Browse files
committed
Java/ScalaDoc: Now publishing separate docs per project.
JAVA-3091
1 parent a4e0a53 commit d6e3fa5

File tree

96 files changed

+1038
-1006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1038
-1006
lines changed

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ configure(scalaProjects) {
123123
scalaCompileOptions.deprecation = false
124124
}
125125

126+
if (project.scalaVersion.startsWith("2.13")) {
127+
scaladoc {
128+
scalaClasspath += files("$rootDir/gradle/scala/lib/scala-ant-2.13.1.jar")
129+
}
130+
}
126131

127132
tasks.withType(GenerateModuleMetadata) {
128133
enabled = false

docs/landing/data/releases.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ current = "3.12.0"
33
[[versions]]
44
version = "4.0.0-beta1"
55
docs = "./4.0"
6-
api = "./4.0/javadoc"
6+
api = "./4.0/apidocs"
77

88
[[versions]]
99
version = "3.12.0"

docs/reference/config.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ disableKinds = ["section", "taxonomy", "taxonomyTerm", "404"]
99
[blackfriday]
1010
plainIdAnchors = true
1111

12-
# Update versions in mongodb.toml as well
13-
[[menu.main]]
14-
name = "API Documentation"
15-
pre = "<i class='fa fa-file-text-o'></i>"
16-
weight = 90
17-
identifier = "apiDocs"
18-
url = "/javadoc"
19-
2012
[[menu.main]]
2113
name = "Source Code"
2214
pre = "<i class='fa fa-github'></i>"

docs/reference/content/apidocs.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
+++
2+
date = "2020-01-28T15:50:55Z"
3+
title = "API Documentation"
4+
[menu.main]
5+
name = "API Documentation"
6+
pre = "<i class='fa fa-file-text-o'></i>"
7+
weight = 90
8+
identifier = "apiDocs"
9+
+++
10+
11+
## API Documentation
12+
13+
The following API documentation is available:
14+
15+
- [Java Driver]({{< apiref "mongodb-driver-sync" "index.html" >}}) (modern API)
16+
- [Java Driver]({{< apiref "mongodb-driver-legacy" "index.html" >}}) (legacy API)
17+
- [Java Reactive Streams Driver]({{< apiref "mongodb-driver-reactivestreams" "index.html" >}})
18+
- [Scala Driver]({{< apiref "mongo-scala-driver" "index.html" >}})
19+
- [Bson]({{< apiref "bson" "index.html" >}}) (The bson layer)

docs/reference/content/bson/codecs.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ title = "Codec and CodecRegistry"
99

1010
## Codec and CodecRegistry
1111

12-
In the last section we saw how to use the [`BsonReader`]({{< apiref "org/bson/BsonReader" >}}) and
13-
[`BsonWriter`]({{< apiref "org/bson/BsonWriter" >}}) API to read and write BSON documents. But writing code at that
12+
In the last section we saw how to use the [`BsonReader`]({{< apiref "bson" "org/bson/BsonReader" >}}) and
13+
[`BsonWriter`]({{< apiref "bson" "org/bson/BsonWriter" >}}) API to read and write BSON documents. But writing code at that
1414
low a level is tedious and error-prone, so in practice these algorithms are packaged in implementations of the
15-
[`Codec`]({{< apiref "org/bson/codecs/Codec" >}}) interface.
15+
[`Codec`]({{< apiref "bson" "org/bson/codecs/Codec" >}}) interface.
1616

1717
### Codec
1818

@@ -49,9 +49,9 @@ rely on a set of simpler `Codec` implementations for the basic BSON value types.
4949

5050
### CodecRegistry
5151

52-
A [`CodecRegistry`]({{< apiref "org/bson/codecs/configuration/CodecRegistry" >}}) contains a set of `Codec` instances that are accessed
52+
A [`CodecRegistry`]({{< apiref "bson" "org/bson/codecs/configuration/CodecRegistry" >}}) contains a set of `Codec` instances that are accessed
5353
according to the Java classes that they encode from and decode to. Instances of `CodecRegistry` are generally created via static factory
54-
methods on the [`CodecRegistries`]({{< apiref "org/bson/codecs/configuration/CodecRegistries" >}}) class. Consider the simplest of these
54+
methods on the [`CodecRegistries`]({{< apiref "bson" "org/bson/codecs/configuration/CodecRegistries" >}}) class. Consider the simplest of these
5555
methods, one that takes a list of `Codec`s:
5656

5757
```java
@@ -74,7 +74,7 @@ construction of the `Document` `Codec` until after the `CodecRegistry` has been
7474

7575
### CodecProvider
7676

77-
A [`CodecProvider`]({{< apiref "org/bson/codecs/configuration/CodecProvider" >}}) is a factory for `Codec` instances. Unlike
77+
A [`CodecProvider`]({{< apiref "bson" "org/bson/codecs/configuration/CodecProvider" >}}) is a factory for `Codec` instances. Unlike
7878
`CodecRegistry`, its `get` method takes not only a Class, but also a `CodecRegistry`, allowing a `CodecProvider` implementation to
7979
construct `Codec` instances that require a `CodecRegistry` to look up `Codec` instances for the values contained within it. Consider a
8080
`CodecProvider` for the `Document` class:
@@ -105,7 +105,7 @@ abstracted via the `BsonTypeClassMap` class.
105105

106106
### BsonTypeClassMap
107107

108-
The [`BsonTypeClassMap`]({{< apiref "org/bson/codecs/BsonTypeClassMap" >}}) class simply maps each value in the `BsonType`
108+
The [`BsonTypeClassMap`]({{< apiref "bson" "org/bson/codecs/BsonTypeClassMap" >}}) class simply maps each value in the `BsonType`
109109
enumeration to a Java class. It contains a sensible set of default mappings that can easily be changed by passing an a `Map<BsonType,
110110
Class<?>>` instance to the constructor with any replacement mappings to apply. Consider the case where an application wants to decode
111111
all BSON DateTime values to an `Instant` instead of the default `Date`:

docs/reference/content/bson/documents.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ the other values to be lost.
2222

2323
### BsonDocument
2424

25-
Although generally not needed by users of the high-level driver API, the [`BsonDocument`]({{< apiref "org/bson/BsonDocument" >}}) class is
25+
Although generally not needed by users of the high-level driver API, the [`BsonDocument`]({{< apiref "bson" "org/bson/BsonDocument" >}}) class is
2626
central to the way that documents are managed internally by the driver. The `BsonDocument` class can represent dynamically structured
2727
documents of any complexity with a type-safe API. For instance, the document
2828

@@ -42,11 +42,11 @@ new BsonDocument().append("a", new BsonString("MongoDB"))
4242

4343
The type safety comes from `BsonDocument` implementing `Map<String, BsonValue>`, so even built-in types like `int`, `String` and `List` must
4444
be wrapped in a sub-class of `BsonValue`. For a complete list of `BsonValue` sub-types, please consult the
45-
[`BsonValue`]({{< apiref "org/bson/BsonValue" >}}) API documentation.
45+
[`BsonValue`]({{< apiref "bson" "org/bson/BsonValue" >}}) API documentation.
4646

4747
### Document
4848

49-
Most applications will use the [`Document`]({{< apiref "org/bson/Document" >}}) class instead. Like `BsonDocument`, the
49+
Most applications will use the [`Document`]({{< apiref "bson" "org/bson/Document" >}}) class instead. Like `BsonDocument`, the
5050
`Document` class can represent dynamically structured documents of any complexity; however, the typing is much looser, as `Document`
5151
implements `Map<String, Object>`. As a result, the same document as above can be constructed using the Document class as follows:
5252

@@ -79,17 +79,17 @@ reference .
7979
### DBObject
8080

8181
Although not recommended for new applications, those upgrading from the 2.x driver series may continue to use the
82-
[`DBObject`]({{< apiref "com/mongodb/DBObject" >}}) interface to represent BSON documents. `DBObject` is similar to Document in that it
82+
[`DBObject`]({{< apiref "mongodb-driver-core" "com/mongodb/DBObject" >}}) interface to represent BSON documents. `DBObject` is similar to Document in that it
8383
represents BSON values as `Object`, but it has a few shortcomings that were impossible to overcome:
8484

8585
- it is an interface rather than a class, so it's API can not be extended without breaking binary compatibility
8686
- it doesn't actually implement `Map<String, Object>`
87-
- because it is an interface, a separate concrete class called [`BasicDBObject`]({{< apiref "com/mongodb/BasicDBObject" >}}) which
87+
- because it is an interface, a separate concrete class called [`BasicDBObject`]({{< apiref "mongodb-driver-core" "com/mongodb/BasicDBObject" >}}) which
8888
implements that interface, is required
8989

9090
### Bson
9191

92-
To tie these all together, the driver contains a small but powerful interface called [`Bson`]({{< apiref "org/bson/conversions/Bson" >}}).
92+
To tie these all together, the driver contains a small but powerful interface called [`Bson`]({{< apiref "bson" "org/bson/conversions/Bson" >}}).
9393
Any class that represents a BSON document, whether included in the driver itself or from a third party, can implement this interface and
9494
can then be used any place in the high-level API where a BSON document is required. The three classes discussed above all implement this
9595
interface and so can be used interchangeably based on the needs of a given application. For example:

docs/reference/content/bson/extended-json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ This code snippet will print out MongoDB shell-compatible JSON, which can then b
7676

7777
Often applications have specific requirements on the structure of JSON that is generated from documents stored in MongoDB, where none of
7878
the modes described above will suffice. For those situations a `JsonWriterSettings` instance can be customized with an application-provided
79-
[`Converter`]({{< apiref "org/bson/json/Converter" >}}) for each BSON type.
79+
[`Converter`]({{< apiref "bson" "org/bson/json/Converter" >}}) for each BSON type.
8080

8181
Consider a situation where an application wants to output the hex string representation of an ObjectId as a simple JSON string. Simply
8282
register a custom `Converter` with `JsonWriterSettings` for the ObjectId type:

0 commit comments

Comments
 (0)