gitbook-plugin-summary icon indicating copy to clipboard operation
gitbook-plugin-summary copied to clipboard

Nested Structure fails if there's another

Open ketozhang opened this issue 6 years ago • 4 comments

For example if your structure looks like this

.
├── 1.
│   ├── README.md
│   └── TEST.md
├── 2.
│   └── README.md
├── book.json
├── README.md
└── SUMMARY.md

TEST.md should be a child of 1. not be along side of

Current SUMMARY.md

- [1.](1./README.md)

- [TEST.md](1./TEST.md)
- [2.](2./README.md)

Expected SUMMARY.md

- [1.](1./README.md)
    - [TEST.md](1./TEST.md)

- [2.](2./README.md)

ketozhang avatar May 23 '18 22:05 ketozhang

Same issue. If you're only going one folder deep you can just throw + 1 at the end of line 32 in renderer.js. If you've got nested folders below that it won't do the trick.

I also changed the - to * in renderer.js to get it to display correctly.

depthEntries(depth, `* [${title}]()`)

And

depthEntries(depth, `* [${title}](${path})`)

Working correctly for me now, but again, I'm only using one level of nested folders for this particular set of docs.

wunderdojo avatar Jun 07 '18 23:06 wunderdojo

Sorry, it's long time since I didn't use this plugin myself. I'll check back as soon as I can.

Although if someone has time to come up with a PR, is more than welcome.

julianxhokaxhiu avatar Aug 25 '18 09:08 julianxhokaxhiu

Same issue. If you're only going one folder deep you can just throw + 1 at the end of line 32 in renderer.js. If you've got nested folders below that it won't do the trick.

I also changed the - to * in renderer.js to get it to display correctly.

depthEntries(depth, `* [${title}]()`)

And

depthEntries(depth, `* [${title}](${path})`)

Working correctly for me now, but again, I'm only using one level of nested folders for this particular set of docs.

at line 35, also should add a line: if (filePath.toLowerCase().indexOf('readme.md') !== -1) return

topul avatar Jun 12 '19 07:06 topul

@topul would you be so kind to open a PR?

julianxhokaxhiu avatar Dec 22 '20 11:12 julianxhokaxhiu