[dev] Renaming of the AST classes. Concerns all extension and converter writers!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[dev] Renaming of the AST classes. Concerns all extension and converter writers!

Robert.Panzer
Hi,

we've finally made a decision about the new names for the classes of the AST for which a PR is pending.
This post presents the proposed changes.
If anyone has any arguments against these names, this is the time and the place to bring them up.

On the left side you can see the old names, on the right side the new names:

AbstractNode                        ContentNode             
  +- AbstractBlock                   +- StructuralNode
  |   +- Block                       |   +- Block
  |   +- Section         =>          |   +- Section         
  |   +- Document  (Class)           |   +- Document (Interface)
  |   +- ListNode                    |   +- List
  |   +- ListItem                    |   +- ListItem
  |                                  |   +- Table
  +- Inline                          +- PhrasingNode

We chose the name ContentNode for the root node because they all contain content.
If you wonder about the name PhrasingNode, it goes back to the term phrasing content from the HTML5 specification: http://www.w3.org/TR/html5/dom.html#phrasing-content: "Phrasing content is the text of the document, as well as elements that mark up that text at the intra-paragraph level."
StructuralNodes structure the document, so they markup the text at the inter-paragraph level.
There is actually no direct counterpart in HTML5, so-called Flow Content is a super set of Phrasing Content.
We moved from the term Content to Node to keep the relation to the T in AST.

This is currently implemented in the Pull Request https://github.com/asciidoctor/asciidoctorj/pull/371

Before merging we wanted to ask if anyone has objections against these names.

Once the PR is merged all extensions and converters depending on AsciidoctorJ 1.6.0-SNAPSHOT will no longer compile and have to adapt to these changes.

Best regards
Robert
Reply | Threaded
Open this post in threaded view
|

Re: [dev] Renaming of the AST classes. Concerns all extension and converter writers!

ggrossetie
Hi,

I think replacing "Abstract" with something more meaningful is great. I also like the consistency in the naming ("ListNode" > "List").

I'm just not convinced by "PhrasingNode", I think "InlineNode" is better understandable. We could also try to find the opposite of "Structural". On one hand we have StructuralNode and on the other we have "flat", "plain", "inline"... ?

My 2 cents :)
Reply | Threaded
Open this post in threaded view
|

Re: [dev] Renaming of the AST classes. Concerns all extension and converter writers!

mojavelinux
Administrator

On Sun, Aug 9, 2015 at 3:27 PM, ggrossetie [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I'm just not convinced by "PhrasingNode", I think "InlineNode" is better understandable.

What about "PhraseNode"? (Perhaps easier to swallow). In all my terminology research, all signs point to a fragment of a line of text (inline element) being a "phrase". So it's hard to escape how fitting it is.

On the other hand, I'm not opposed to keeping "InlineNode" for now. Discuss.

Reply | Threaded
Open this post in threaded view
|

Re: [dev] Renaming of the AST classes. Concerns all extension and converter writers!

sean.osterberg
I like all the changes, but agree that PhrasingNode sounds less intuitive than InlineNode. Maybe PhraseNode is a little better. I can understand the research behind it and drawing inspiration from the HTML5 spec, but inline seems more intuitive to how I would refer to it in everyday speech. For technical accuracy, maybe Phrase/PhrasingNode is the better choice.