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

texinfo: improve variable in :samp: directives #9391

Merged
merged 1 commit into from Dec 11, 2021

Conversation

marxin
Copy link
Contributor

@marxin marxin commented Jun 30, 2021

The following snippet:
Show :samp:Samp with a {variable}.

Ends in .info as:
Show ‘Samp with a `variable'.’

Which is suboptimal and @var{variable} should be rather used.
That results in ‘Samp with a VARIABLE.’.

@marxin marxin force-pushed the info-samp-with-variable branch 2 times, most recently from be39f48 to 1264c31 Compare July 1, 2021 10:10
@marxin marxin changed the title texinfo: simplify variable in :samp: directivers texinfo: improve variable in :samp: directives Jul 1, 2021
@tk0miya
Copy link
Member

tk0miya commented Jul 3, 2021

Thank you for your contribution. But this affects the extensions that output nested emphasis nodes. I think all nested nodes should not be rendered as @var.

@tk0miya tk0miya added type:proposal a feature suggestion builder:texinfo labels Jul 3, 2021
@tk0miya tk0miya added this to the 4.2.0 milestone Jul 6, 2021
@marxin
Copy link
Contributor Author

marxin commented Jul 12, 2021

Are you sure? I mean, @var is a valid node even in @samp context as mentioned here:
https://www.gnu.org/software/texinfo/manual/texinfo/html_node/_0040var.html

and they mention the following example usage:

To delete file @var{filename},
type @samp{rm @var{filename}}.

which should correspond to:

... type :samp:`rm {filename}`

@marxin
Copy link
Contributor Author

marxin commented Aug 5, 2021

@tk0miya May I please remind you this pull request?

@tk0miya tk0miya modified the milestones: 4.2.0, 4.3.0 Sep 12, 2021
@jakobandersen jakobandersen requested review from tk0miya and removed request for tk0miya November 6, 2021 15:53
@tk0miya
Copy link
Member

tk0miya commented Nov 7, 2021

Sorry for not responding long. This code generates @var tag for the emphasis nodes under the literal node. It means this changes the output not only for the :samp: role, but also for other extensions that generates literal node and emphasis node. I think it's an unexpected change. So we have to tag to the emphasis node to track that they're surely generated by :samp: role.

@tk0miya tk0miya modified the milestones: 4.3.0, 4.4.0 Nov 7, 2021
The following snippet:
Show :samp:`Samp with a {variable}.`

Ends in .info as:
Show ‘Samp with a `variable'.’

Which is suboptimal and @var{variable} should be rather used.
That results in ‘Samp with a VARIABLE.’.
@marxin
Copy link
Contributor Author

marxin commented Nov 8, 2021

Sorry for not responding long. This code generates @var tag for the emphasis nodes under the literal node. It means this changes the output not only for the :samp: role, but also for other extensions that generates literal node and emphasis node. I think it's an unexpected change. So we have to tag to the emphasis node to track that they're surely generated by :samp: role.

All right, now I've got it. I updated the patch accordingly.

@marxin
Copy link
Contributor Author

marxin commented Nov 9, 2021

@tk0miya Can we get this to 4.3.0? Btw. when is the next release supposed to happen?

@tk0miya tk0miya merged commit b232b00 into sphinx-doc:4.x Dec 11, 2021
@tk0miya
Copy link
Member

tk0miya commented Dec 11, 2021

Sorry for the late response. Just merged.
Thank you for your contribution!

tk0miya added a commit that referenced this pull request Dec 11, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 11, 2022
@marxin marxin deleted the info-samp-with-variable branch September 9, 2022 10:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants