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
Add Icon and Media Support to List - Resolves #906 and #2272 #2316
Conversation
Hi @SPWwj it looks p cute! |
Roger🫡will do it tmr😁 |
@SPWwj Yup, in fact I would like to see the documentation first, so that I can evaluate the PR from the user POV. Perhaps the tests can be put on hold until we have firmed up the feature behavior. |
The documentation has been updated, potentially revealing two new bugs.😂 |
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.
Just some quick comments, just for the UG only.
Hi @SPWwj, thanks for the changes! |
@SPWwj While implementing this feature, keep in mind the possibility of a new feature for customizing ordered lists: number style (e.g., A,B,C i, ii, iii etc.) and presentation (font weight, color etc.). It is ideal if that feature can be similar to this (both from user POV and dev POV). |
Fixed 👍 |
I realized that I can transform a list into any form as needed.😂 |
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.
Just documentation nits, don't have anything else to add on the implementation:
docs/userGuide/syntax/lists.md
Outdated
|
||
* ##### Heading 3.1: Final Thoughts | ||
|
||
Content 3.1: This is a place for final reflections, recommendations, or a look towards future developments or trends. |
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.
similarly, this example could be more concise for the reader. (e.g. heading 1.1, 3, 3.1 seems unnecessary)
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.
this was added back in your revert commit
I've added a commit message, but try to practice writing them. There is a link in the PR template to a guide. Concise messages go a long way in documenting changes. Github has issue closing keywords you can use to automatically close issues too, link in the template. In case I forget, self reminder to raise a follow up for automatically scale horizontal spacing between icon and content. |
This feature in action https://nus-cs2103-ay2324s1.github.io/website/admin/appendixD-help.html Thanks again to @SPWwj for authoring, and @ang-zeyu for guiding, this massive and long-running PR. |
- Allow users to modify icon's size, width, height, and class for customizing icon attributes while also providing the option to adjust spacing between the icon and text for enhanced user experience. - Added "i-spacing" attribute to ICON_ATTRIBUTES and interface IconAttributes in CustomListIconProcessor.ts. - Implemented logic to check whether the user has defined the i-spacing attribute or not. - Updated createIconSpan function to incorporate i-spacing attribute. - Updated getIconAttributes function to retrieve i-spacing attribute. - This consolidation of attributes maintains code consistency and cleanliness. And it ensures that NodeProcessor.ts can easily access and utilize these attributes without additional complexity. - Refer issue: MarkBind#2352, MarkBind#2316.
- Allow users to modify icon's size, width, height, and class for customizing icon attributes while also providing the option to adjust spacing between the icon and text for enhanced user experience. - Add "i-spacing" attribute to ICON_ATTRIBUTES and interface IconAttributes in CustomListIconProcessor.ts. - Implement logic to check whether the user has defined the i-spacing attribute or not. - Update createIconSpan function to incorporate i-spacing attribute. - Update getIconAttributes function to retrieve i-spacing attribute. - It maintains code consistency and cleanliness. - Refer issue: MarkBind#2352, MarkBind#2316.
- Allow users to modify icon's size, width, height, and class for customizing icon attributes while also providing the option to adjust spacing between the icon and text for enhanced user experience. - Add "i-spacing" attribute to ICON_ATTRIBUTES and interface IconAttributes in CustomListIconProcessor.ts. - Implement logic to check whether the user has defined the i-spacing attribute or not. - Update createIconSpan function to incorporate i-spacing attribute. - Update getIconAttributes function to retrieve i-spacing attribute. - This consolidation of attributes maintains code consistency and cleanliness. - Refer issues: MarkBind#2352, MarkBind#2316.
What is the purpose of this pull request?
Overview of changes:
This PR resolves issue #906 by adding support for custom icons in lists, and also addresses #2272 for additional icon support.
Anything you'd like to highlight/discuss:
Kindly note, for emojis, please avoid the
::
symbol, due to our markdown decode pipeline's internal design. Whether we'll rectify this in future is a topic for separate consideration.markdown-it-icons.ts
has been refactored for better maintainability and can be reused by this Unordered Icon list to improve code consistency. However, all its functionalities remain unchanged.The suggestion of multi-icon settings,
{icons=":thumbs_up: :light_bulb:"}
, discussed in issue Support custom icons for lists #2272, is worth considering. Nonetheless, I believe excessive abstraction in markdown might not be optimal. We can delve deeper into this subject in PR Introducing Custom Markdown Syntax Pipeline and QR Code Component #2315. This feature could be potentially addressed in a minor patch.To create a tightly nested list, you can use the following method:
Testing instructions:
markbind init
command.Checklist: ☑️