-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
FEAT: Add custom symbol style and custom code block language #491
base: master
Are you sure you want to change the base?
Conversation
for requirements.txt
Customize code block language and handle symbol style
Great addition. |
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.
@caupolicanre could you undo the formatting changes? Especially the one to action.yml
@aravindvnair99 I don't know why it shows a complete change on the whole file, I didn't change the formatting of it. I don't know if there is a way to go back to a previous version of the file in github (before the fork) and try adding again those lines. If there is a way to do that, let me know and I'll change it. EDIT: Just used these commands to restore original git fetch upstream
git checkout upstream/master -- [action.yml] Then added the 2 new environment variables in this commit. |
I reestablished in git the original action file
@anmol098 @aravindvnair99 PR is ready to review. I remain attentive for any questions or changes 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.
I'd reeeaally like this change. Code looks good to me, I tested it on my machine.
Formatting changed were rolled back but still seem to occur, I'm also not sure why this happens, but it's working fine. I think this change can be dismissed.
Thank you so much for reviewing my PR! I would also love this change in the main project, but as of today, I'm using my own fork to have this enhanced version. |
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.
Great addition, thank you!
However, we can't merge without all the required workflows run successfully (or until @anmol098 relaxes this limitation 🌚)...
Hi! Yesterday, I was implementing this action on my personal README and instantly thought about 2 cool features that I'd like in this action. So first I made an issue requesting a new symbol to be added #489, but then forked the repo and started programming them by myself.
This PR has 2 new features:
Custom Symbol Style
Created a new environment variable
SYMBOL_STYLE
where the flag can be set to "▰▱" (just an example) to change the style of progress bar (by default is empty). If the length of the string is not 2, the default symbol version will be used.Then changed the logic to:
So if there are 2 symbols in "SYMBOL_STYLE" it will use them, if not, will use "SYMBOL_VERSION".
Custom Code Block Language
Created a new environment variable
CODE_BLOCK_LANGUAGE
where the flag can be set to "python" (just an example) to change the language of code blocks (by default is "text"). Here is a list of the language code blocks supported by github. I preferred to simply add the link to the list of languages to the README, and not write it, so that it is not so long.A verification can be added if you want. It could be an if statement to check if "CODE_BLOCK_LANGUAGE" is in the available languages list.
Example
Everything was tested in my personal repository.
![image](https://private-user-images.githubusercontent.com/110579577/287575640-b775fe94-88ac-4305-89fd-c859ba814cc5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzMjUxNjksIm5iZiI6MTcyNDMyNDg2OSwicGF0aCI6Ii8xMTA1Nzk1NzcvMjg3NTc1NjQwLWI3NzVmZTk0LTg4YWMtNDMwNS04OWZkLWM4NTliYTgxNGNjNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMlQxMTA3NDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jMGZkMzUzNWZmY2E3YTQ3ZDU2ZGJhZWYwYmY3NzlmYjUzOTQxNDNkYzEyNTAyZTQ3NTY2OTE0NjY0YWY1MmNlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Az-CqP9WxeUzn5iHcWXsQlITBzDhbAN0irh-xid-ujE)
Here is an example of my personal README where I'm using a custom symbol and python language for the code block:
I added the new documentation to the README explaining the two new environment variables.
I remain attentive for any questions.
Caupo.