documentationjs / documentationjs/documentation

How to replace ```javascript with ```js static in code blocks ? Is there a way to change the highlight language?

Open
#1,188 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.8k
Forks
481
PR merge metrics
No merged PRs in 30d

Description

Hi all, I have just tested documentjs and it work great.

The author of react-styleguidist recommended documentationjs after someone asked a question https://github.com/styleguidist/react-styleguidist/issues/445#issuecomment-302117671

I have issue with the generated markdown in the context of https://github.com/styleguidist/react-styleguidist

## Type

- [x] Bug

## Reproduction

Generate a JSdoc for a function with `@example` and generate the markdown such as :

```
/**
* @public
* Create config provide our choice of configuration and some dynamic configuration
* @name createConfig
* @param {Object} config for react-styleguidist user configuration
* @param {Object} options for extensions
* @example
* // returns config
* createConfig({}, {});
* @returns {Object} react-styleguidist configuration object
*/
```

The result look like



## createStatus

### Parameters

- `sau`
- `nie`

Returns **[boolean][1]**

## createConfig

### Parameters

- `config` **[Object][2]** for react-styleguidist user configuration
- `options` **[Object][2]** for extensions

### Examples

```javascript
// returns config
createConfig({}, {});
```

Returns **[Object][2]** react-styleguidist configuration object

[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

react-styleguidist recognize the `\```javascript` instead of the recommended `\```js static` for static example. Because of that, it try to render the js inside and this will break the documentation.

![image](https://user-images.githubusercontent.com/1866564/49271893-21939700-f4a2-11e8-845b-d41bd364f63b.png)

For static code highlight they recommend to use `js static` instead of `javascript`.

Is there a way to change the highlight language?

* What version of documentation.js are you using?: `9.0.0-alpha.1`
* How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): CLI

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.