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

Documentation site overhaul #576

Merged
merged 4 commits into from
Nov 18, 2016
Merged

Documentation site overhaul #576

merged 4 commits into from
Nov 18, 2016

Conversation

sritchie
Copy link
Collaborator

@sritchie sritchie commented Nov 18, 2016

This PR adds a lot of documentation. I love to keep PRs small, but it's not worth it for a non-code change like this.

Preview of the documentation site, published to my fork's github page: https://sritchie.github.io/algebird/

Motivation

My goal here was to set up a structure that would allow others to help me with the massive task of documenting algebird via tut. It's much more obvious now how to contribute than it was before - find a page that's either empty or poorly documented, click the "edit" link, write some code and send a PR from your browser.

We're sort of back at wiki status, except we have excellent placeholders for every documentation page we need, AND any code snippets users add will get compiled in the build and can't go out of date. So good!

Changes

  • adds placeholders for docs for all typeclasses
  • adds placeholders for docs for all data types
  • adds a menu with logical groupings for typeclasses and data types
  • all new documentation pages that need work have an "edit" link and links to helpful files (implementation and tests for the data structure)
  • upgrades sbt-microsites to the latest version
  • adds instructions to CONTRIBUTING.md on how to contribute documentation
  • adds docs on how to deploy the microsite after a release
  • adds a webhook to .travis.yml to report build status to our gitter channel
  • fixes the version in README.md
  • makes two methods in ExpHist private[algebird], so they don't pollute the scaladoc
  • moves Roller into its own file
  • removes an explicit dependency on tut
  • adds more talks and presentations

Copy link
Collaborator Author

@sritchie sritchie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some guidepost comments.

@@ -32,3 +32,11 @@ before_cache:
- du -h -d 2 $HOME/.sbt/
- find $HOME/.sbt -name "*.lock" -type f -delete
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this webhook reports our build status to gitter.

<your code>
```

(Please replace `toot` with `tut`!) `tut` will evaluate your code as if you'd pasted it into a REPL and insert each line's results in the output. State persists across `tut` code blocks, so feel free to alternate code blocks with text discussion. See the [tut README](https://github.com/tpolecat/tut) for more information on the various options you can use to customize your code blocks.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was annoying... if I write tut the build will fail.

@@ -194,7 +194,7 @@ object ExpHist {

// Drops all buckets with an expired timestamp, based on the
// configured window and the supplied current time.
def dropExpired(buckets: Vector[Bucket], currTime: Timestamp): (Long, Vector[Bucket]) =
private[algebird] def dropExpired(buckets: Vector[Bucket], currTime: Timestamp): (Long, Vector[Bucket]) =
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we haven't published yet, so it's fine to break here.

@@ -31,38 +31,6 @@ trait Cuber[I] {
def apply(in: I): TraversableOnce[K]
}

/**
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved Roller into its own file.

def apply(in: I): TraversableOnce[K]
}

object Roller {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this data structure has no changes. I moved it out of Cuber.scala.

menu_type: typeclasses

- title: Monad and Friends
url: typeclasses/functor.html
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open to suggestions on the ordering here!

---

# Learning Algebird Monoids at the REPL

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I broke all of these out into their own files.

@@ -1,75 +1,29 @@
# Abstract Algebra
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these get their own files.

---
layout: docs
title: "Abstract Algebra"
section: "typeclasses"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and now this is going to become a discussion of why abstract algebra is useful in programming

addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.11")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.4")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need this explicit dependency. sbt-microsites upgrades will bring it along for the ride.

@sritchie sritchie mentioned this pull request Nov 18, 2016
18 tasks
*(Note - don't use this, use [cats](https://github.com/typelevel/cats))*

Simple implementation of an `Applicative` type-class. There are many choices for the canonical second operation (`join`, `sequence`, `joinWith`, `ap`),
all equivalent. For a `Functor` modeling concurrent computations with failure, like `Future`, combining results with `join` can save a lot of time over combining with `flatMap`. (Given two operations, if the second fails before the first completes, one can fail the entire computation right then. With `flatMap`, one would have to wait for the first operation to complete before failing it.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given two operations, if the second fails before the first completes, one can fail the entire computation right then. With `flatMap`, one would have to wait for the first operation to complete before failing it.

This isn't quite true - if you want your ap/zip to agree with flatMap, you have to wait on the first one to fail, even if the 2nd fails, so that you can surface the error from the first. If the first fails, then you can bail out of the 2nd one early, but not vice versa.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do this ONLY if the Eq[Error] is the trivial one: eqv(a, b) == true.

But yeah, not strictly true in the way the laws are usually written.

@codecov-io
Copy link

codecov-io commented Nov 18, 2016

Current coverage is 64.72% (diff: 100%)

Merging #576 into develop will increase coverage by 0.19%

@@            develop       #576   diff @@
==========================================
  Files           111        111          
  Lines          4572       4572          
  Methods        4154       4154          
  Messages          0          0          
  Branches        379        379          
==========================================
+ Hits           2950       2959     +9   
+ Misses         1622       1613     -9   
  Partials          0          0          

Powered by Codecov. Last update b48b559...69308a2

@sritchie
Copy link
Collaborator Author

💥 and looks like all new docs compile, as expected!

@oscar-stripe
Copy link

lgtm modulo the minor fixup @tixxit suggests

@sritchie sritchie merged commit 776d7a6 into develop Nov 18, 2016
@sritchie sritchie deleted the sritchie/huge_doc_update branch November 18, 2016 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants