Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc doc changes #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# BSD Zero Clause License

Copyright (C) 2021 Devin Alexander Torres <d@devinus.io>

Permission to use, copy, modify, and/or distribute this software for any
Expand Down
35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,23 @@

[![Build Status](https://img.shields.io/github/workflow/status/devinus/poison/ci/master)](https://github.com/devinus/poison/actions/workflows/ci.yml)
[![Coverage Status](https://img.shields.io/coveralls/github/devinus/poison/master)](https://coveralls.io/github/devinus/poison?branch=master)
[![Hex.pm Version](https://img.shields.io/hexpm/v/poison.svg?style=flat-square)](https://hex.pm/packages/poison)
[![Hex.pm Download Total](https://img.shields.io/hexpm/dt/poison.svg?style=flat-square)](https://hex.pm/packages/poison)
[![Hex Version](https://img.shields.io/hexpm/v/poison.svg)](https://hex.pm/packages/poison)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/poison/)
[![Total Download](https://img.shields.io/hexpm/dt/poison.svg)](https://hex.pm/packages/poison)
[![License](https://img.shields.io/hexpm/l/poison.svg)](https://github.com/devinus/poison/blob/master/LICENSE.md)
[![Last Updated](https://img.shields.io/github/last-commit/devinus/poison.svg)](https://github.com/devinus/poison/commits/master)

<!-- MDOC !-->

[1]: http://www.erlang.org/euc/07/papers/1700Gustafsson.pdf
[2]: https://erlang.org/documentation/doc-12.0-rc1/erts-12.0/doc/html/BeamAsm.html
[3]: http://jlouisramblings.blogspot.com/2013/07/problematic-traits-in-erlang.html
[4]: https://tools.ietf.org/html/rfc7159
[5]: http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
[6]: https://github.com/nst/JSONTestSuite
[7]: http://prog21.dadgum.com/70.html
[8]: https://en.wikipedia.org/wiki/Public-domain-equivalent_license
[9]: https://opensource.org/licenses/0BSD

Poison is a new JSON library for Elixir focusing on wicked-fast **speed**
without sacrificing **simplicity**, **completeness**, or **correctness**.
Expand Down Expand Up @@ -152,6 +167,8 @@ iex> Poison.encode!(%{:foo => "foo1", "foo" => "foo2"}, strict_keys: true)
** (Poison.EncodeError) duplicate key found: :foo
```

<!-- MDOC !-->

## Benchmarking

```sh-session
Expand All @@ -165,16 +182,8 @@ As of 2021-07-22:
- Amazon EC2 c5.2xlarge instance running Ubuntu Server 20.04:
https://gist.github.com/devinus/f56cff9e5a0aa9de9215cf33212085f6

## License
## Copyright and License

Poison is released under the [public-domain-equivalent][8] [0BSD][9] license.
Copyright (C) 2021 Devin Alexander Torres <d@devinus.io>

[1]: http://www.erlang.org/euc/07/papers/1700Gustafsson.pdf
[2]: https://erlang.org/documentation/doc-12.0-rc1/erts-12.0/doc/html/BeamAsm.html
[3]: http://jlouisramblings.blogspot.com/2013/07/problematic-traits-in-erlang.html
[4]: https://tools.ietf.org/html/rfc7159
[5]: http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
[6]: https://github.com/nst/JSONTestSuite
[7]: http://prog21.dadgum.com/70.html
[8]: https://en.wikipedia.org/wiki/Public-domain-equivalent_license
[9]: https://opensource.org/licenses/0BSD
Poison is released under the [public-domain-equivalent][8] [0BSD][9] license.
6 changes: 5 additions & 1 deletion lib/poison.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ defmodule Poison do
readme_path = [__DIR__, "..", "README.md"] |> Path.join() |> Path.expand()

@external_resource readme_path
@moduledoc readme_path |> File.read!() |> String.trim()
@moduledoc readme_path
|> File.read!()
|> String.trim()
|> String.split("<!-- MDOC !-->")
|> Enum.fetch!(1)

alias Poison.{Decode, DecodeError, Decoder}
alias Poison.{EncodeError, Encoder}
Expand Down
15 changes: 11 additions & 4 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ defmodule Poison.Mixfile do

@external_resource version_path
@version version_path |> File.read!() |> String.trim()
@source_url "https://github.com/devinus/poison"


def project do
[
Expand All @@ -13,7 +15,6 @@ defmodule Poison.Mixfile do
version: @version,
elixir: "~> 1.11",
description: "An incredibly fast, pure Elixir JSON library",
source_url: "https://github.com/devinus/poison",
start_permanent: Mix.env() == :prod,
consolidate_protocols: Mix.env() not in [:dev, :test],
elixirc_paths: elixirc_paths(),
Expand Down Expand Up @@ -86,9 +87,15 @@ defmodule Poison.Mixfile do

defp docs do
[
main: "Poison",
extras: [
"LICENSE.md": [title: "License"],
"README.md": [title: "Overview"]
],
main: "readme",
source_url: @source_url,
source_ref: @version,
canonical: "https://hexdocs.pm/poison",
extras: ["README.md"]
formatters: ["html"]
]
end

Expand All @@ -97,7 +104,7 @@ defmodule Poison.Mixfile do
files: ~w(lib mix.exs README.md LICENSE VERSION),
maintainers: ["Devin Alexander Torres <d@devinus.io>"],
licenses: ["0BSD"],
links: %{"GitHub" => "https://github.com/devinus/poison"}
links: %{"GitHub" => @source_url}
]
end

Expand Down