Skip to content

Migrate some old macros to new syntax#8768

Merged
Jermolene merged 8 commits intoTiddlyWiki:masterfrom
Leilei332:macro-new-syntax
Dec 5, 2024
Merged

Migrate some old macros to new syntax#8768
Jermolene merged 8 commits intoTiddlyWiki:masterfrom
Leilei332:macro-new-syntax

Conversation

@Leilei332
Copy link
Contributor

@Leilei332 Leilei332 commented Nov 21, 2024

Migrate some old macros like colour-picker, translink to use new syntax.

The colour-picker macro has been updated to solve the problem mentioned in #8606 (comment).

@github-actions
Copy link

Confirmed: Leilei332 has already signed the Contributor License Agreement (see contributing.md)

@netlify
Copy link

netlify bot commented Nov 21, 2024

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit d35454d
🔍 Latest deploy log https://app.netlify.com/sites/tiddlywiki-previews/deploys/674ef81dbbfbad000855a78c
😎 Deploy Preview https://deploy-preview-8768--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

\procedure colour-picker-recent-inner(actions)
\whitespace trim
<$set name="colour-picker-value" value="$(recentColour)$">
<$macrocall $name="colour-picker-inner" actions=<<__actions__>>/>
Copy link
Member

Choose a reason for hiding this comment

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

@Jermolene -- Do we really need to convert <$macrocall to a <$transclude $variable -- I personally like the macrocall much more, since it is a 100 times more verbose and human readable than the transclusion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For me the reason is that macrocall widget is marked deprecated since v5.3.0.

Copy link
Contributor

@kookma kookma Nov 22, 2024

Choose a reason for hiding this comment

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

I also support $transclude. This makes learning easier.
Also procedures replace macros, so $macrocall for procedures is a bit confusing. All in all $transclude is my favorite to go.

Copy link
Member

Choose a reason for hiding this comment

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

Yes I think we have decided to deprecate the <$macrocall> widget. I am not against trying evolving the shortcut syntax. It would be very nice to be able to just do something like <<colour-picker-inner actions=<<actions>>>>.

@Leilei332 Leilei332 marked this pull request as ready for review November 24, 2024 10:40
@pmario
Copy link
Member

pmario commented Dec 1, 2024

@Leilei332 -- It's a bit problematic, that there are so many different macros in 1 PR. -- If one of them causes a problem in the future, the whole PR will be reverted.

So I think it makes more sense to split this PR into several smaller ones. I have had that problem several times already. It is very frustrating if 8 files get reverted, but only one of them causes a problem.


For procedures \whitespace trim will be inherited. So you can move it to the top of the file. All the procedures will get that info.

@Leilei332
Copy link
Contributor Author

I think only the thumbnail macro is problematic. For other macros the change isn't very big, they can be kept here.

@pmario
Copy link
Member

pmario commented Dec 2, 2024

I think only the thumbnail macro is problematic. For other macros the change isn't very big, they can be kept here.

That's not really true. The tabs macro interferes with this PR: #8108 -- It's not directly related, but the tabs-macro is of interest.

So it should definitely be in it's own PR. -- I am not really interested in the other macros atm.

@Jermolene
Copy link
Member

Thanks @Leilei332

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.

4 participants