Skip to content

Commit

Permalink
Update doc links.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibireme committed May 25, 2022
1 parent 257cd6c commit 31248f1
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 74 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A high performance JSON library written in ANSI C.
- **Developer Friendly**: only one `h` and one `c` file, easy to integrate.

# Limitations
- An array or object is stored as some [data structure](https://github.com/ibireme/yyjson/blob/master/doc/DataStructure.md) like linked list, access elements with index or key is slower than iterator.
- An array or object is stored as some [data structure](https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__data_structure.html) like linked list, access elements with index or key is slower than iterator.
- Duplicate keys are allowed in an object, and the order of the keys is preserved.
- JSON parsing result is immutable, a `mutable copy` is required for modification.

Expand Down Expand Up @@ -83,7 +83,7 @@ Since `yyjson` is ANSI C compatible, no other configuration is needed typically.

`yyjson` has been tested with the following compilers: `gcc`, `clang`, `msvc`, `icc`, `tcc`. If you find a compile error, please [report a bug](https://github.com/ibireme/yyjson/issues/new?template=bug_report.md).

`yyjson` has all features enabled by default, but you can trim out some of them by adding compile-time options. For example, disable JSON writer to reduce the binary size when you don't need serialization, or disable comments support to improve parsing performance. See [compile-time options](https://github.com/ibireme/yyjson/blob/master/doc/BuildAndTest.md#compile-time-options) for details.
`yyjson` has all features enabled by default, but you can trim out some of them by adding compile-time options. For example, disable JSON writer to reduce the binary size when you don't need serialization, or disable comments support to improve parsing performance. See [compile-time options](https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__build_and_test.html#autotoc_md26) for details.

### CMake
Clone the repository and create build directory:
Expand Down Expand Up @@ -114,7 +114,7 @@ Supported CMake options:
- `-DYYJSON_DISABLE_FAST_FP_CONV=ON` Disable fast floating-point number conversion.
- `-DYYJSON_DISABLE_NON_STANDARD=ON` Disable non-standard JSON support at compile-time.

[More details](https://github.com/ibireme/yyjson/blob/master/doc/BuildAndTest.md)
[More details](https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__build_and_test.html)

# Sample Code

Expand Down Expand Up @@ -233,9 +233,10 @@ yyjson_mut_doc_free(doc);
```

# Documentation
* [Build and test](https://github.com/ibireme/yyjson/blob/master/doc/BuildAndTest.md)
* [API and sample code](https://github.com/ibireme/yyjson/blob/master/doc/API.md)
* [Data structure](https://github.com/ibireme/yyjson/blob/master/doc/DataStructure.md)
* [Build and test](https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__build_and_test.html)
* [API and sample code](https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__a_p_i.html)
* [Data structure](https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__data_structure.html)
* [Changelog](https://ibireme.github.io/yyjson/doc/doxygen/html/md__c_h_a_n_g_e_l_o_g.html)

# TODO
* [x] Add documentation page.
Expand Down
67 changes: 41 additions & 26 deletions doc/BuildAndTest.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,45 +142,60 @@ cmake --build .

**YYJSON_DISABLE_READER**<br/>
Define it as 1 to disable the JSON reader.<br/>
This option can reduce the binary size if you don't need to read JSON.<br/>
These functions will be disabled by this option:

```
This will disable these functions at compile-time:
```c
yyjson_read_opts()
yyjson_read_file()
yyjson_read()
```
```
This will reduce the binary size by about 60%.

● **YYJSON_DISABLE_WRITER**<br/>
Define it as 1 to disable the JSON writer.<br/>
This option can reduce the binary size if you don't need to write JSON.<br/>
These functions will be disabled by this option:
Define as 1 to disable JSON writer if you don't need to serialize JSON.

```
yyjson_write_opts()
yyjson_write_file()
This will disable these functions at compile-time:
```c
yyjson_write()
yyjson_mut_write_opts()
yyjson_mut_write_file()
yyjson_write_file()
yyjson_write_opts()
yyjson_val_write()
yyjson_val_write_file()
yyjson_val_write_opts()
yyjson_mut_write()
yyjson_mut_write_file()
yyjson_mut_write_opts()
yyjson_mut_val_write()
yyjson_mut_val_write_file()
yyjson_mut_val_write_opts()
```

This will reduce the binary size by about 30%.

● **YYJSON_DISABLE_FAST_FP_CONV**<br/>
Define as 1 to disable the fast floating-point number conversion in yyjson,<br/>
and use libc's `strtod/snprintf` instead. This may reduce binary size,<br/>
but slow down floating-point reading and writing speed.
Define as 1 to disable the fast floating-point number conversion in yyjson,
and use libc's `strtod/snprintf` instead.

This will reduce binary size by about 30%, but significantly slow down
floating-point reading and writing speed.

● **YYJSON_DISABLE_NON_STANDARD**<br/>
Define as 1 to disable non-standard JSON support at compile time:<br/>
- Reading and writing inf/nan literal, such as 'NaN', '-Infinity'.<br/>
- Single line and multiple line comments.<br/>
- Single trailing comma at the end of an object or array.<br/>
This may also invalidate these options:<br/>
- YYJSON_READ_ALLOW_INF_AND_NAN<br/>
- YYJSON_READ_ALLOW_COMMENTS<br/>
- YYJSON_READ_ALLOW_TRAILING_COMMAS<br/>
- YYJSON_WRITE_ALLOW_INF_AND_NAN<br/>
This may reduce binary size, and increase performance slightly.
Define as 1 to disable non-standard JSON support at compile-time:

- Reading and writing inf/nan literal, such as 'NaN', '-Infinity'.
- Single line and multiple line comments.
- Single trailing comma at the end of an object or array.
- Invalid unicode in string value.

This will also invalidate these run-time options:

- YYJSON_READ_ALLOW_INF_AND_NAN
- YYJSON_READ_ALLOW_COMMENTS
- YYJSON_READ_ALLOW_TRAILING_COMMAS
- YYJSON_READ_ALLOW_INVALID_UNICODE
- YYJSON_WRITE_ALLOW_INF_AND_NAN
- YYJSON_WRITE_ALLOW_INVALID_UNICODE

This will reduce binary size by about 10%, and increase performance slightly.

● **YYJSON_EXPORTS**<br/>
Define it as 1 to export symbols when building the library as Windows DLL.
Expand Down
13 changes: 7 additions & 6 deletions doc/doxygen/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h1><a class="anchor" id="autotoc_md1"></a>
<h1><a class="anchor" id="autotoc_md2"></a>
Limitations</h1>
<ul>
<li>An array or object is stored as some <a href="https://github.com/ibireme/yyjson/blob/master/doc/DataStructure.md">data structure</a> like linked list, access elements with index or key is slower than iterator.</li>
<li>An array or object is stored as some <a href="https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__data_structure.html">data structure</a> like linked list, access elements with index or key is slower than iterator.</li>
<li>Duplicate keys are allowed in an object, and the order of the keys is preserved.</li>
<li>JSON parsing result is immutable, a <code>mutable copy</code> is required for modification.</li>
</ul>
Expand Down Expand Up @@ -201,7 +201,7 @@ <h3><a class="anchor" id="autotoc_md8"></a>
Manually</h3>
<p >Just copy <code><a class="el" href="yyjson_8h.html">yyjson.h</a></code> and <code>yyjson.c</code> to your project and start using it. Since <code>yyjson</code> is ANSI C compatible, no other configuration is needed typically.</p>
<p ><code>yyjson</code> has been tested with the following compilers: <code>gcc</code>, <code>clang</code>, <code>msvc</code>, <code>icc</code>, <code>tcc</code>. If you find a compile error, please <a href="https://github.com/ibireme/yyjson/issues/new?template=bug_report.md">report a bug</a>.</p>
<p ><code>yyjson</code> has all features enabled by default, but you can trim out some of them by adding compile-time options. For example, disable JSON writer to reduce the binary size when you don't need serialization, or disable comments support to improve parsing performance. See <a href="https://github.com/ibireme/yyjson/blob/master/doc/BuildAndTest.md#compile-time-options">compile-time options</a> for details.</p>
<p ><code>yyjson</code> has all features enabled by default, but you can trim out some of them by adding compile-time options. For example, disable JSON writer to reduce the binary size when you don't need serialization, or disable comments support to improve parsing performance. See <a href="https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__build_and_test.html#autotoc_md26">compile-time options</a> for details.</p>
<h3><a class="anchor" id="autotoc_md9"></a>
CMake</h3>
<p >Clone the repository and create build directory: </p><div class="fragment"><div class="line">git clone https://github.com/ibireme/yyjson.git</div>
Expand All @@ -221,7 +221,7 @@ <h3><a class="anchor" id="autotoc_md9"></a>
<li><code>-DYYJSON_DISABLE_FAST_FP_CONV=ON</code> Disable fast floating-point number conversion.</li>
<li><code>-DYYJSON_DISABLE_NON_STANDARD=ON</code> Disable non-standard JSON support at compile-time.</li>
</ul>
<p ><a href="https://github.com/ibireme/yyjson/blob/master/doc/BuildAndTest.md">More details</a></p>
<p ><a href="https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__build_and_test.html">More details</a></p>
<h1><a class="anchor" id="autotoc_md10"></a>
Sample Code</h1>
<h3><a class="anchor" id="autotoc_md11"></a>
Expand Down Expand Up @@ -382,9 +382,10 @@ <h3><a class="anchor" id="autotoc_md11"></a>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md15"></a>
Documentation</h1>
<ul>
<li><a href="https://github.com/ibireme/yyjson/blob/master/doc/BuildAndTest.md">Build and test</a></li>
<li><a href="https://github.com/ibireme/yyjson/blob/master/doc/API.md">API and sample code</a></li>
<li><a href="https://github.com/ibireme/yyjson/blob/master/doc/DataStructure.md">Data structure</a></li>
<li><a href="https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__build_and_test.html">Build and test</a></li>
<li><a href="https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__a_p_i.html">API and sample code</a></li>
<li><a href="https://ibireme.github.io/yyjson/doc/doxygen/html/md_doc__data_structure.html">Data structure</a></li>
<li><a href="https://ibireme.github.io/yyjson/doc/doxygen/html/md__c_h_a_n_g_e_l_o_g.html">Changelog</a></li>
</ul>
<h1><a class="anchor" id="autotoc_md16"></a>
TODO</h1>
Expand Down
Loading

0 comments on commit 31248f1

Please sign in to comment.