Code Monkey home page Code Monkey logo

blueprint-docify's Introduction

Blueprint docify

Autogenerate testable and pretty API docs

TL;DR

Add your API spec as api.apib in the root of your repo and push!

It will make great API docs for each branch that has an API blueprint (.apib). Your documents will be available at http://org.github.io/repo/branch. See the branches on this repo and thier related docs:

These are for visual purposes only, do not read as spec

Getting started

  1. Login to Github as yourself

  2. Create a team on your organization named apibot with admin access to the repos you want to docify. This team will help to limit access by being intentional about what repos are added. ie. renewableapibot for this repo.

  3. Create a new Github account for your api bot (ie. renewableapibot). If you're using Google email, append the first part of your email with +bot, like [email protected] so you can verify your account, which is a prerequisite to publishing Github pages.

  4. Create the orphan branch gh-pages on your repo.

  • Use git checkout --orphan gh-pages
  • Delete all of the files in the directory (except .git obviously)
  • Add an empty file with the name .gitignore. (run touch .gitignore)
  • Commit, then push to gh-pages with git push --set-upstream origin gh-pages
  1. Login to Github as the bot

  2. Create a new Shippable account as the bot (login with Github). Add your repo on the settings page.

  3. Copy the Shippable deployment key and add it as an SSH key in Github (not under the repo, under the bot’s account).

Equip your repo

  1. Login to Github as yourself

  2. Pull down this repo and copy the following files to the repo you want to equip:

    blueprint-docify
    package.json
    shippable.yml

    If you already have a package.json then run the following:

    npm install [email protected] --save
    npm install [email protected] --save
    npm install [email protected] --save
    npm install [email protected] --save
  3. Modify line 63 of blueprint-docify/compile_docs.sh in the repo you want to equip.

Now, because of shippable.yml, you should be ready to rock. Shippable should build out your API documentation on push. If you don’t want to run Shippable on a specific push, include [skip ci] in your commit message.

Why it was made

API blueprint is a great new flavor of Markdown for clear API spec. We were using Apiary for a bit, it’s a great place to get started with apib, but it fell short as a production-ready tool for any stack.

Problems with Apiary or any other tool like it:

  • No way to signify if the response or endpoint is a hopeful mock, old and should be deleted, in production, in beta, wont do, etc.
  • Can’t test against API spec with custom conditional notes, etc. What stage is each endpoint, etc.
  • Maintain n number of apiary’s per-branch * per-repo * per-org where n is way too many (more than 1). Where is the documentation with these links? How do you handle elegant naming conventions when it is a shared namespace, ie. http://docs.notelegant.apiary.io/
  • It’s is slow, sometimes down, etc. (it’s another external dependency)
  • Is Github our source of truth? or where do I look? Is that up to date? Where’s the changelog!
  • Please show me the diff between this API and that one (different branches)
  • Apiary only lets me write one file per repo! I have other branches, each with a unique API spec, because the API is in development!

FAQ

Q: Can a private repo write a public Github page? Private repos will write public pages :D

Q: So how does this publish multiple branches docs at once? multiple github pages? It actually pulls gh-pages from your repo to the CI and overwrites the folder with the name of the branch you are pushing to the CI from

Q: So one rendered branch at a time? Yah, when you update an api spec and push, it writes the docs for that branch

Q: What if there’s already an api bot on my repo? If you already have an api bot in your Github organization (someone else followed these steps already), then simply give it access to the required repo(s) and try to add it to the same CI account (doesn’t make sense to spread out CI implementations).

Q: What is this API I see in the examples? We used the example API blueprint from API Blueprint Examples

Q: how many emails you'll get? I believe its just for the Github account confirmation. if the email is in the bot’s public profile on Github, Shippable will grab it and use that email for pass/fail messages.

Roadmap

Thank you!

blueprint-docify's People

Contributors

drusellers avatar kirkstrobeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blueprint-docify's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.