From b4a310b31a5e9d23991d55735af4286a7157dbe8 Mon Sep 17 00:00:00 2001 From: "Kian-Meng, Ang" Date: Wed, 7 Oct 2020 21:50:09 +0800 Subject: [PATCH] Fix and adjust misc html doc generation settings --- README.md | 2 ++ lib/simple_schema.ex | 7 ++++--- mix.exs | 37 ++++++++++++++++++++++++++++--------- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index bdb3c09..be9d1f6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # SimpleSchema + + SimpleSchema は JSON の検証と各データ構造への設定を行うライブラリです。 - [hex.pm](https://hex.pm/packages/simple_schema) diff --git a/lib/simple_schema.ex b/lib/simple_schema.ex index fc6c4e5..0de80e5 100644 --- a/lib/simple_schema.ex +++ b/lib/simple_schema.ex @@ -1,7 +1,8 @@ defmodule SimpleSchema do - @moduledoc """ - #{File.read!("README.md")} - """ + @moduledoc "README.md" + |> File.read!() + |> String.split("") + |> Enum.fetch!(1) @type simple_schema :: SimpleSchema.Schema.simple_schema() diff --git a/mix.exs b/mix.exs index 5dbcd5b..6f0680f 100644 --- a/mix.exs +++ b/mix.exs @@ -1,22 +1,22 @@ defmodule SimpleSchema.Mixfile do use Mix.Project + @source_url "https://github.com/gumi/simple_schema" + @version "1.2.0" + @name "SimpleSchema" + def project do [ app: :simple_schema, - version: "1.2.0", + name: @name, + version: @version, elixir: "~> 1.9", elixirc_paths: elixirc_paths(Mix.env()), description: "Validate JSON and store to a specified data structure", - package: [ - maintainers: ["melpon", "kenichirow"], - licenses: ["Apache 2.0"], - links: %{"GitHub" => "https://github.com/gumi/simple_schema"} - ], - docs: [main: "SimpleSchema"], start_permanent: Mix.env() == :prod, - deps: deps(), - source_url: "https://github.com/gumi/simple_schema" + package: package(), + docs: docs(), + deps: deps() ] end @@ -36,4 +36,23 @@ defmodule SimpleSchema.Mixfile do {:memoize, "~> 1.3"} ] end + + defp package do + [ + maintainers: ["melpon", "kenichirow"], + licenses: ["Apache 2.0"], + links: %{ + "Changelog" => "#{@source_url}/blob/master/CHANGELOG.md", + "GitHub" => @source_url + } + ] + end + + defp docs do + [ + main: @name, + source_ref: @version, + source_url: @source_url + ] + end end