-
Notifications
You must be signed in to change notification settings - Fork 1
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
Why not create a new template for raml2html? #3
Comments
I actually considered it at some point. If you like it though, I'm more than happy to help integrate it in raml2html (which I've been happy user of for quite some time) |
Yea, the goal of raml2html is to output a single html file, so inlining css is a must, and logos would have to be done as a url rather then a local asset I think. If we'd output multiple files the whole command line API would need to change. Inline css is a bit annoying but not a huge problem, and going with a logo url (at least for now) would already better then having no logo at all in raml2html :) It'd be pretty awesome if at some point when you have time, you could fork raml2html's develop branch and add your template to it. It would probably be best to stick with Nunjucks, not sure if that would be a problem? |
I'll give it a shot. I can imagine people liking the compact format as well. |
Just build it as a replacement in your branch/fork. I think it would indeed become the new default one, and then we can think about keeping the old one around later :) |
And yeah no hurry at all of course! |
Thanks Kevin. Agree, it would be good to have only one since mistakes on one could be avoided to be repetitive on the other. I already would have a list for this repo on some missing renderings, but if you ( @wdullaer ) really think about moving the template to raml2html, those things might not really be a problem anymore. :) Still let me know if you want me to raise it. Regarding the new template, I'd say we could store the old in a What do you think? |
BTW, my test base always will be https://github.com/raml2html/raml2html/blob/master/examples/world-music-api.raml :) |
Moving this template into raml2html won't magically make additional features available. Moving this to raml2html will require me rewriting the nunjucks templates to output straight html rather than markdown (tedious but not really hard work) and inlining all the css and javascript. Some features which are harder to port are the fact that you can tweak the colour scheme and pass in a logo. Those things are not supported by raml2html right now, unless I add in a similar build pipeline. |
raml2html 5.0.0 was just released with support for themes, and themes can supply their own rendering logic, so they can use any templating language they want. In fact, raml2md is now rewritten as a theme for raml2html. See https://github.com/raml2html/raml2html/issues/322 for more info. It would be great to have this available as a theme! :) |
Thats awesome @kevinrenskers. |
@kevinrenskers will do! |
I'm nearly done porting this to a raml2html theme. I still need to do some code cleanup, tests and get the language tabs back to work. I expect to put a first version on github next weekend. @kevinrenskers can I add additional configuration items for this theme that can be specified through raml2html? If so, can you give an example? After this, the theme should have feature parity with this repo. However not all raml features are supported at this point. I can really use some help there (mockups etc). |
I'll make sure that any and all cli parameters are passed onto the theme somehow. Then you can just support whatever you want. |
i would be quite keen to test this out as soon as it becomes available. |
I've been struggling to support arbitrary CLI options due to a problem with Commander, see tj/commander.js#609. Hopefully this can be resolved soon. I'll let you know when I more / when it's done. |
I should have a working version up on github by Saturday the latest @kevinrenskers I took a look and see what you mean. I have a potential workaround, but it involves parsing out the theme option manually (once you know the theme, you can pass the commander instance to the theme to attach its own options) |
I think I'll replace Commander with https://github.com/yargs/yargs |
At the moment themes can only return a config object, they don't get anything passed to them. I'll need to change it so that themes can/need to supply a function that gets the program arguments as a param, and returns the config object. |
Ok, raml2html PR is up! raml2html/raml2html#331 |
Oh yeah and about creating a slack / irc / gitter channel.. I don't think I'd ever be online in it to be honest, since I don't want a 24/7 stream of support questions and stuff :) I try to be as hands-off with raml2html as possible, let other people jump in with PR's. If the community decides to start something like this, they have my blessing of course. But at the moment there don't seem to be a lot of contributors, so.. |
raml2html@5.1.0 has been published |
https://github.com/wdullaer/raml2html-slate-theme Works with all new fancy raml2html features If someone can confirm that this is fine for them I'll publish it on npm tomorrow |
Hey! I like the direction you're taking with this template. Since raml2html could definitely use a new default template, why not join efforts and add this template to raml2html? Instead of making a new library that depends on raml2md to render raml -> md -> html in slate style :)
The text was updated successfully, but these errors were encountered: