Skip to content

Add new checker MicSecondaryRoot#1100

Merged
Ducasse merged 6 commits into
pillar-markup:devfrom
AntoineUsal:MicSecondaryRootBlock
Jun 11, 2026
Merged

Add new checker MicSecondaryRoot#1100
Ducasse merged 6 commits into
pillar-markup:devfrom
AntoineUsal:MicSecondaryRootBlock

Conversation

@AntoineUsal

Copy link
Copy Markdown
Collaborator

Fix #1099

@Ducasse

Ducasse commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Hi antoinre this is an excellent start.
Now we should check the tests of the fileIncluder to be sure that the secondary is indeed used.

We should check that the filename is well stored in the secondaryRoot.
fromFile: just buble up to the document root and it will naturally hit the secondary root and this is ok.

Probably in practice we will need something like

micElement root
vs.
micElement mainRoot

We will see.

]

{ #category : 'testing' }
MicChecker >> visitSecondaryRootBlock: aSecondaryRootBlock [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a visitSecondaryRootBlock: in the default MicrodownVisitor it can just call the logic of rootblock eg. visitRootBlock:

]

{ #category : 'debugging' }
MicRootBlock >> isSecondaryRoot [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be smarter. I wonder. Because a main root block parent is nil while by construction a secondaryRootBlock should be nested into something.

#name : 'MicSecondaryRootBlock',
#superclass : 'MicRootBlock',
#instVars : [
'file'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look in the superclass fromFile is already defined so
either we use fromFile implementation (I do not remember but may be it was with managed with a property and we could move it using an instance variable (and remove the implementation in secondaryRootBlock

@Ducasse

Ducasse commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Can you have a look at the test of fileIncluder and see how we extend them to take into account the use of MicSecondaryRootBlock?

@Ducasse

Ducasse commented Jun 10, 2026

Copy link
Copy Markdown
Contributor
  • #testIncluderIncludesInputFileFromTheSameLevel (11ms)
  • #testMicFileInclusionTransformMicInputFiles (4ms)
  • #testIncluderIncludesInputFilesWithinTheSameParagraph (2ms)
  • #testHandleNestedFileResolution (4ms)
  • #testHandleNestedFileResolutionOnDifferentLevel (2ms)


{ #category : 'testing' }
MicSecondaryRootBlock >> fromFile: aFileOrResource [
self propertyAt: #file put: aFileOrResource

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je pense que nous avons la meme methode dans la superclasse

@Ducasse Ducasse merged commit d5bdb75 into pillar-markup:dev Jun 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inputFile and line number

2 participants