-
Notifications
You must be signed in to change notification settings - Fork 20
refactor: naming conventions and styling #121
refactor: naming conventions and styling #121
Conversation
dc2162e
to
abdb59c
Compare
abdb59c
to
631f2dc
Compare
- `htmlentities` become `character-reference` - `reference` become `xref` - ordering `explicit` after `code-block` - `code-block` respect conventions - better code blocks patterns
631f2dc
to
5e202ea
Compare
👍 to the name changes. However, for the block attributes, I think we need to step back and reconsider how we are matching. I think we should highlight block attribute lines in a generic way and not try to do special things for special values. For instance, if you write an extension, the following is totally valid:
Case in point, Asciidoctor Diagram introduces a wide range of names to a literal block. See http://asciidoctor.org/docs/asciidoctor-diagram/#creating-a-diagram. What I think we should do is create a matcher for an attribute list in the form of There is a distinction in AsciiDoc between a "structural container", which is a delimited block, and the context (which is the structural container + blockname). See https://github.com/asciidoctor/asciidoctor.org/issues/223 for details. |
We can, of course, match the block attribute lines last so that if you want to do something special for a source block, you still can. |
This make a lot of regression, I've tried and I go back on change. Currently the fixed list of block attributes allow of avoid lot unwanted highlighting I propose to you to open an issue for this subject. |
I canceled the change related to generic block with attributes only because it created many regressions. |
For information, the problem is always the same: we cannot match a specific next or previous line. I works to explore the Oniguruma's specific anchors like |
I'll follow-up with another issue and include some additional ideas. |
I've opened #126 to discuss this change. It's an important one because otherwise we're matching on a limited set of what AsciiDoc allows. |
I moved the second half of that comment to #126. |
Those anchors could definitely play a key role. Keep in mind, however, that what I'm encouraging is a separation between the block attribute list and the structural container. The highlighter should not try to assume a relationship except in the cases we've identified as an exception. |
@nicorikken I need this PR to be merge to continue. This PR contains only naming changes now. I dislike merge without your validation but I'm going to merge. |
449c70c
to
eb261b8
Compare
eb261b8
to
37e1597
Compare
@ldez good you made the call to merged. I'm off in Clojure land now, to wack out a prototype of asciidoctor-clj, a Clojure library to easily integrate AsciidoctorJ. Then my second goals is to use that library in an Asciidoctor Perun plugin. I already did such a plugin previously, but I did all the JRuby stuff myself, and did not use some of the powerful Asciidoctor features. I guess in the coming weeks I'll be less responsive in a similar way. Just catching up this morning ;) Regarding this issue, good discussion. General matching will be nice, but will have some hurdles. So reducing the scope of this refactor is good. 👍 |
Description
htmlentities
becomecharacter-reference
reference
becomexref
code-block
respect conventionsSyntax example
Screenshots