-
Notifications
You must be signed in to change notification settings - Fork 24
Apply macro substitutions to inline tagged nodes #131
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
Apply macro substitutions to inline tagged nodes #131
Conversation
0bbaff4 to
971d55e
Compare
|
Your change to tags.rb is having a negative side effect. The regression test (just run "make") fails because some of the adoc formatting information is being removed. I want to see this so I can create the HTML equivalent. I also added this diagnostic puts to your tags.rb and added another case to test.adoc to check macro replacement in paragraph (i.e. [[foo]]) anchors. Looks like the macros aren't replaced in paragraph tags. tags.rb change: test.adoc change: Original Change Output from diagnostic puts: You can see:
|
|
Interesting, thanks for testing - I'll take another look. |
|
I looked at the Asciidoctor Ruby source and it looks like we could ask it to substitute only macros.
+james+
…________________________________
From: Tim Hutt ***@***.***>
Sent: Tuesday, November 25, 2025 1:01:57 PM
To: riscv/docs-resources ***@***.***>
Cc: James Ball (QUIC) ***@***.***>; Review requested ***@***.***>
Subject: Re: [riscv/docs-resources] Apply macro substitutions to inline tagged nodes (PR #131)
WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
[https://avatars.githubusercontent.com/u/376842?s=20&v=4]Timmmm left a comment (riscv/docs-resources#131)<#131 (comment)>
Interesting, thanks for testing - I'll take another look.
—
Reply to this email directly, view it on GitHub<#131 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BBRBTGDBZ5HW3EXKGNZX47D36S7ULAVCNFSM6AAAAACNFSPML6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNZXGU3TIMJXG4>.
You are receiving this because your review was requested.Message ID: ***@***.***>
|
|
Any idea how? |
|
Instead of calling node.apply_subs(node.text, node.parent.instance_variable_get(:@subs)), which passes in an array of substitution functions from the parent, could you just pass in a reference to just the macro substitution function? If you omit the subs parameter to apply_subs(), it defaults to NORMAL_SUBS (see screenshot below). The NORMAL_SUBS is an array of function references and includes "macros" but also others we don't want. So, could you just pass in a reference to the "macros" function?
|
|
BTW, even if you can just get macro substitution to work, its only working in inline tags ([#foo]#...# syntax). How can we get it to work for the paragraph tags ([[foo]]) too? |
|
@Timmmm, any update on this? |
|
Hey, sorry - slightly fell off my radar. I'll take another look. |
|
Awesome
+james+
…________________________________
From: Tim Hutt ***@***.***>
Sent: Monday, December 8, 2025 7:01:38 AM
To: riscv/docs-resources ***@***.***>
Cc: James Ball (QUIC) ***@***.***>; Review requested ***@***.***>
Subject: Re: [riscv/docs-resources] Apply macro substitutions to inline tagged nodes (PR #131)
WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
[https://avatars.githubusercontent.com/u/376842?s=20&v=4]Timmmm left a comment (riscv/docs-resources#131)<#131 (comment)>
Hey, sorry - slightly fell off my radar. I'll take another look.
—
Reply to this email directly, view it on GitHub<#131 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BBRBTGBSZOACM3XJV46OYHL4AWHFFAVCNFSM6AAAAACNFSPML6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMRXGM2DGNJUG4>.
You are receiving this because your review was requested.Message ID: ***@***.***>
|
|
@Timmmm, I see that the upstream ISA manual now has macros everywhere instead of using Unicode characters or Unicode codes. Looks like you might have been working with @aswaterman on the change. This raises the priority of getting this PR fixed since now the normative rules won't show the intended Unicode characters (just the macro name). |
|
I've merged in the upstream ISA manual repo and resolved about a dozen conflicting files. However, our normative rules are now somewhat broken due to the use of the macros. Can we get this fixed before someone notices and complains? |
99ffed6 to
0559e94
Compare
|
Ok it seems the loss of bold/italic etc was a separate issue to substitutions. Those things get converted to This seems to work now but maybe double check! |
|
I'm not clear from your comments about bold & italics. Can we add those? |
|
Yeah they should work. |
When you have a substitution like `{ge}` in an inline node (which most of the tagged text is), then it wasn't being substituted when recorded in the JSON output because that substitution is applied at the block level.
Signed-off-by: Tim Hutt <[email protected]>
For things like `*bold*` and `_italic_` text they get converted to `inline_quoted` nodes with a `@type` member. We need to use these to surround the text with something to indicate they are bold/italic. I went with the Asciidoctor syntax, though this choice is fairly arbitrary. Signed-off-by: Tim Hutt <[email protected]>
0559e94 to
e681bb1
Compare
|
Ok I think all the feedback is addressed now. |

When you have a substitution like
{ge}in an inline node (which most of the tagged text is), then it wasn't being substituted when recorded in the JSON output because that substitution is applied at the block level.