Skip to content

@example seems to fail to parse whole snippet when using decorators #995

Closed
denoland/deno_doc
#769

Description

@andykais

I have the following class docstring: https://jsr.io/@torm/sqlite/1.6.0/drivers/sqlite.ts#L158

/**
  * Migrations are used to upgrade your database structure as you roll out new versions of code. These can be ran automatically, programatically. Torm currently only supports forward migrations. At the end of the day, this class essentially just wraps logic around version numbers and a function call with access to a database driver.
  * @example
  * ```ts
  * const migrations = new MigrationRegistry()
  *
  * @migrations.register()
  * class AddNewColumnMigration extends Migration {
  *   version = '1.1.0'
  *
  *   call() {
  *     this.driver.exec(`ALTER TABLE book ADD COLUMN genre TEXT`)
  *   }
  * }
  *
  * class BookORM extends Torm {}
  *
  * const db = new BookORM('books.db', {migrations})
  * db.init({auto_migrate: false}) // this will prevent torm from automatically running migrations upon startup
  * // this is the general workflow for migrating manually:
  * const current_db_version = db.schemas.version()
  * if (db.migrations.is_database_outdated()) {
  *   db.migrations.upgrade_database()
  * }
  *
  * ```
  */

but the generated example https://jsr.io/@torm/sqlite@1.6.0/doc/~/Migration only shows the first line. If I had to guess, this probably has to do with the javascript decorator @migrations
Image

Activity

  1. moved this to Needs Triage in JSRon Feb 27, 2025
  2. changed the title [-]@example seems to fail to parse whole snippet[/-] [+]@example seems to fail to parse whole snippet when using decorators[/+] on Feb 27, 2025
  3. added theissue type on Mar 12, 2025
  4. moved this from Needs Triage to Needs Plan in JSRon Mar 12, 2025
  5. neonbyte1 commented on Feb 17, 2026

    @neonbyte1

    Yeah, wanted to write a documentation for a package and faced exactly this issue.

  6. moved this from Needs Plan to Done in JSRon Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions