-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Formatting for object descriptions. #3
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You sure you want to pull into main? |
Nah it'll be merged into dev. Forgot to change that. |
add: exceptions fix: some tag parsing bugs
fix: lots of bugs
feat: format tag can now apply multiple formats and reset them
add: more javadocs missing
fadeoffical
suggested changes
Mar 8, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! except the two finals.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow descriptions of objects, such as Argument's or Command's to have richer information. At the moment, when printing the description on the help view, both the description specified to the argument and the one of the argument type are shown.
This is great, but it would be neat to allow more customization, such as being able to specify formatting semantics, like
{@link args.arg1}
or{@link cmds.mySubcmd1}
.Example:
When being printed on the help, this is what would be shown:
--arg1
would be shown with the color that represents it. And also, if it had multiple names, these would be shown like--arg1/argument1
. Basically the argument representation that is normally shown for each argument.Formatters ideas:
@link
: Basically a "reference" to the specified element, as explained above.@from
: Inlines the description of the selected element into the current one.Selectors:
After one of the formatters above is specified, a selector can be used to indicate the element to select (Command, argument, etc.):
args.<arg>
: The argument with the specified name.<arg>.type
: The argument type of the argument. At the moment the description of the type is automatically added. So with this change the user would need to add@from !.type
. (!
explained below).cmds.<cmd>
: The command with the specified name.cmds.<cmd>.args.<arg>
.groups.<grp>
: The group with the specified name.!
: This selects the current element that is generating the description. For example, if the description of an argument named "foo" is set to@link !
, this would be equal to@link args.foo
.Syntax ideas:
@link:args.arg1
, suggested by @fadeoffical. No spaces required but possible problems when parsing if no spaces are present after it, likedesc: @link:args.arg1.
. The.
could cause problems, but we could probably allow{}
wrapping to indicate the formatting more explicitly.@link args.arg1
, similar to javadocs syntax, though I personally prefer the former!<link=args.arg1>
, much easier to parse with the eyes. Will go with this one.