zevv / npeg

PEGs for Nim, another take
MIT License
330 stars 22 forks source link

Automated TOC generation. #56

Closed thatrandomperson5 closed 1 year ago

thatrandomperson5 commented 1 year ago

Re-opening of https://github.com/zevv/npeg/pull/55

In the README the auto TOC is generated between <!-- AutoContentStart --> and <!-- AutoContentEnd --> comments. The workflow only runs when the README is updated, and opens a pull request. This Is a safety precaution but it can be configured to directly commit. If there are any issues please report them here.

I hope this is helpful!

zevv commented 1 year ago

Let's merge and give it a spin, thanks!

zevv commented 1 year ago

merge I merged but reverted because the results were a bit messy; Could you please rebase & squash the commits on latest master so we can do a clean merge?

thatrandomperson5 commented 1 year ago

I don’t use git much but could you tell me the command for that chart? I think I rebased but I would have to check if it is cleaner.

zevv commented 1 year ago

It's always a bit of a hassle; I'll do it on my side, no problem.

zevv commented 1 year ago

So, I added the contents.yml and magically got a TOC. nice.

zevv commented 1 year ago

Any idea why the job failed now? https://github.com/zevv/npeg/actions/runs/3867859741

thatrandomperson5 commented 1 year ago

Any idea why the job failed now? https://github.com/zevv/npeg/actions/runs/3867859741

@zevv yes! it is solved here: https://github.com/peter-evans/create-pull-request/issues/707 Just replace

name: Make table of contents
on: 
  push:
    paths:
      - README.md

in contents.yml with

name: Make table of contents
on: 
  push:
    paths:
      - README.md
    branches:
      - '**' 

Although this means it will not run on releases.

zevv commented 1 year ago

ok, changed that, let's see how this works. Thanks!

thatrandomperson5 commented 1 year ago

ok, changed that, let's see how this works. Thanks!

It seems you made a small mistake! - '**' name: Make table of contents should be - '**'

zevv commented 1 year ago

Yeah, I noticed, just fixed that.

zevv commented 1 year ago

You'll never guess what I just learned...

ff

thatrandomperson5 commented 1 year ago

Lol, i did not that existed, at least it still helps on nimble: https://nimble.directory/pkg/npeg