pkra / laml-wc

A continuation of an experiment
https://pkra.github.io/laml-wc
0 stars 0 forks source link

next steps for ref- #12

Open pkra opened 11 months ago

pkra commented 11 months ago

As expected, #3 is not good enough for all of m522.

As a first complication, there's a ref- pointing to the cantor set figure - not a theorem, thus no label to be found.

pkra commented 11 months ago

Some other scenarios that likely fail

pkra commented 11 months ago

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

pkra commented 11 months ago

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.

pkra commented 11 months ago

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.

pkra commented 11 months ago

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

pkra commented 11 months ago

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.

pkra commented 11 months ago

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.