Skip to content

Commit 3137b74

Browse files
kianmengbitwalker
authored andcommitted
docs: tidy up, improve generation
1 parent 464d0f5 commit 3137b74

File tree

7 files changed

+26
-42
lines changed

7 files changed

+26
-42
lines changed

.formatter.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Used by "mix format"
22
[
3-
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"]
3+
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
44
]

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ erl_crash.dump
2222
# Ignore package tarball (built via "mix hex.build").
2323
toml-*.tar
2424

25+
# Temporary files, e.g. from tests
26+
/tmp/
27+
2528
# Ignore generated benchmark output
2629
/bench/output/

LICENSE

-27
Original file line numberDiff line numberDiff line change
@@ -174,30 +174,3 @@
174174
of your accepting any such warranty or additional liability.
175175

176176
END OF TERMS AND CONDITIONS
177-
178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "{}"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189-
Copyright 2012 Plataformatec
190-
191-
Licensed under the Apache License, Version 2.0 (the "License");
192-
you may not use this file except in compliance with the License.
193-
You may obtain a copy of the License at
194-
195-
http://www.apache.org/licenses/LICENSE-2.0
196-
197-
Unless required by applicable law or agreed to in writing, software
198-
distributed under the License is distributed on an "AS IS" BASIS,
199-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200-
See the License for the specific language governing permissions and
201-
limitations under the License.
202-
203-

README.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# TOML for Elixir
22

3-
[![Master](https://travis-ci.com/bitwalker/toml-elixir.svg?branch=master)](https://travis-ci.com/bitwalker/toml-elixir)
4-
[![Hex.pm Version](http://img.shields.io/hexpm/v/toml.svg?style=flat)](https://hex.pm/packages/toml)
3+
[![Main](https://github.com/bitwalker/toml-elixir/workflows/elixir/badge.svg?branch=main)](https://github.com/bitwalker/toml-elixir/actions?query=workflow%3A%22elixir%22+branch%3Amain)
4+
[![Hex.pm Version](https://img.shields.io/hexpm/v/toml.svg?style=flat)](https://hex.pm/packages/toml)
5+
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg?style=flat)](https://hexdocs.pm/toml)
6+
[![Total Download](https://img.shields.io/hexpm/dt/toml.svg?style=flat)](https://hex.pm/packages/toml)
7+
[![Last Updated](https://img.shields.io/github/last-commit/bitwalker/toml-elixir.svg?style=flat)](https://github.com/bitwalker/toml-elixir/commits/main)
58

6-
This is a TOML library for Elixir projects. It is compliant with version 0.5.0 of the
7-
[official TOML specification](https://github.com/toml-lang/toml). You can find a
8-
brief overview of the feature set below, but you are encouraged to read the full
9-
spec at the link above (it is short and easy to read!).
9+
This is a TOML library for Elixir projects.
10+
11+
It is compliant with version 1.0 of the [official TOML specification](https://github.com/toml-lang/toml). You can find a
12+
brief overview of the feature set below, but you are encouraged to read the full spec at the link above (it is short and easy to read!).
1013

1114
## Features
1215

@@ -50,7 +53,7 @@ This library is available on Hex as `:toml`, and can be added to your deps like
5053
```elixir
5154
def deps do
5255
[
53-
{:toml, "~> 0.6.1"}
56+
{:toml, "~> 0.7"}
5457
]
5558
end
5659
```
@@ -180,7 +183,7 @@ expected '\n', but got 'b' in nofile on line 2:
180183
Support for extending value conversions is provided by the `Toml.Transform`
181184
behavior. An example is shown below:
182185

183-
Given the follwing TOML document:
186+
Given the following TOML document:
184187

185188
``` toml
186189
[servers.alpha]

lib/toml.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
defmodule Toml do
2+
@external_resource "README.md"
3+
24
@moduledoc File.read!(Path.join([__DIR__, "..", "README.md"]))
35

46
@type key :: binary | atom | term
@@ -20,12 +22,10 @@ defmodule Toml do
2022
2123
* `:filename` - pass a filename to use in error messages
2224
* `:keys` - controls how keys in the document are decoded. Possible values are:
23-
2425
* `:strings` (default) - decodes keys as strings
2526
* `:atoms` - converts keys to atoms with `String.to_atom/1`
2627
* `:atoms!` - converts keys to atoms with `String.to_existing_atom/1`
2728
* `(key -> term)` - converts keys using the provided function
28-
2929
* `:transforms` - a list of custom transformations to apply to decoded TOML values,
3030
see `c:Toml.Transform.transform/2` for details.
3131

mix.exs

+8-3
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,21 @@ defmodule Toml.MixProject do
6161
[
6262
files: ["lib", "mix.exs", "README.md", "LICENSE"],
6363
maintainers: ["Paul Schoenfelder"],
64-
licenses: ["Apache 2.0"],
64+
licenses: ["Apache-2.0"],
6565
links: %{"GitHub" => @source_url}
6666
]
6767
end
6868

6969
defp docs do
7070
[
71-
main: "Toml",
71+
main: "readme",
7272
source_url: @source_url,
73-
source_ref: @version
73+
source_ref: @version,
74+
extras: [
75+
LICENSE: [title: "License"],
76+
"README.md": [title: "Overview"]
77+
],
78+
formatters: ["html"]
7479
]
7580
end
7681

test/fixtures/toml-test/valid/comments-everywhere.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[group] # Comment
88
answer = 42 # Comment
99
# no-extraneous-keys-please = 999
10-
# Inbetween comment.
10+
# In between comment.
1111
more = [ # Comment
1212
# What about multiple # comments?
1313
# Can you handle it?

0 commit comments

Comments
 (0)