Skip to content

allow cell names as top-level variables regardless of type #72

Closed

Description

@shadoof

In Observable 1.x any cell could be given a name, and this name would immediately operate as a top level constant. This no longer holds for 2.0.

In 1.x the cell name also became the (id?/name?) attribute of its HTML rendering. This allowed an elegant way to:

  • operate on the value of any cell that was, effectively, an HTML Element: e.g. [cellName].innerText
  • and also had the side benefit of providing anchors for links across documents: @[notebookName]#[cellName] gave automatic browser navigation to a cell.

Many of my notebooks are broken by this in Observable 2.0 so I am noting this issue as a bug. But I'd also love to see it carried it over and supported as a feature which recognizes the equal status of text-as-data, especially when using the actual text (as-data) of the notebooks that you are reading is so much in the spirit of the Literate Programming that Observable champions.

BTW, I love what you are doing with Observable Notebooks 2.0.

Activity

  1. locked and limited conversation to collaborators on Sep 2, 2025
  2. converted this issue into a discussion #73 on Sep 2, 2025
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

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions