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

Default language expansion #2267

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ascholerChemeketa
Copy link
Contributor

This adds support for default programming language to parsons, hparsons, and codelens.

Also adds a few examples/tests and schema entry.

@ascholerChemeketa ascholerChemeketa force-pushed the default-language-expansion branch 2 times, most recently from c6495af to 79f8ed4 Compare October 16, 2024 21:35
@ascholerChemeketa
Copy link
Contributor Author

Did some cleanup and a bug fix to Codelens trace generation. I think this is set.

@ascholerChemeketa
Copy link
Contributor Author

@rbeezer Added the RS manifest default language. To do that with existing code, I allow get-programming-language to match anything (in this case it needs to match book). I know you like narrow matches, but in this case I think being permissive is better.

It means you can use it anywhere and get a string that is either the @language or the default or an empty string.

If get-programming-language fails to match, then any attempt to use it that fails (including indirectly through the xxx-language templates below it) returns the entire node that came in (matches some copy template elsewhere I assume). Which is really odd behavior for something that is supposed to just return the name of a programming language.

@ascholerChemeketa ascholerChemeketa marked this pull request as draft October 17, 2024 22:45
@ascholerChemeketa
Copy link
Contributor Author

Looking into a possible other manifest info. Converting to draft until done.

@ascholerChemeketa
Copy link
Contributor Author

False alarm... thought codelens was missing data-language, but it doesn't need it.

I believe this is set.

@ascholerChemeketa ascholerChemeketa marked this pull request as ready for review October 17, 2024 22:49
@rbeezer
Copy link
Collaborator

rbeezer commented Oct 18, 2024

fails to match, then any attempt to use it that fails

General approach, which is not to suggest it needs to be this way here:

Make a narrow match template that you want. Then make a catch-all template (select="*") that uses xsl:message to say, "Oops, something went haywire" and yields no result, rather than the built-in universal default template that is producing all the content that you find odd behavior.

@ascholerChemeketa
Copy link
Contributor Author

Make a narrow match template that you want. Then make a catch-all template (select="*") that uses xsl:message to say, "Oops, something went haywire" and yields no result

That makes sense, thanks.

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.

2 participants