From b30c3c0538bee19fa6364caf8352399179ce99a6 Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Sat, 5 Jul 2014 17:10:43 +0200 Subject: [PATCH] readme.md: prepare Markdown for GitHub and Doxygen rendering --- readme.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index 6c1fa80..98a51eb 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# RapidJSON +# RapidJSON {#mainpage} Copyright (c) 2011-2014 Milo Yip (miloyip@gmail.com) @@ -37,7 +37,7 @@ Users can build and run the unit tests on their platform/compiler. ## Installation -RapidJSON is a header-only C++ library. Just copy the `rapidjson/include/rapidjson` folder to system or project's include path. +RapidJSON is a header-only C++ library. Just copy the `include/rapidjson` folder to system or project's include path. To build the tests and examples: @@ -45,15 +45,21 @@ To build the tests and examples: 2. Copy premake4 executable to RapidJSON/build (or system path) 3. Run `rapidjson/build/premake.bat` on Windows, `RapidJSON/build/premake.sh` on Linux or other platforms 4. On Windows, build the solution at `rapidjson/build/vs2008/` or `/vs2010/` -5. On other platforms, run GNU make at `rapidjson/build/gmake/` (e.g., `make -f test.make config=release32`, `make -f example.make config=debug32`) +5. On other platforms, run GNU make at `rapidjson/build/gmake/` (e.g., `make -f test.make config=release32`; `make -f example.make config=debug32`) 6. On success, the executable are generated at `rapidjson/bin` +To build the [Doxygen](http://doxygen.org) documentation: + +1. Obtain and install [Doxygen](http://doxygen.org/download.html). +2. In the top-level directory, run `doxygen build/Doxyfile`. +3. Browse the generated documentation in `doc/html`. + ## Usage at a glance This simple example parses a JSON string into a document (DOM), make a simple modification of the DOM, and finally stringify the DOM to a JSON string. [simpledom.cpp](example/simpledom/simpledom.cpp) -```cpp +~~~~~~~~~~cpp #include "rapidjson/document.h" #include "rapidjson/writer.h" #include "rapidjson/stringbuffer.h" @@ -80,12 +86,12 @@ int main() { std::cout << buffer.GetString() << std::endl; return 0; } -``` +~~~~~~~~~~ Note that this example did not handle potential errors. The following diagram shows the process. -![simpledom](doc/diagram/simpledom.png?raw=true) +![simpledom](doc/diagram/simpledom.png) More [examples](example/) are available.