From 1dbdf74fde55d1add9fbaf213c3590e9a9c288e6 Mon Sep 17 00:00:00 2001 From: Gabben <43146729+gabbhack@users.noreply.github.com> Date: Tue, 15 Dec 2020 21:32:10 +0500 Subject: [PATCH] Update README --- .github/workflows/docs.yml | 2 ++ .github/workflows/tests.yml | 2 +- README.md | 44 +++++++++++++++++++++++++++++++++++++ README.rst | 9 -------- 4 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3b8332f..a6eed31 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,6 +4,8 @@ on: push: branches: - master + path-ignore: + - 'README.md' release: types: [published] diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5535894..d4547a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ on: branches: - master path-ignore: - - 'README.rst' + - 'README.md' release: types: [published] diff --git a/README.md b/README.md new file mode 100644 index 0000000..4ad6387 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# Deser + +**Deser is a serialization and deserialization library for Nim** + +[Deser documentation](https://deser.nim.town/) + +## Installation + +``` +nimble install deser +``` + +or + +```nim +requires "nim >= 1.4.2, deser >= 0.1.3" +``` + +## Usage + +```nim +import macros, options, times +import deser, deser_json + +type + Foo {.skipSerializeIf(isNone), renameAll(rkSnakeCase).} = object + id: int + someOption: Option[int] + date {.serializeWith(toUnix), deserializeWith(fromUnix).}: Time + +const js = """ + { + "id": 123, + "some_option": 321, + "date": 1214092800 + } +""" + +var f = js.parse().to(Foo) + +f.someOption = none(int) + +assert f.dumps() == """{"id":123,"date":1214092800}""" +``` \ No newline at end of file diff --git a/README.rst b/README.rst deleted file mode 100644 index 3fa82e5..0000000 --- a/README.rst +++ /dev/null @@ -1,9 +0,0 @@ -========== -Deser -========== - -Deser is a deserialization and serealization library. - -``nimble install deser`` - -`Documentation `_