primitive-dodoc
primitive-dodoc copied to clipboard
Gitbook not rendering @dev properly
When using gitbook with dodoc, it seems the @dev
is rendered improperly. For example:
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
creates:
:::note Details Returns the address of the current owner.
:::
Tried with ///
instead of /* */
and still no dice.
Also using the same docusaurus.sql as Primitive:
---
description: {{@if (it.title)}}{{it.title}}{{/if}}
---
{{@if (it.name)}}# {{it.name}}.sol{{/if}}
{{@if (it.notice)}}{{it.notice}}{{/if}}
{{@if (it.details)}}
:::note Details
{{it.details}}
:::
{{/if}}
{{@if (Object.keys(it.methods).length > 0)}}
## Methods
{{@foreach(it.methods) => key, val}}
### {{key}}
{{@if (val.notice)}}{{val.notice}}{{/if}}
solidity title="Solidity"
{{val.code}}
{{@if (val.details)}}
:::note Details
{{val.details}}
:::
{{/if}}
{{@if (Object.keys(val.inputs).length > 0)}}
#### Parameters
| Name | Type | Description |
|---|---|---|
{{@foreach(val.inputs) => key, val}}
| {{key}} | {{val.type}} | {{val.description}}
{{/foreach}}
{{/if}}
{{@if (Object.keys(val.outputs).length > 0)}}
#### Returns
| Name | Type | Description |
|---|---|---|
{{@foreach(val.outputs) => key, val}}
| {{key}} | {{val.type}} | {{val.description}}
{{/foreach}}
{{/if}}
{{/foreach}}
{{/if}}
{{@if (Object.keys(it.events).length > 0)}}
## Events
{{@foreach(it.events) => key, val}}
### {{key}}
{{@if (val.notice)}}{{val.notice}}{{/if}}
solidity title="Solidity"
{{val.code}}
{{@if (val.details)}}
:::note Details
{{val.details}}
:::
{{/if}}
{{@if (Object.keys(val.inputs).length > 0)}}
#### Parameters
| Name | Type | Description |
|---|---|---|
{{@foreach(val.inputs) => key, val}}
| {{key}} {{@if (val.indexed)}}`indexed`{{/if}} | {{val.type}} | {{val.description}} |
{{/foreach}}
{{/if}}
{{/foreach}}
{{/if}}
{{@if (Object.keys(it.errors).length > 0)}}
## Errors
{{@foreach(it.errors) => key, val}}
### {{key}}
{{@if (val.notice)}}{{val.notice}}{{/if}}
solidity title="Solidity"
{{val.code}}
{{@if (val.details)}}
:::note Details
{{val.details}}
:::
{{/if}}
{{@if (Object.keys(val.inputs).length > 0)}}
#### Parameters
| Name | Type | Description |
|---|---|---|
{{@foreach(val.inputs) => key, val}}
| {{key}} | {{val.type}} | {{val.description}} |
{{/foreach}}
{{/if}}
{{/foreach}}
{{/if}}
Any idea how to work around this?
Hey, thanks for reporting this issue!
I think the problem is coming from the missing |
in some arrays of the template. I'm going to publish a new version of Dodoc soon, but if you don't want to wait you can either:
- Fix the error manually by being sure that each line containing
| {{key}} | {{val.type}} | {{val.description}} |
ends with a|
- OR install the
develop
package usingnpm install @primitivefi/hardhat-dodoc@develop
oryarn add @primitivefi/hardhat-dodoc@develop
Just wanted to let you know that the issue currently persists for me after those steps and using the dev branch docusaurus.sqrl. Maybe some other issue?
Oh really? I'll check this out then, we are updating the Docusaurus template so that's an opportunity to solve potential issues.