Skip to content
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

Make it possible to deprecate symbols and modules #19

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

MDLC01
Copy link
Collaborator

@MDLC01 MDLC01 commented Dec 14, 2024

This PR adds the ability to deprecate definitions (i.e., symbols and modules), as suggested in #2 (comment).

Syntax-wise, marking a definition as deprecated can be done by adding @deprecated: deprecation message to the line preceding the definition.

Currently, this feature is not used, but it could be used to mark sym.inter as deprecated in #17.1

Deprecated definitions have an associated message. For now, Typst does not support deprecating constants, but this is implemented in typst/typst#5582.

Footnotes

  1. Proposal 14 (partially implemented in Add inter as an alternative for sect (Proposal 14, part I) #17) also removes the sym.integral.sect variant, which, as a variant, cannot be deprecated with this PR. This is probably fine in this specific case, because sym.integral.sect is not a highly used symbol, but we may want the ability to deprecate specific variants in the future.

@MDLC01 MDLC01 added meta Discussion about the structure of this repo breaking This involves a breaking change labels Dec 14, 2024
@MDLC01
Copy link
Collaborator Author

MDLC01 commented Dec 14, 2024

Given this is a change to the public interface, cc. @laurmaedje.

MDLC01 added a commit to MDLC01/typst that referenced this pull request Dec 28, 2024
T0mstone added a commit to T0mstone/codex that referenced this pull request Jan 20, 2025
This avoids it visually colliding with the deprecation annotation from typst#19.
@laurmaedje laurmaedje merged commit 0672cf9 into typst:main Feb 3, 2025
1 check passed
@laurmaedje
Copy link
Member

I renamed Entry to Binding for consistency with Typst.

Thank you!

@MDLC01 MDLC01 deleted the deprecated-defs branch February 3, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This involves a breaking change meta Discussion about the structure of this repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants