Coder Social home page Coder Social logo

next steps for ref- about laml-wc HOT 7 OPEN

pkra avatar pkra commented on July 17, 2024
next steps for ref-

from laml-wc.

Comments (7)

pkra avatar pkra commented on July 17, 2024 1

I'm starting to like the idea that an element is responsible for its ref's.

This would make ref- unnecessary -- we could just just anchors.

from laml-wc.

pkra avatar pkra commented on July 17, 2024

Some other scenarios that likely fail

  • ref- pointing to equation tag, sectioning, or random ids (i.e., some fallback behavior)
  • ref- before its target - will probably cause a timing problem (a target theorem probably hasn't been upgraded by then so the label will be missing) -- could be solved by mutation observer

from laml-wc.

pkra avatar pkra commented on July 17, 2024

We could also try to reverse things - have targets update ref-.

from laml-wc.

pkra avatar pkra commented on July 17, 2024

And of course it doesn't help to have mismatch between ID and ref's target. I fixed a few I must have mucked up when setting up the HTML.

from laml-wc.

pkra avatar pkra commented on July 17, 2024

Here's a random idea: attribute for different types/markup scenarios.

E.g., <ref- thm=thmid> for refs to theorems. Then the code for ref- could more easily be organized into different use cases - and authors could subclass to add more methods for their use cases.

from laml-wc.

pkra avatar pkra commented on July 17, 2024

On second thought, that shouldn't be necessary -- the ID points to an element and we can simply organize by tagName.

from laml-wc.

pkra avatar pkra commented on July 17, 2024

Even better: since we probably want to DRY things, we could have the base class (statement right now) do a this.isStatement = true in its constructor -- then ref- can check against that to decide its code path.

from laml-wc.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.