Liking cljdoc? Tell your friends :D

hydrox, Parkside Style

Build Status

dive deeper into your code

hydrox logo

Installation

Deps Project:

  1. In your deps.edn, make sure the dev alias is on the latest repl-bootstrap, which includes hydrox and fudje:
  :dev      {:extra-deps
             {parkside-securities/repl-bootstrap {:git/url "git@github.com:parkside-securities/repl-bootstrap.git"
                                                  :sha     "Anything later than e9de50b" }
}
  1. Create the :documentation map in your deps.edn. This is how Hydrox knows where to put generated documents:
:documentation {:site   "test-docs"
                 :output "docs"
                 :template {:path "template"
                            :copy ["assets"]
                            :defaults {:template     "article.html"
                                       :navbar       [:file "partials/navbar.html"]
                                       :dependencies [:file "partials/deps-web.html"]
                                       :navigation   :navigation
                                       :article      :article}}
                 :paths ["test"]
                 :files {"test-docs-name"
                         {:input "test/your_app/docs_test.clj"
                          :title "Your App Tests"
                          :subtitle "change these for your app."}}}}

  1. Create the docs folder in your project. Intialize with a docs/.gitignore that includes the following lines:
*
*/
!.gitignore
# docs contents are generated by hydrox and copied to docker image at runtime 
# generated artifacts shouldn't be checked into git in general.
  1. Create the template folder and copy the templates and assets from this project into it so the documentation generator can access them and they will have a standardized look.

  2. Set up the server for your new files as follows:

  • If you do not already have the latest pedestal in your project, add it to deps.edn, then add to your project according to the pedestal README.
  • In your config.edn, configure pedestal to include a :file-path like so:
:pedestal/service {:service-map  #ig/ref :your-app.pedestal/service
                   :interceptors [whatever the interceptors already were if you've got 'em']
                   :dev?         #duct/env "PEDESTAL_SERVICE_DEV"
                   :file-path    "docs"}
  1. Open the repl with clj -A:dev -e "(dev)(go)" -r

  2. In the repl run:

(generate-docs)

If you have correctly formatted your :documentation map, docs should be generated into your docs folder! If you have correctly set up your pedestal server, you should be able to see the docs at localhost:PORT/test-docs-name.html!

  1. Once it looks good, add the docs generation step to the project's wercker.yml:
 - script:
        name: generate docs
        code: clojure -A:dev -e "(generate-docs)"

Lein Project:

In your project.clj, add hydrox to the [:profiles :dev :dependencies] entry:

(defproject ...
  ...
  :plugins ["lein-hydrox" "0.1.15"]
  :profiles {:dev {:dependencies [...
                                  [helpshift/hydrox "0.1.15"]
                                  ...]}}
  ...)

Leiningen

To initialise a project:

lein hydrox init

To generate documentation (watches project for changes and updates documentation accordingly):

lein hydrox

Original-flavor Hydrox Tutorials

Overview

hydrox assists in the transmission of knowledge around a clojure project, providing in-repl management of documentation, docstrings and metadata through the reuse/repurposing of test code. The tool allows for a design-orientated workflow for the programming process, blurring the boundaries between design, development, testing and documentation.

hydrox overview

Please see the docs for more information (generated using itself).

Links and References:

  • the generated website for hara can be seen here

  • the .html output can be seen for a sample .clj input

License

Copyright © 2015 Helpshift

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close