-
Notifications
You must be signed in to change notification settings - Fork 0
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
Labels
task
Internal task, like adding tests or doing refactorings.
Comments
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
Merged
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
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 throughMdqNodeRef::Inline
orMdqNodeRef::Link
(or::Image
). That's pretty ugly, though.I should:
Link
->LinkDefinition
(not strictly needed, but it's easy and will be useful as I start writing selectors against links and images separately) — renameLink
->LinkDefinition
#54MdqNode
into container blocks, leaf blocks, and inlines (as separate enums) split MdqNode up into more precise enums #57MdqNodeRef
into each of the selectable elements, and then a single variant for "non-selectable, but still displayable". (I'll have to think a bit harder if I actually want to do this one, and maybe play around with it a bit before I decide) move various MdqNodeRefs into NonSelectable #58This effectively blocks link and image selectors
The text was updated successfully, but these errors were encountered: