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

Missing highlighting for json, yaml languages #1669

Closed
dbarzdys opened this issue Jul 4, 2021 · 5 comments · Fixed by #1684
Closed

Missing highlighting for json, yaml languages #1669

dbarzdys opened this issue Jul 4, 2021 · 5 comments · Fixed by #1684

Comments

@dbarzdys
Copy link

dbarzdys commented Jul 4, 2021

I'm using latest redoc-cli right now to generate docs but when I add code json or yaml samples in markdown there are no highlight styling on them.

Is there any option to add these languages for styling?

@saikat-fyers
Copy link

using redoc-cli you are able to build it. ? Let me see the code.

@dbarzdys
Copy link
Author

dbarzdys commented Jul 4, 2021

Can't share exact code since it is private.

But my setup looks something like this:

/openapi.yml

openapi: 3.0.0
info:
  title: Example API
  description:
    $ref: ./README.md
  version: '${version}'
  x-logo:
    url: 'logo.svg'
    backgroundColor: '#FFFFFF'
    altText: "Example"
servers:
  - url: http://localhost:8080
    description: Local

tags:
  - name: echo
    description:
      $ref: ./echo/README.md
    x-displayName: Echo Service

paths:
  # Echo
  /v1/echo:
    $ref: './echo/paths/root.yml'

components:
  schemas:
    $ref: './_schemas.yml'
  securitySchemes:
    $ref: './_security.yml'

/README.md

### Server Configuration

``` yaml
some:
   # Comment
   parameters: here
```

/echo/README.md

### Echo Service Configuration

``` yaml
some:
   # Comment
   parameters: here
```

I run this command from my docker image builder stage:

sed -i "s/\${version}/${VERSION}/g" openapi.yml \
 && swagger-cli bundle openapi.yml --outfile tmp/openapi.yml --type yaml \
 && redoc-cli bundle -o dist/index.html tmp/openapi.yml 

Result builds everything correctly but yaml or json code blocks from markdown that are placed in description have no highlight styling.

@flage
Copy link

flage commented Jul 6, 2021

I have a similar problem. All json, yaml code from markdown files do not have any highlight.

@RomanHotsiy
Copy link
Member

You should also remove the space before the name of the language:

### Echo Service Configuration

``` yaml # <<< here
some:
   # Comment
   parameters: here
```

should be

### Echo Service Configuration

```yaml
some:
   # Comment
   parameters: here
```

@dbarzdys
Copy link
Author

dbarzdys commented Jul 9, 2021

That does not do anything I think. Json and Yaml highlight is still missing after changing that. But programming lang like js, go and others works with or without space.

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

Successfully merging a pull request may close this issue.

4 participants