Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Move documentation generation into WeaselDiesel #30

Merged
merged 6 commits into from
Aug 27, 2013

Conversation

kamui
Copy link
Collaborator

@kamui kamui commented Aug 26, 2013

It's currently in https://github.com/mattetti/wd-sinatra, but it makes more sense in WD itself. This isn't ready to be merged, it's mostly a quick and dirty proof of concept. We should probably discuss whether or not this is the right approach.

In wd_sinatra, it was defined as a rake task. Here I changed it into a weasel_diesel CLI via Thor. It takes 1 required argument, which is the source path, and a second optional argument, which is doc destination path. I had to stub in an implementation method in WeaselDiesel, so that the doc generator could parse the web service definitions.

If you wanted it to read your ruby api files in the api directory, and put the doc in the doc directory, you would use it like:

weasel_diesel api doc

I ran it against my local test wd_sinatra app, and it seems to work.

@ghost ghost assigned kamui Aug 26, 2013
@kamui
Copy link
Collaborator Author

kamui commented Aug 27, 2013

Here's a sample of the theme I created with Bootstrap 3.0. I also managed to fix some quirks with the documentation template.

@mattetti
Copy link
Owner

Seems good to me as long as we can wrap that up in WD Sinatra to make a
simple call to generate the doc (passing the path isn't great user
experience)

On Mon, Aug 26, 2013 at 8:34 PM, Jack Chu notifications@github.com wrote:

Here's a screenshothttp://cl.ly/R2Oo/Screen%20Shot%202013-08-26%20at%2011.32.19%20PM.pngof the theme I created with Bootstrap 3.0. I also managed to fix some
quirks with the documentation template.


Reply to this email directly or view it on GitHubhttps://github.com//pull/30#issuecomment-23311114
.

@kamui
Copy link
Collaborator Author

kamui commented Aug 27, 2013

I agree, but it's necessary for WD to generate documentation since there's no telling where the user might put the ruby files.

I extracted the cli class from the bin. wd_sinatra will wrap that thor function and supply a source path (api). Then you can generate docs from wd_sinatra without a source path like:

thor :generate_doc

@kamui
Copy link
Collaborator Author

kamui commented Aug 27, 2013

I think this can be merged now, unless anyone sees any issues. I have commits for wd_sinatra ready to push once this is merged.

@mattetti
Copy link
Owner

go for it

On Mon, Aug 26, 2013 at 10:10 PM, Jack Chu notifications@github.com wrote:

I think this can be merged now, unless anyone sees any issues. I have
commits for wd_sinatra ready to push once this is merged.


Reply to this email directly or view it on GitHubhttps://github.com//pull/30#issuecomment-23313406
.

kamui added a commit that referenced this pull request Aug 27, 2013
Move documentation generation into WeaselDiesel
@kamui kamui merged commit 7399f8f into mattetti:master Aug 27, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants