diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..58340e0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/codox diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..42836c3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,30 @@ +# Contributing Guidelines + +**Do** follow [the seven rules of a great Git commit message][1]. + +**Do** follow [the Clojure Style Guide][2]. + +**Do** include tests for your change when appropriate. + +**Do** ensure that the CI checks pass. + +**Do** squash the commits in your PR to remove corrections +irrelevant to the code history, once the PR has been reviewed. + +**Do** feel free to pester the project maintainers about the PR if it +hasn't been responded to. Sometimes notifications can be missed. + +**Don't** overuse vertical whitespace; avoid multiple sequential blank +lines. + +**Don't** include more than one feature or fix in a single PR. + +**Don't** include changes unrelated to the purpose of the PR. This +includes changing the project version number, adding lines to the +`.gitignore` file, or changing the indentation or formatting. + +**Don't** open a new PR if changes are requested. Just push to the +same branch and the PR will be updated. + +[1]: https://chris.beams.io/posts/git-commit/#seven-rules +[2]: https://github.com/bbatsov/clojure-style-guide diff --git a/README.md b/README.md index a158457..2989d33 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ An opinionated Clojure library wrapping Aerospike Java Client. ![](https://clojars.org/aerospike-clj/latest-version.svg) +# Docs: +[Generated docs](https://appsflyer.github.io/aerospike-clj/) + # Requirements: - Java 8 - Clojure 1.8 diff --git a/project.clj b/project.clj index 48b2f8c..2236d16 100644 --- a/project.clj +++ b/project.clj @@ -6,8 +6,11 @@ :dependencies [[com.aerospike/aerospike-client "4.2.3"] [manifold "0.1.8"] [com.taoensso/timbre "4.10.0"]] + :plugins [[lein-codox "0.10.5"]] + :codox {:output-path "codox" + :source-uri "http://github.com/AppsFlyer/aerospike-clj/blob/{version}/{filepath}#L{line}" + :metadata {:doc/format :markdown}} :profiles {:dev {:dependencies [[org.clojure/clojure "1.10.0"] [criterium "0.4.4"] [cheshire "5.8.1"]] - :global-vars {*warn-on-reflection* true} - :plugins [[lein-codox "0.10.5"]]}}) + :global-vars {*warn-on-reflection* true}}}) diff --git a/src/aerospike_clj/client.clj b/src/aerospike_clj/client.clj index 91fad88..3951b75 100644 --- a/src/aerospike_clj/client.clj +++ b/src/aerospike_clj/client.clj @@ -66,8 +66,10 @@ (defn init-simple-aerospike-client "hosts should be a seq of known hosts to bootstrap from - supported config: {username: string password: string event-loops: com.aerospike.client.async.NioEventLoops - max-commands-in-process: int max-commands-in-queue: int enable-logging: true (default)}" + supported config: + ```clojure + {username: string password: string event-loops: com.aerospike.client.async.NioEventLoops + max-commands-in-process: int max-commands-in-queue: int enable-logging: true (default)}```" ([hosts aero-ns] (init-simple-aerospike-client hosts aero-ns {:enable-logging true})) ([hosts aero-ns conf] @@ -93,7 +95,7 @@ ;; listeners (defprotocol ClientEvents "Continuation functions that are registered when an async DB operation is called. - The DB passed is IAerospikeClient. + The DB passed is an `IAerospikeClient` instance. The value returned from those function will be the value of the returned deferred from the async operation." (on-success [_ op-name op-result index op-start-time db] "A continuation function. Registered on the operation future and called when operations succeeds.") diff --git a/update-docs.sh b/update-docs.sh new file mode 100755 index 0000000..4959976 --- /dev/null +++ b/update-docs.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +echo "cleanup..." +rm -rf codox && mkdir codox +git clone git@github.com:AppsFlyer/aerospike-clj.git codox +cd codox +git symbolic-ref HEAD refs/heads/gh-pages +rm .git/index +git clean -fdx +cd .. +echo "regenerate docs..." + +lein codox + +echo "commit changes" +cd codox +git add . +git commit -am "Update project documentation" +echo "push updated docs..." +git push -v -f -u origin gh-pages +cd .. +echo "done! see updated docs at: https://appsflyer.github.io/aerospike-clj/index.html"