AVRO-XXXX: Correct documentation links (#845)
Links do not work in Chrome or Firefox when visiting docs at `https://github.com/apache/avro/blob/master/lang/js/doc/Home.md`.
Note the reason I was viewing the Home.md file was that the [avro-js package](https://www.npmjs.com/package/avro-js) says that for documentation:
> See doc/ folder.
It does not specifically say which doc/ folder or link to it, so I assume that it means `https://github.com/apache/avro/blob/master/lang/js/doc/`. Perhaps it means something else, where the `Api` link actually works, but I couldn't locate it. Unusual to have to search so hard to find docs.
diff --git a/lang/js/doc/Home.md b/lang/js/doc/Home.md
index 842b7de..6e52e56 100644
--- a/lang/js/doc/Home.md
+++ b/lang/js/doc/Home.md
@@ -27,15 +27,15 @@
## What is a `Type`?
-Each Avro type maps to a corresponding JavaScript [`Type`](API#class-type):
+Each Avro type maps to a corresponding JavaScript [`Type`](API.md#class-type):
+ `int` maps to `IntType`.
+ `array`s map to `ArrayType`s.
+ `record`s map to `RecordType`s.
+ etc.
-An instance of a `Type` knows how to [`decode`](Api#typedecodebuf-pos-resolver)
-and [`encode`](Api#typeencodeval-buf-pos) and its corresponding objects. For
+An instance of a `Type` knows how to [`decode`](API.md#typedecodebuf-pos-resolver)
+and [`encode`](API.md#typeencodeval-buf-pos) and its corresponding objects. For
example the `StringType` knows how to handle JavaScript strings:
```javascript
@@ -44,13 +44,13 @@
var str = stringType.fromBuffer(buf); // === 'Hi'
```
-The [`toBuffer`](API#typetobufferval) and
-[`fromBuffer`](API#typefrombufferval-resolver-nocheck) methods above are
+The [`toBuffer`](API.md#typetobufferval) and
+[`fromBuffer`](API.md#typefrombufferval-resolver-nocheck) methods above are
convenience functions which encode and decode a single object into/from a
standalone buffer.
Each `type` also provides other methods which can be useful. Here are a few
-(refer to the [API documentation](API#avro-types) for the full list):
+(refer to the [API documentation](API.md#avro-types) for the full list):
+ JSON-encoding:
@@ -80,7 +80,7 @@
the vast majority of use-cases they will be automatically generated by parsing
an existing schema.
-`avro` exposes a [`parse`](Api#parseschema-opts) method to do the
+`avro` exposes a [`parse`](API.md#parseschema-opts) method to do the
heavy lifting:
```javascript
@@ -140,7 +140,7 @@
Avro files (meaning [Avro object container files][object-container]) hold
serialized Avro records along with their schema. Reading them is as simple as
-calling [`createFileDecoder`](Api#createfiledecoderpath-opts):
+calling [`createFileDecoder`](API.md#createfiledecoderpath-opts):
```javascript
var personStream = avro.createFileDecoder('./persons.avro');
@@ -165,14 +165,14 @@
```
To access a file's header synchronously, there also exists an
-[`extractFileHeader`](Api#extractfileheaderpath-opts) method:
+[`extractFileHeader`](API.md#extractfileheaderpath-opts) method:
```javascript
var header = avro.extractFileHeader('persons.avro');
```
Writing to an Avro container file is possible using
-[`createFileEncoder`](Api#createfileencoderpath-type-opts):
+[`createFileEncoder`](API.md#createfileencoderpath-type-opts):
```javascript
var encoder = avro.createFileEncoder('./processed.avro', type);
@@ -181,8 +181,8 @@
## Next steps
-The [API documentation](Api) provides a comprehensive list of available
-functions and their options. The [Advanced usage section](Advanced-usage) goes
+The [API documentation](API.md) provides a comprehensive list of available
+functions and their options. The [Advanced usage section](Advanced-usage.md) goes
through a few examples to show how the API can be used.