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 #198

Open
wants to merge 1 commit into
base: main
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
4 changes: 2 additions & 2 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Used by "mix format"
[
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"],
line_length: 120
line_length: 120,
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
# The directory Mix downloads your dependencies sources to.
/deps/

# Where 3rd-party dependencies like ExDoc output generated docs.
# Where third-party dependencies like ExDoc output generated docs.
/doc/
/docs/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch
Expand All @@ -19,3 +18,9 @@ erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Ignore package tarball (built via "mix hex.build").
cocktail-*.tar

# Temporary files, for example, from tests.
/tmp/
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright © 2020 Peek Travel, Inc.
Copyright (c) 2020 Peek Travel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Cocktail ![Cocktail](./logo_with_border.png)
# Cocktail ![Cocktail](./assets/logo_with_border.png)

[![CI
Status](https:/peek-travel/cocktail/workflows/CI/badge.svg)](https:/peek-travel/cocktail/actions)
[![CI Status](https:/peek-travel/cocktail/workflows/CI/badge.svg)](https:/peek-travel/cocktail/actions)
[![codecov](https://codecov.io/gh/peek-travel/cocktail/branch/main/graph/badge.svg)](https://codecov.io/gh/peek-travel/cocktail)
[![Hex.pm Version](https://img.shields.io/hexpm/v/cocktail.svg?style=flat)](https://hex.pm/packages/cocktail)
[![License](https://img.shields.io/hexpm/l/cocktail.svg)](LICENSE.md)
[![Module Version](https://img.shields.io/hexpm/v/cocktail.svg)](https://hex.pm/packages/cocktail)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/cocktail/)
[![Total Download](https://img.shields.io/hexpm/dt/cocktail.svg)](https://hex.pm/packages/cocktail)
[![License](https://img.shields.io/hexpm/l/cocktail.svg)](https:/peek-travel/cocktail/blob/master/LICENSE.md)
[![Last Updated](https://img.shields.io/github/last-commit/peek-travel/cocktail.svg)](https:/peek-travel/cocktail/commits/master)

Cocktail is an Elixir date recurrence library based on [iCalendar events](https://tools.ietf.org/html/rfc5545#section-3.6.1). Its primary use case currently is to expand schedules with recurrence rules into streams of occurrences. For example: say you wanted to represent a repeating schedule of events that occurred every other week, on Mondays, Wednesdays and Fridays, at 10am and 4pm.

Expand All @@ -27,8 +29,7 @@ Then to get a list of the first 10 occurrences of this schedule, you would do:

## Installation

Cocktail is [available in Hex](https://hex.pm/packages/cocktail) and can be installed
by adding `cocktail` to your list of dependencies in `mix.exs`:
Cocktail is [available in Hex](https://hex.pm/packages/cocktail) and can be installed by adding `:cocktail` to your list of dependencies in `mix.exs`:

```elixir
def deps do
Expand Down Expand Up @@ -98,7 +99,7 @@ iex> occurrences = Cocktail.Schedule.occurrences(schedule)
[~N[2017-01-01 00:00:00], ~N[2017-01-02 00:00:00], ~N[2017-01-03 00:00:00]]
```

The type of each occurrence depends on what start time type you used, and wether or not you supplied a duration when creating the schedule.
The type of each occurrence depends on what start time type you used, and whether or not you supplied a duration when creating the schedule.

### Duration

Expand Down Expand Up @@ -155,6 +156,9 @@ iex> i_calendar = Cocktail.Schedule.to_i_calendar(schedule)

Cocktail is heavily inspired by and based on a very similar Ruby library, [ice_cube](https:/seejohnrun/ice_cube).

## License
## Copyright and License

[MIT](LICENSE.md)
Copyright (c)

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.
File renamed without changes
File renamed without changes
38 changes: 20 additions & 18 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
defmodule Cocktail.Mixfile do
use Mix.Project

@source_url "https:/peek-travel/cocktail"
@version "0.10.0"

def project do
[
app: :cocktail,
name: "Cocktail",
source_url: "https:/peek-travel/cocktail",
version: @version,
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
description: description(),
package: package(),
deps: deps(),
docs: docs(),
Expand All @@ -29,33 +28,36 @@ defmodule Cocktail.Mixfile do
[extra_applications: [:logger]]
end

defp description do
"""
Cocktail is a date/time recurrence library for Elixir based on iCalendar events.
It can generate a stream of dates/times based on a set of repeat rules.
"""
end

defp package do
[
files: ["lib", "mix.exs", "README.md", "LICENSE.md"],
description:
"Cocktail is a date/time recurrence library for Elixir " <>
"based on iCalendar events. It can generate a stream of dates/times " <>
"based on a set of repeat rules.",
files: ["lib", "mix.exs", "README.md", "LICENSE.md", "CHANGELOG.md"],
maintainers: ["Chris Dosé"],
licenses: ["MIT"],
links: %{
"GitHub" => "https:/peek-travel/cocktail",
"Readme" => "https:/peek-travel/cocktail/blob/#{@version}/README.md",
"Changelog" => "https:/peek-travel/cocktail/blob/#{@version}/CHANGELOG.md"
"GitHub" => @source_url,
"Readme" => "#{@source_url}/blob/#{@version}/README.md",
"Changelog" => "#{@source_url}/blob/#{@version}/CHANGELOG.md"
}
]
end

defp docs do
[
main: "Cocktail.Schedule",
logo: "logo.png",
extras: [
"CHANGELOG.md": [],
"LICENSE.md": [title: "License"],
"README.md": [title: "Overview"]
],
main: "readme",
assets: "assets",
logo: "assets/logo.png",
source_url: @source_url,
source_ref: @version,
source_url: "https:/peek-travel/cocktail",
extras: ["README.md", "LICENSE.md"]
formatters: ["html"]
]
end

Expand All @@ -79,7 +81,7 @@ defmodule Cocktail.Mixfile do
[
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.23", only: :dev, runtime: false},
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:excoveralls, "~> 0.10", only: :test},
{:timex, "~> 3.6"}
]
Expand Down