Skip to content

Comments are missing in output (typedoc-plugin-markdown) #2035

@chrisui

Description

@chrisui

Search terms

typedoc, markdown, plugin, comments

Expected Behavior

Output markdown file includes comments from doc-blocks.

Actual Behavior

All types and signatures are correctly included in the output documentation but comments have dissapeared.

see my local output my-module.md
[@gaia-family/lib](README.md) / Exports

# @gaia-family/lib

## Table of contents

### References

- [create](modules.md#create)

### Type Aliases

- [Currency](modules.md#currency)
- [Money](modules.md#money)
- [Snapshot](modules.md#snapshot)

### Variables

- [AUD](modules.md#aud)
- [CAD](modules.md#cad)
- [EUR](modules.md#eur)
- [GBP](modules.md#gbp)
- [USD](modules.md#usd)

### Functions

- [add](modules.md#add)
- [allocate](modules.md#allocate)
- [compare](modules.md#compare)
- [convert](modules.md#convert)
- [equal](modules.md#equal)
- [fromDecimal](modules.md#fromdecimal)
- [fromFloat](modules.md#fromfloat)
- [fromSnapshot](modules.md#fromsnapshot)
- [fromUnit](modules.md#fromunit)
- [greaterThan](modules.md#greaterthan)
- [greaterThanOrEqual](modules.md#greaterthanorequal)
- [hasSubUnits](modules.md#hassubunits)
- [haveSameAmount](modules.md#havesameamount)
- [haveSameCurrency](modules.md#havesamecurrency)
- [isNegative](modules.md#isnegative)
- [isPositive](modules.md#ispositive)
- [isZero](modules.md#iszero)
- [lessThan](modules.md#lessthan)
- [lessThanOrEqual](modules.md#lessthanorequal)
- [maximum](modules.md#maximum)
- [minimum](modules.md#minimum)
- [multiply](modules.md#multiply)
- [percentage](modules.md#percentage)
- [pmt](modules.md#pmt)
- [subtract](modules.md#subtract)
- [toFormat](modules.md#toformat)
- [toIntlFormat](modules.md#tointlformat)
- [toSnapshot](modules.md#tosnapshot)
- [toUnit](modules.md#tounit)

## References

### create

Renames and re-exports [fromSnapshot](modules.md#fromsnapshot)

## Type Aliases

### Currency

Ƭ **Currency**<`TAmount`\>: `Object`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Type declaration

| Name | Type |
| :------ | :------ |
| `base` | `TAmount` |
| `code` | `string` |
| `exponent` | `TAmount` |

#### Defined in

node_modules/@dinero.js/currencies/dist/esm/types/Currency.d.ts:1

___

### Money

Ƭ **Money**<`Amount`\>: `Dinero`<`Amount`\>

#### Type parameters

| Name | Type |
| :------ | :------ |
| `Amount` | `number` |

#### Defined in

[shared/lib/src/money.ts:63](https://github.com/gaia-family/monorepo/blob/9e90b421/shared/lib/src/money.ts#L63)

___

### Snapshot

Ƭ **Snapshot**<`TAmount`\>: `Object`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Type declaration

| Name | Type |
| :------ | :------ |
| `amount` | `TAmount` |
| `currency` | [`Currency`](modules.md#currency)<`TAmount`\> |
| `scale` | `TAmount` |

#### Defined in

node_modules/@dinero.js/core/dist/esm/types/DineroSnapshot.d.ts:2

## Variables

### AUD

• `Const` **AUD**: [`Currency`](modules.md#currency)<`number`\>

#### Defined in

node_modules/@dinero.js/currencies/dist/esm/iso4217/amendments/168/aud.d.ts:5

___

### CAD

• `Const` **CAD**: [`Currency`](modules.md#currency)<`number`\>

#### Defined in

node_modules/@dinero.js/currencies/dist/esm/iso4217/amendments/168/cad.d.ts:5

___

### EUR

• `Const` **EUR**: [`Currency`](modules.md#currency)<`number`\>

#### Defined in

node_modules/@dinero.js/currencies/dist/esm/iso4217/amendments/168/eur.d.ts:5

___

### GBP

• `Const` **GBP**: [`Currency`](modules.md#currency)<`number`\>

#### Defined in

node_modules/@dinero.js/currencies/dist/esm/iso4217/amendments/168/gbp.d.ts:5

___

### USD

• `Const` **USD**: [`Currency`](modules.md#currency)<`number`\>

#### Defined in

node_modules/@dinero.js/currencies/dist/esm/iso4217/amendments/168/usd.d.ts:5

## Functions

### add

▸ **add**<`TAmount`\>(...`__namedParameters`): `Dinero`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `AddParams`<`TAmount`\> |

#### Returns

`Dinero`

#### Defined in

node_modules/dinero.js/dist/esm/api/add.d.ts:10

___

### allocate

▸ **allocate**<`TAmount`\>(...`__namedParameters`): `Dinero`[]

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `AllocateParams`<`TAmount`\> |

#### Returns

`Dinero`[]

#### Defined in

node_modules/dinero.js/dist/esm/api/allocate.d.ts:10

___

### compare

▸ **compare**<`TAmount`\>(...`__namedParameters`): `ComparisonOperator`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `CompareParams`<`TAmount`\> |

#### Returns

`ComparisonOperator`

#### Defined in

node_modules/dinero.js/dist/esm/api/compare.d.ts:10

___

### convert

▸ **convert**<`TAmount`\>(...`__namedParameters`): `Dinero`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `ConvertParams`<`TAmount`\> |

#### Returns

`Dinero`

#### Defined in

node_modules/dinero.js/dist/esm/api/convert.d.ts:11

___

### equal

▸ **equal**<`TAmount`\>(...`__namedParameters`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `EqualParams`<`TAmount`\> |

#### Returns

`boolean`

#### Defined in

node_modules/dinero.js/dist/esm/api/equal.d.ts:10

___

### fromDecimal

▸ **fromDecimal**(`value`, `currency`): `Dinero`<`number`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `value` | `DecimalJsLike` |
| `currency` | [`Currency`](modules.md#currency)<`number`\> |

#### Returns

`Dinero`<`number`\>

#### Defined in

[shared/lib/src/money.ts:160](https://github.com/gaia-family/monorepo/blob/9e90b421/shared/lib/src/money.ts#L160)

___

### fromFloat

▸ **fromFloat**(`float`, `currency`): `Dinero`<`number`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `float` | `number` |
| `currency` | [`Currency`](modules.md#currency)<`number`\> |

#### Returns

`Dinero`<`number`\>

#### Defined in

[shared/lib/src/money.ts:139](https://github.com/gaia-family/monorepo/blob/9e90b421/shared/lib/src/money.ts#L139)

___

### fromSnapshot

▸ **fromSnapshot**(`__namedParameters`): `Dinero`<`number`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `__namedParameters` | `DineroOptions`<`number`\> |

#### Returns

`Dinero`<`number`\>

#### Defined in

node_modules/dinero.js/dist/esm/dinero.d.ts:10

___

### fromUnit

▸ **fromUnit**(`float`, `currency`): `Dinero`<`number`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `float` | `number` |
| `currency` | [`Currency`](modules.md#currency)<`number`\> |

#### Returns

`Dinero`<`number`\>

#### Defined in

[shared/lib/src/money.ts:139](https://github.com/gaia-family/monorepo/blob/9e90b421/shared/lib/src/money.ts#L139)

___

### greaterThan

▸ **greaterThan**<`TAmount`\>(...`__namedParameters`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `GreaterThanParams`<`TAmount`\> |

#### Returns

`boolean`

#### Defined in

node_modules/dinero.js/dist/esm/api/greaterThan.d.ts:10

___

### greaterThanOrEqual

▸ **greaterThanOrEqual**<`TAmount`\>(...`__namedParameters`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `GreaterThanOrEqualParams`<`TAmount`\> |

#### Returns

`boolean`

#### Defined in

node_modules/dinero.js/dist/esm/api/greaterThanOrEqual.d.ts:10

___

### hasSubUnits

▸ **hasSubUnits**<`TAmount`\>(...`dineroObject`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...dineroObject` | `HasSubUnitsParams`<`TAmount`\> |

#### Returns

`boolean`

#### Defined in

node_modules/dinero.js/dist/esm/api/hasSubUnits.d.ts:9

___

### haveSameAmount

▸ **haveSameAmount**<`TAmount`\>(...`dineroObjects`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...dineroObjects` | `HaveSameAmountParams`<`TAmount`\> |

#### Returns

`boolean`

#### Defined in

node_modules/dinero.js/dist/esm/api/haveSameAmount.d.ts:9

___

### haveSameCurrency

▸ **haveSameCurrency**<`TAmount`\>(`dineroObjects`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `dineroObjects` | readonly `Dinero`<`TAmount`\>[] |

#### Returns

`boolean`

#### Defined in

node_modules/@dinero.js/core/dist/esm/api/haveSameCurrency.d.ts:2

___

### isNegative

▸ **isNegative**<`TAmount`\>(...`dineroObject`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...dineroObject` | `IsNegativeParams`<`TAmount`\> |

#### Returns

`boolean`

#### Defined in

node_modules/dinero.js/dist/esm/api/isNegative.d.ts:9

___

### isPositive

▸ **isPositive**<`TAmount`\>(...`dineroObject`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...dineroObject` | `IsPositiveParams`<`TAmount`\> |

#### Returns

`boolean`

#### Defined in

node_modules/dinero.js/dist/esm/api/isPositive.d.ts:9

___

### isZero

▸ **isZero**<`TAmount`\>(...`dineroObject`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...dineroObject` | `IsZeroParams`<`TAmount`\> |

#### Returns

`boolean`

#### Defined in

node_modules/dinero.js/dist/esm/api/isZero.d.ts:9

___

### lessThan

▸ **lessThan**<`TAmount`\>(...`__namedParameters`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `LessThanParams`<`TAmount`\> |

#### Returns

`boolean`

#### Defined in

node_modules/dinero.js/dist/esm/api/lessThan.d.ts:10

___

### lessThanOrEqual

▸ **lessThanOrEqual**<`TAmount`\>(...`__namedParameters`): `boolean`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `LessThanOrEqualParams`<`TAmount`\> |

#### Returns

`boolean`

#### Defined in

node_modules/dinero.js/dist/esm/api/lessThanOrEqual.d.ts:10

___

### maximum

▸ **maximum**<`TAmount`\>(...`dineroObjects`): `Dinero`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...dineroObjects` | `MaximumParams`<`TAmount`\> |

#### Returns

`Dinero`

#### Defined in

node_modules/dinero.js/dist/esm/api/maximum.d.ts:9

___

### minimum

▸ **minimum**<`TAmount`\>(...`dineroObjects`): `Dinero`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...dineroObjects` | `MinimumParams`<`TAmount`\> |

#### Returns

`Dinero`

#### Defined in

node_modules/dinero.js/dist/esm/api/minimum.d.ts:9

___

### multiply

▸ **multiply**<`TAmount`\>(...`__namedParameters`): `Dinero`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `MultiplyParams`<`TAmount`\> |

#### Returns

`Dinero`

#### Defined in

node_modules/dinero.js/dist/esm/api/multiply.d.ts:10

___

### percentage

▸ **percentage**(`value`, `share`): `Dinero`<`number`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `value` | `Dinero`<`number`\> |
| `share` | `number` |

#### Returns

`Dinero`<`number`\>

#### Defined in

[shared/lib/src/money.ts:125](https://github.com/gaia-family/monorepo/blob/9e90b421/shared/lib/src/money.ts#L125)

___

### pmt

▸ **pmt**(`ratePerPeriod`, `periods`, `presentValue`, `futureValue`, `due`): `Dinero`<`number`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `ratePerPeriod` | `number` |
| `periods` | `number` |
| `presentValue` | `Dinero`<`number`\> |
| `futureValue` | `Dinero`<`number`\> |
| `due` | ``"end"`` \| ``"beginning"`` |

#### Returns

`Dinero`<`number`\>

#### Defined in

[shared/lib/src/money.ts:76](https://github.com/gaia-family/monorepo/blob/9e90b421/shared/lib/src/money.ts#L76)

___

### subtract

▸ **subtract**<`TAmount`\>(...`__namedParameters`): `Dinero`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `SubtractParams`<`TAmount`\> |

#### Returns

`Dinero`

#### Defined in

node_modules/dinero.js/dist/esm/api/subtract.d.ts:10

___

### toFormat

▸ **toFormat**<`TAmount`\>(...`__namedParameters`): `string`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...__namedParameters` | `ToFormatParams`<`TAmount`\> |

#### Returns

`string`

#### Defined in

node_modules/dinero.js/dist/esm/api/toFormat.d.ts:10

___

### toIntlFormat

▸ **toIntlFormat**(`value`, `locale?`, `options?`): `string`

#### Parameters

| Name | Type | Default value |
| :------ | :------ | :------ |
| `value` | `Dinero`<`number`\> | `undefined` |
| `locale` | `string` \| `string`[] | `'en-GB'` |
| `options` | `Omit`<`NumberFormatOptions`, ``"style"`` \| ``"currency"``\> | `{}` |

#### Returns

`string`

#### Defined in

[shared/lib/src/money.ts:172](https://github.com/gaia-family/monorepo/blob/9e90b421/shared/lib/src/money.ts#L172)

___

### toSnapshot

▸ **toSnapshot**<`TAmount`\>(`dineroObject`): `DineroSnapshot`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `dineroObject` | `Dinero`<`TAmount`\> |

#### Returns

`DineroSnapshot`

#### Defined in

node_modules/@dinero.js/core/dist/esm/api/toSnapshot.d.ts:2

___

### toUnit

▸ **toUnit**<`TAmount`\>(...`dineroObject`): `number`

#### Type parameters

| Name |
| :------ |
| `TAmount` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `...dineroObject` | `ToUnitParams`<`TAmount`\> |

#### Returns

`number`

#### Defined in

node_modules/dinero.js/dist/esm/api/toUnit.d.ts:11

Steps to reproduce the bug

Ensure typedoc-plugin-markdown is installed and run typedoc my-module.ts where my-module.ts has the below contents:

/**
 * # Money
 *
 * This module contains utility functions and a facade over dinero.js
 * api, aiming to minimise abuse of these magic-but-dangerous objects
 * and bridging the translation gap between different contexts such as
 * user input, database storage and json/graphql transports
 *
 * We also include a few financial utilities such as pmt for calculating
 * fixed-interest-periodic repayment values.
 *
 * @module
 * @see https://v2.dinerojs.com/docs/api/mutations/add for full dinero.js api reference
 */

import {
  dinero,
  Dinero,
  toSnapshot,
  allocate,
  DineroSnapshot,
  Currency,
  toFormat,
} from 'dinero.js'

import { assert } from './assert'
import { DecimalJsLike } from './decimal'

export { GBP, USD, EUR, CAD, AUD } from '@dinero.js/currencies'

export type { DineroSnapshot as Snapshot, Currency }

export {
  toUnit,
  dinero as fromSnapshot,
  dinero as create,
  toSnapshot,
  allocate,
  multiply,
  add,
  subtract,
  convert,
  equal,
  compare,
  greaterThan,
  greaterThanOrEqual,
  lessThan,
  lessThanOrEqual,
  minimum,
  maximum,
  isZero,
  isPositive,
  isNegative,
  haveSameAmount,
  haveSameCurrency,
  hasSubUnits,
  toFormat,
} from 'dinero.js'

/**
 * Monetary represenation, by default using `number` as stored value
 */
export type Money<Amount = number> = Dinero<Amount>


/**
 * Create a dinero object from a float unit snapshot - an inverse of the
 * money.toUnit() utility
 *
 * @see toUnit
 * @see https://v2.dinerojs.com/docs/faq/how-can-i-create-dinero-objects-from-floats
 */
export const fromUnit = (float: number, currency: Currency<number>) => {
  const factor = currency.base ** currency.exponent
  const amount = Math.round(float * factor)

  return dinero({ amount, currency })
}

/**
 * Prefer money.fromUnit() with same signature
 *
 * @deprecated
 * @see fromUnit
 */
export const fromFloat = fromUnit

/**
 * Create a dinero object from a decimal.js / Prisma.Decimal value
 *
 * @see fromFloat
 * @see https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#postgresql-5
 */
export const fromDecimal = (
  value: DecimalJsLike,
  currency: Currency<number>
) => {
  return fromUnit(value.toNumber(), currency)
}

/**
 * Format a monetary (dinero) value to a localised format
 *
 * @see https://v2.dinerojs.com/docs/guides/formatting-in-a-multilingual-site
 */
export const toIntlFormat = (
  value: Dinero<number>,
  locale: string | string[] = 'en-GB',
  options: Omit<Intl.NumberFormatOptions, 'style' | 'currency'> = {}
) => {
  return toFormat(value, ({ amount, currency }) =>
    amount.toLocaleString(locale, {
      minimumFractionDigits: 0,
      ...options,
      style: 'currency',
      currency: currency.code,
    })
  )
}

Environment

% npm ls typedoc
...
├─┬ docusaurus-plugin-typedoc@0.17.5
│ └── typedoc@0.23.9 deduped
├─┬ typedoc-plugin-markdown@3.12.1
│ └── typedoc@0.23.9 deduped
└── typedoc@0.23.9
  • Typedoc version: 0.23.9
  • TypeScript version: Version 4.5.5
  • Node.js version: v16.15.0
  • OS: Mac OSX

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions