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

Ensure Table of Contents is sorted alphabetically #10

Closed
raymelon opened this issue Oct 7, 2023 · 9 comments
Closed

Ensure Table of Contents is sorted alphabetically #10

raymelon opened this issue Oct 7, 2023 · 9 comments
Labels
hacktoberfest help wanted Extra attention is needed

Comments

@raymelon
Copy link
Owner

raymelon commented Oct 7, 2023

An ideal solution is to implement an automated workflow that will update README.md > Table of Contents.

Workflow flow:

  1. Start workflow after a commit on main branch
  2. Parse README.md file
  3. For each language section on Table of Contents:
    3.1. Extract script filenames
    3.2. Sort the script filenames alphabetically
    3.3. Rewrite the language section
  4. Commit to main branch and push

Anyone interested to implement this, let me know. Will include this in Hacktoberfest 2023.
I'm also open to discussions, feel free to reply with your suggestions.

@raymelon raymelon added help wanted Extra attention is needed hacktoberfest labels Oct 7, 2023
@Chibuike-edmund
Copy link
Contributor

@raymelon

Kindly Check in

I kinda tweaked with this somehow

@raymelon
Copy link
Owner Author

Checking it out @Chibuike-edmund ! Appreciate the Pull Request and implementing it!

@raymelon
Copy link
Owner Author

Adding Pull Request #11

Contributed by @Chibuike-edmund

@raymelon
Copy link
Owner Author

raymelon commented Oct 12, 2023

Tried the test merge, see the Actions log:

https://github.com/raymelon/scripting-recipes/actions/runs/6495866893

Encountered this.

Resolved by using updated versions of actions (v3) as suggested here Node.js 12 to 16

See resolution at Commit c0ca9

image

@raymelon
Copy link
Owner Author

Hi @Chibuike-edmund, kindly take a look at the Job Log

image

I tried adding an entry on the top of Bash section, but the GitHub Action did not update the README file.

@georgettica
Copy link

is your issue that the other types are not sorted? I think this is the case as the code only looks at python segments.

if you want the others to be changed a simple refactor to the code can be done

@raymelon
Copy link
Owner Author

raymelon commented Oct 14, 2023

@georgettica Hi, thank you for your comment. You're right, the script only looks at python segments.

With that, I also did the same thing for the Python segment. The Action ran, but the README file is not updated still.

Is the step 4. Commit to main branch and push even possible? What do you think?

Workflow flow:

  1. Start workflow after a commit on main branch
  2. Parse README.md file
    For each language section on Table of Contents:
    3.1. Extract script filenames
    3.2. Sort the script filenames alphabetically
    3.3. Rewrite the language section
  3. Commit to main branch and push

@georgettica
Copy link

It's more on each PR it will add a commit and push there than on the main branch.

And it's possible

@raymelon
Copy link
Owner Author

Closing the issue. I modified update_readme to work as I intended. Appreciate everyone who contributed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants