Franciszek Job
Franciszek Job

Reputation: 388

Use function with backticks name in KDoc @sample

is there a way to use function with backtickts name in @sample in KDoc?

For example, there is a class

class StandardAccount @JvmOverloads constructor(
    override val address: Felt,
    private val signer: Signer,
    private val provider: Provider,
    override val chainId: StarknetChainId,
    private val cairoVersion: CairoVersion = CairoVersion.ONE,
) : Account {
    /**
     * @param address the address of the account contract
     * @param privateKey a private key used to create a signer
     * @param provider a provider used to interact with Starknet
     * @param chainId the chain id of the Starknet network
     * @param cairoVersion the version of Cairo language in which account contract is written
     *
     * Example usage:
     * @sample starknet.account.StandardAccountTest.`creating account with private key`
     */
    @JvmOverloads
    constructor(
        address: Felt,
        privateKey: Felt,
        provider: Provider,
        chainId: StarknetChainId,
        cairoVersion: CairoVersion = CairoVersion.ONE,
    ) : this(
        address = address,
        signer = StarkCurveSigner(privateKey),
        provider = provider,
        chainId = chainId,
        cairoVersion = cairoVersion,
    )
...

and the test class

class StandardAccountTest {
...
@Test
    fun `creating account with private key`() {
        val privateKey = Felt(1234)
        StandardAccount(Felt.ZERO, privateKey, provider, chainId)
    }
...

So ultimately I want to use it like

@sample starknet.account.StandardAccountTest.`creating account with private key`

Unfortunately, I cannot find whether it's possible in kotlin docs. There is existing issue on Github https://github.com/Kotlin/dokka/issues/373 but I can't locate the solution in 1.4.0-rc changelog.

Upvotes: 0

Views: 49

Answers (0)

Related Questions