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

How do I make the Code Samples visible ? #46

Closed
girishchawla opened this issue Sep 28, 2017 · 15 comments
Closed

How do I make the Code Samples visible ? #46

girishchawla opened this issue Sep 28, 2017 · 15 comments

Comments

@girishchawla
Copy link

I see [object Object] [ object Object] where I should see the name of a language on the top right. How do I make the language tab show the languages ? I am using petstore.json. I am trying to view the markdown in Whiteboard.

@MikeRalphson
Copy link
Contributor

MikeRalphson commented Sep 28, 2017

I think whiteboard doesn't (yet) support the feature of having separate display names for the language tabs.

You will probably need to override the language_tabs option from something like

language_tabs:
  - shell: Shell
  - http: HTTP
  - javascript: JavaScript
  - javascript--nodejs: Node.JS
  - ruby: Ruby
  - python: Python
  - java: Java

to something like:

language_tabs:
  - shell
  - http
  - html
  - javascript
  - ruby
  - python
  - java

Let me know if you need any more information on doing that, or if it doesn't work for you, and I'll install whiteboard and have a look.

You could modify your copy of whiteboard as per the instructions in the issue linked above, or would using something like shins work as an alternative?

MikeRalphson added a commit that referenced this issue Sep 28, 2017
include whiteboard_env.json
refs #46
@MikeRalphson
Copy link
Contributor

I have made a quick fix, and added a file called whiteboard_env.json which you can load using the -e or --environment command-line options, to use simple strings instead of Objects for the language tab names. Let me know if you're using the npm package, and I will cut a new release.

@girishchawla
Copy link
Author

Yes. I am using npm. Will I still have to make the changes on the Whiteboard side ?

@MikeRalphson
Copy link
Contributor

Yes. I am using npm. Will I still have to make the changes on the Whiteboard side ?

I've just published v2.2.1 with the fix. If you set the language_tabs array to just include strings (either programmatically, or by using an --environment file) you won't need to modify whiteboard.

Please let me know how you get on.

@girishchawla
Copy link
Author

Thanks, Mike. It worked

@girishchawla
Copy link
Author

BTW node widdershins --version still shows 2.2.0 instead of 2.2.1

@MikeRalphson
Copy link
Contributor

BTW node widdershins --version still shows 2.2.0 instead of 2.2.1

Hmm, I hadn't pushed the last commit from the npm publish but that shouldn't have affected it unless you were using a git clone...

@girishchawla
Copy link
Author

Facing another issue with the code samples. When I click on the method within whiteboard I see the code on the right side, but if I click the parameters I see the documentation in the middle pane and the right pane is empty. The resulting experience is very disjointed.This might have something to do with how whiteboard renders the code content, but I am not sure. Do you have any insight about this ?

@MikeRalphson
Copy link
Contributor

I'll spin up whiteboard and have a look!

@MikeRalphson
Copy link
Contributor

I think I see what you mean. While whiteboard creates left-menu sub-headings for parameters and responses etc (which is nice), it doesn't seem to compress the middle column white space to align the middle and right-hand columns...

Are there reasons you need to use whiteboard, or can I push you (again -sorry) to take a quick look at shins - demo here?

@girishchawla
Copy link
Author

OK. Thanks. Will look into shins.

@MikeRalphson
Copy link
Contributor

The alternative would be to re-order some of the sections in widdershins to see if that helped, but at the moment that would mean editing the code in openapi3.js. In a future re-write I hope it will be just the templates that would need editing.

@girishchawla
Copy link
Author

Thanks Mike. Will look at Shins. I did not have any specific reason to go to Whiteboard except that it was easier to install and without the ruby stuff. Shins seems to have the same approach. Wanted to ask an question unrelated to this topic. Maybe I will send you an email directly

@MikeRalphson
Copy link
Contributor

No problem, email on profile page. Looking forward to it.

@MikeRalphson
Copy link
Contributor

Closing as we seem to have resolved the issue - but please feel free to reopen the issue if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants