wdullaer / raml2html-slate-theme Goto Github PK
View Code? Open in Web Editor NEWA slate inspired theme for raml2html
License: MIT License
A slate inspired theme for raml2html
License: MIT License
Branch | Build failing 🚨 |
---|---|
Dependency | raml2html |
Current Version | 6.1.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As raml2html is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
The new version differs by 9 commits .
59bbc02
Update 3rd party dependencies
2db451e
Merge branch 'master' into develop
8dbed7a
Added contributing steps to the readme
cb38f02
Use the github name of raml-js-parser-2
2178bab
Simplify readme
97dfa57
Use new raml2obj and new default theme. Update versions, and remove now unused code.
3511834
We don't need glob
7f88548
We have multiple examples
e587273
Fix test script
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
When I switch from the 'response' to the 'body' tab the page refreshes completely and I am back to the original state. Would it be possible to keep where I am, for example on a specific resource, and I can switch the content?
Hey, first of all: great template.
We have descriptions set on our reponse status codes. For example:
responses:
200:
description: |
- Returns one job, if any action is required.
- Each job contains `jobType`, `jobId` and an `executeTime`.
- Jobs can additionally contain a set of requirements (`required`) which must be met before executing the job.
- The optional `meta` property contains jobspecific informations.
204:
description: Returns an empty answer, if no jobs are available.
Could you display the reponse status codes including description on the right hand side?
We thought of a structure like:
CURL Example
...
Response 200
... Description ...
Reponse Body
... Examples ...
Response 204
... Description ...
Reponse Body
... Examples ...
If you have a readme or guide on how to add missing parts of the raml specification to the theme, we'd be glad to support you with pull requests, too.
Under responses, I have 2 response types.
200 is rendered but 404 isn't.
When specifying that a resource is securedBy
as entry in the securitySchemes
, the curl command generated for that resource does not include the relevant headers, thus creating an incomplete curl request. The supported security schemes list is finite, and most involve setting HTTP headers, such as Authorization
or X-API-Key
. The definitions of securitySchemes are pretty expressive, too.
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
package.json
files, so that was left aloneIf you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Running the following command to generate the color theme
$ raml2html --theme "raml2html-slate-theme" -o "myhtml.html" -i "myraml.raml" --generate-color-theme
Get the following output:
[...]
////////////////////////////////////////////////////////////////////////////////
// INTERNAL
////////////////////////////////////////////////////////////////////////////////
// These settings are probably best left alone.
$break-words
-ms-word-break: break-all
word-break: break-all
/* Non standard for webkit */
word-break: break-word
-webkit-hyphens: auto
-moz-hyphens: auto
hyphens: auto
internal/fs/utils.js:259
throw err;
^
Error: ENOENT: no such file or directory, lstat '.../node_modules/raml2html-slate-theme/index.nunjucks'
at Object.realpathSync (fs.js:1646:7)
at getConfigForTemplate (/.../node_modules/raml2html/index.js:68:41)
at Object.getConfigForTheme (/.../node_modules/raml2html/index.js:156:12)
at Object. (/.../node_modules/raml2html/bin/raml2html:69:22)
at Module._compile (internal/modules/cjs/loader.js:1176:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
errno: -2,
syscall: 'lstat',
code: 'ENOENT',
path: '/.../node_modules/raml2html-slate-theme/index.nunjucks'
Currently it is not possible to specify parameters and "x-www-form-urlencoded" them.
As an example:
body:
application/x-www-form-urlencoded:
properties:
name:
description: name on account
type: string
example: Naruto Uzumaki
gender:
enum: ["male", "female"]
This renders to:
Instead it should show an example like:
curl -d "name=Naruto Uzumaki&gender=male" -X POST https://example.com/oauth2/token
This is especially problematic, as one wants to describe an oauth flow, which "x-www-form-urlencoded" its parameters.
Sidenote: It was also requested here: https://github.com/raml2html/raml2html/issues/386
Hi,
Thanks for the theme. It is really good to see other layouts.
I have some RAML response body like below and I cannot see the type (schema) reference in RAML is shown in the final HTML. is it possible to do so ?
The type is defined at the beginning of the RAML using types:
. I tried to play with but can only output the word "xml". How can we show "type" as like "orders" and may be provide a link to type schema defined in the beginning.
responses:
200:
.....
body:
application/xml:
description: XML representation of the list of orders
type: order
example: !include examples/order.xml
Is there any possibility to have tabs when someone defined multiple examples with the name each tab reflecting the key name of an example? For example:
examples:
test1: |
{
"address_country": "terte",
"address_locality": "ertth",
"address_region": "dgere",
"postal_code": "sdfsdg",
"street_address": "gdfgdfg"
}
test2: |
{
"address_country": "terte",
"address_locality": "ertth",
"address_region": "dgere",
"postal_code": "sdfsdg",
"street_address": "gdfgdfg"
}
I would expect two tabs called test1
and test2
with the respective content.
At the moment each example is put under the other.
Hi @wdullaer,
First, very nice work - looks great and having it as a theme for raml2html is definitely a great win!
Second, can you highlight what things are currently not supported so that I know what to look out for and not raise as a bug :)
My test base is the this example (also the one that raml2html has) and there are information not rendered yet.
Thanks,
Christian
Hi and thanks for the great work on this theme!
I have an issue with the following raml file:
#%RAML 1.0
title: API title
version: v0
documentation:
- title: API title 2
baseUri: https://stuff.net/v0/d
mediaType: application/json
/import:
displayName: import displayname
post:
description: Creates a some stuff
body:
application/json:
type: !include messages/import_job_post_request.json
responses:
201:
description: |
Some stuff
body:
application/json:
type: !include messages/import_job_post_response.json
The schemas are not resolved.
Is it because they are not in the RAML file itself?
Would it be possible to update the theme so that it digs into the json schema files?
Thanks for the info!
Hello,
I'm receiving this error when I'm trying to run the command for doc generation:
error: ENOENT: no such file or directory, lstat '/usr/lib/node_modules/raml2html-slate-theme/index.nunjucks'
Steps to reproduce:
1 - install the raml2html slate theme
2 - run the command to generate the doc
Env :
CentOS 7
RAML 1.0
Nodejs : v6.9.1
ps : I can successfully generate the doc with the default theme
and this is my /usr/lib/node_modules/raml2html-slate-theme/ content :
⚡ root@my-sexy-server /usr/lib/node_modules/raml2html-slate-theme ll
total 28K
-rw-r--r-- 1 nobody root 6.0K Jun 25 08:30 index.js
-rw-r--r-- 1 nobody root 1.1K May 24 13:06 LICENSE
drwxr-xr-x 129 root root 4.0K Jul 3 08:59 node_modules
-rw-r--r-- 1 nobody root 3.4K Jul 3 08:59 package.json
-rw-r--r-- 1 nobody root 3.4K Jun 25 08:30 README.md
drwxr-xr-x 5 nobody root 134 Jul 3 08:59 templates
Hi,
I just picked up the plugin and found that it's giving a large blob of JSON sitting right at the top of the site. Not sure what's going on, but I'd be happy to give any more details if it helps.
Branch | Build failing 🚨 |
---|---|
Dependency | eslint-config-standard |
Current Version | 10.2.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As eslint-config-standard is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
Hey,
just found out that this theme doesn't support description
in examples:
element. It do not render it.
responses:
200:
body:
application/json:
type: OrdersResponse
examples:
responseOne:
description: Example response for response one.
body: { ... }
This renders just response with OrdersResponse
and return code
and body
.
Many thanks.
I wanted to give this a try, but cannot install the theme NPM package:
npm install -g raml2html-slate-theme
gives me ...
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "raml2html-slate-theme"
npm ERR! node v7.6.0
npm ERR! npm v4.1.2
npm ERR! Cannot read property 'path' of null
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/wis3guy/Projects/foo-bar-baz/npm-debug.log
Unsure wether this has something to do with the NPM package ...
Given the following YAML:
/users:
displayName: Users
post:
displayName: Create a user
I'd expect to see the following hierarchy in the table of contents:
+ Users
+ Create a user
As a result, I think there should be an additional if
statement here:
None of the type information are actually rendered. I tried JSON schema, XSD, and RAML data types, but don't see these information. Is this a bug or not yet implemented?
I'm using node v10.7.0 from Void Linux repository (musl instead of glibc). I installed raml2html and raml2html-slate-theme globally as per the instructions.
npm install -g raml2html
npm install -g raml2html-slate-theme
With this theme, the resulting HTML file is created, although with a length of 0 bytes. All the other themes from https://www.npmjs.com/search?q=keywords:raml2html-theme are producing the HTML file with content (except raml2html-werk-theme, which spews some template error).
This info must be very vague. What else can I provide?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.