Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reorganize and re-divide MdqNode #53

Closed
4 tasks done
yshavit opened this issue Jun 21, 2024 · 0 comments · Fixed by #60
Closed
4 tasks done

reorganize and re-divide MdqNode #53

yshavit opened this issue Jun 21, 2024 · 0 comments · Fixed by #60
Labels
task Internal task, like adding tests or doing refactorings.

Comments

@yshavit
Copy link
Owner

yshavit commented Jun 21, 2024

Today, MdqNode is sometimes a block, sometimes a leaf, sometimes an inline. When it's an inline, that's all it can say about it -- it can't say that it's a Link specifically, for example.

This is a bit unaesthetic, but it also makes selectors harder than they need to be. For example, you can't write a selector against a Link; it would have to be against an Inline, and do the "is it a link" checking internally, which would mean expanding the selector interface. Alternatively, I could introduce an MdqNodeRef for links, and another for images, and deal with the fact that that means those elements can be referenced either through MdqNodeRef::Inline or MdqNodeRef::Link (or ::Image). That's pretty ugly, though.

I should:

This effectively blocks link and image selectors

@yshavit yshavit added the task Internal task, like adding tests or doing refactorings. label Jun 21, 2024
yshavit added a commit that referenced this issue Jun 21, 2024
yshavit added a commit that referenced this issue Jun 21, 2024
yshavit added a commit that referenced this issue Jun 23, 2024
- MdqNode is either Block or Inline
- Blocks are either Leafs Blocks or Containers
- sort the various node types into those leafs and containers

In service of #53.
yshavit added a commit that referenced this issue Jun 23, 2024
This lets me semi-formally differentiate between elements that are
selectable, and those that cannot be selected but can still be
displayed.

In service of #53
@yshavit yshavit mentioned this issue Jun 23, 2024
yshavit added a commit that referenced this issue Jun 23, 2024
- `MdNode` -> `MdElem`, with associated changes to the macros
- `MdqNodeRef` -> `MdElemRef`

This is during #53, but isn't really needed for that ticket. I just
don't really like the "node" aspect, because it doesn't work as nicely
in my head when we're dealing with a stream of them. In other words: yes
it's a tree, but a lot of times the code is thinking less of its tree
structure and more of it as a "thing that can be streamed".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Internal task, like adding tests or doing refactorings.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant