From aa4bb9e4cd617d4932c2e402f8efb0f038a930da Mon Sep 17 00:00:00 2001 From: "Kian-Meng, Ang" Date: Tue, 16 Nov 2021 11:37:39 +0800 Subject: [PATCH] Misc doc changes Besides other documentation changes, this commit ensures the generated HTML doc for HexDocs.pm will become the source of truth for this Elixir library and leverage on latest features of ExDoc. --- .formatter.exs | 4 +++ .gitignore | 27 ++++++++++++++++--- LICENSE => LICENSE.md | 2 +- README.md | 18 ++++++++++++- mix.exs | 60 ++++++++++++++++++++++--------------------- mix.lock | 8 +++--- 6 files changed, 81 insertions(+), 38 deletions(-) create mode 100644 .formatter.exs rename LICENSE => LICENSE.md (97%) diff --git a/.formatter.exs b/.formatter.exs new file mode 100644 index 0000000..d2cda26 --- /dev/null +++ b/.formatter.exs @@ -0,0 +1,4 @@ +# Used by "mix format" +[ + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] +] diff --git a/.gitignore b/.gitignore index b24e60a..f58e2cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,26 @@ -/_build -/doc -/deps +# The directory Mix will write compiled artifacts to. +/_build/ + +# If you run "mix test --cover", coverage assets end up here. +/cover/ + +# The directory Mix downloads your dependencies sources to. +/deps/ + +# Where third-party dependencies like ExDoc output generated docs. +/doc/ + +# Ignore .fetch files in case you like to edit your project deps locally. +/.fetch + +# If the VM crashes, it generates a dump, let's ignore it too. erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). *.ez + +# Ignore package tarball (built via "mix hex.build"). +mustache-*.tar + +# Temporary files, for example, from tests. +/tmp/ diff --git a/LICENSE b/LICENSE.md similarity index 97% rename from LICENSE rename to LICENSE.md index 0ca6cf5..7027573 100644 --- a/LICENSE +++ b/LICENSE.md @@ -1,4 +1,4 @@ -The MIT License (MIT) +# The MIT License (MIT) Copyright (c) 2015 Jan Schulte diff --git a/README.md b/README.md index 3ffc4a6..055e902 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ Mustache ======== + [![Build Status](https://travis-ci.org/schultyy/Mustache.ex.svg?branch=master)](https://travis-ci.org/schultyy/Mustache.ex) +[![Module Version](https://img.shields.io/hexpm/v/mustache.svg)](https://hex.pm/packages/mustache) +[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/mustache/) +[![Total Download](https://img.shields.io/hexpm/dt/mustache.svg)](https://hex.pm/packages/mustache) +[![License](https://img.shields.io/hexpm/l/mustache.svg)](https://github.com/schultyy/Mustache.ex/blob/master/LICENSE.md) +[![Last Updated](https://img.shields.io/github/last-commit/schultyy/Mustache.ex.svg)](https://github.com/schultyy/Mustache.ex/commits/master) Minimal templating with {{mustaches}} in Elixir - [http://mustache.github.com/](http://mustache.github.com/) @@ -16,7 +22,9 @@ In your `mix.exs`, add Mustache as dependency: ```elixir defp deps do - [{:mustache, "~> 0.3.0"}] + [ + {:mustache, "~> 0.3.0"} + ] end ``` @@ -44,3 +52,11 @@ Run all tests: ```bash $ mix test ``` + +Copyright and License +===================== + +Copyright (c) 2015 Jan Schulte + +This work is free. You can redistribute it and/or modify it under the +terms of the MIT License. See the [LICENSE.md](./LICENSE.md) file for more details. diff --git a/mix.exs b/mix.exs index 33fdcbe..7fd182f 100644 --- a/mix.exs +++ b/mix.exs @@ -1,49 +1,51 @@ defmodule Mustache.Mixfile do use Mix.Project - def project do - [app: :mustache, - version: "0.4.0", - elixir: "~> 1.0", - package: package(), - description: "Mustache templates for Elixir", - deps: deps()] - end + @source_url "https://github.com/schultyy/Mustache.ex" + @version "0.4.0" - defp description do - """ - A Mustache Implementation for Elixir - """ + def project do + [ + app: :mustache, + version: @version, + elixir: "~> 1.0", + package: package(), + deps: deps(), + docs: docs() + ] end - # Configuration for the OTP application - # - # Type `mix help compile.app` for more information def application do [applications: [:logger]] end - # Dependencies can be Hex packages: - # - # {:mydep, "~> 0.3.0"} - # - # Or git/path repositories: - # - # {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"} - # - # Type `mix help deps` for more examples and options defp deps do [ {:ex_doc, ">= 0.0.0", only: :dev}, - {:earmark, ">= 0.0.0", only: :dev} ] end defp package do - [contributors: ["Jan Schulte"], - licenses: ["MIT License"], + [ + description: "A Mustache implementation for Elixir", + contributors: ["Jan Schulte"], + licenses: ["MIT"], maintainers: ["Jan Schulte"], - links: %{"GitHub" => "https://github.com/schultyy/Mustache.ex"}, - files: ~w(mix.exs README.md lib)] + files: ~w(mix.exs README.md LICENSE.md lib), + links: %{"GitHub" => @source_url} + ] + end + + defp docs do + [ + extras: [ + "LICENSE.md": [title: "License"], + "README.md": [title: "Overview"] + ], + main: "readme", + source_url: @source_url, + source_ref: "v#{@version}", + formatters: ["html"] + ] end end diff --git a/mix.lock b/mix.lock index ce5eed3..cc99c33 100644 --- a/mix.lock +++ b/mix.lock @@ -1,9 +1,9 @@ %{ "earmark": {:hex, :earmark, "1.4.15", "2c7f924bf495ec1f65bd144b355d0949a05a254d0ec561740308a54946a67888", [:mix], [{:earmark_parser, ">= 1.4.13", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "3b1209b85bc9f3586f370f7c363f6533788fb4e51db23aa79565875e7f9999ee"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.13", "0c98163e7d04a15feb62000e1a891489feb29f3d10cb57d4f845c405852bbef8", [:mix], [], "hexpm", "d602c26af3a0af43d2f2645613f65841657ad6efc9f0e361c3b6c06b578214ba"}, - "ex_doc": {:hex, :ex_doc, "0.25.1", "4b736fa38dc76488a937e5ef2944f5474f3eff921de771b25371345a8dc810bc", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "3200b0a69ddb2028365281fbef3753ea9e728683863d8cdaa96580925c891f67"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.17", "6f3c7e94170377ba45241d394389e800fb15adc5de51d0a3cd52ae766aafd63f", [:mix], [], "hexpm", "f93ac89c9feca61c165b264b5837bf82344d13bebc634cd575cb711e2e342023"}, + "ex_doc": {:hex, :ex_doc, "0.25.5", "ac3c5425a80b4b7c4dfecdf51fa9c23a44877124dd8ca34ee45ff608b1c6deb9", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "688cfa538cdc146bc4291607764a7f1fcfa4cce8009ecd62de03b27197528350"}, "makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.15.1", "b5888c880d17d1cc3e598f05cdb5b5a91b7b17ac4eaf5f297cb697663a1094dd", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "db68c173234b07ab2a07f645a5acdc117b9f99d69ebf521821d89690ae6c6ec8"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"}, "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, - "nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.2.0", "b44d75e2a6542dcb6acf5d71c32c74ca88960421b6874777f79153bbbbd7dccc", [:mix], [], "hexpm", "52b2871a7515a5ac49b00f214e4165a40724cf99798d8e4a65e4fd64ebd002c1"}, }