Skip to content

Multiple sections break tutorial generation script #160

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
leohhhn opened this issue Apr 17, 2024 · 1 comment
Closed

Multiple sections break tutorial generation script #160

leohhhn opened this issue Apr 17, 2024 · 1 comment
Assignees

Comments

@leohhhn
Copy link
Contributor

leohhhn commented Apr 17, 2024

Description

The README does not document the exact way to add new sections, so I tried with the logical approach:
Screenshot 2024-04-17 at 16 03 14

Investigating and printing out errors, this is what it comes up with:

❯ yarn generate
yarn run v1.22.21
warning ../../../package.json: No license field
$ npx tsx ./scripts/generate.ts
Subdirs found:  [ 'basics', 'chain' ]
There should be only one .md file in the directory
✅ Generated tutorial for: src/tutorials/gno.land/gbe/basics
There should be only one .md file in the directory
✅ Generated tutorial for: src/tutorials/gno.land/gbe/chain
❌ Error encountered during tutorial generation TypeError: Cannot read properties of undefined (reading 'link')
    at <anonymous> (/Users/sasurai/Desktop/gno/gbe/scripts/generate.ts:165:52)
    at Array.forEach (<anonymous>)
    at generateTutorialRoutes (/Users/sasurai/Desktop/gno/gbe/scripts/generate.ts:164:9)
    at generateTutorials (/Users/sasurai/Desktop/gno/gbe/scripts/generate.ts:253:9)
✨  Done in 1.78s.

EDIT: from the README, I think the idea was to keep all tutorials in on the same level in the tutorials/gno.land/gbe/ dir. It will prove a bit difficult to organize tutorials without support for actual subfolders, instead of just writing the name of the section in the README of the tutorial.

I added section folder support in #162.

@leohhhn
Copy link
Contributor Author

leohhhn commented May 6, 2024

Fixed in #162

@leohhhn leohhhn closed this as completed May 6, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant