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

Gitbook not rendering @dev properly #26

Open
decafboba opened this issue Feb 20, 2022 · 3 comments
Open

Gitbook not rendering @dev properly #26

decafboba opened this issue Feb 20, 2022 · 3 comments

Comments

@decafboba
Copy link

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.

image

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?

@clemlak
Copy link
Contributor

clemlak commented Feb 21, 2022

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 using npm install @primitivefi/hardhat-dodoc@develop or yarn add @primitivefi/hardhat-dodoc@develop

@decafboba
Copy link
Author

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?

@clemlak
Copy link
Contributor

clemlak commented Mar 7, 2022

Oh really? I'll check this out then, we are updating the Docusaurus template so that's an opportunity to solve potential issues.

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

No branches or pull requests

2 participants