docsifyjs / docsifyjs/docsify

Allow hooks to work for Sidenav

Đang mở
#1,329 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
JavaScript
Star
31.5k
Fork
5.8k
Merge trung bình
9 ngày 8 giờ
Pull request đã merge (30 ngày)
2

Mô tả

## Feature request

Allow hooks to work for Sidenav (and perhaps Navbar)

#### What problem does this feature solve?

I have a need where sidebar data is being generated (outside of my control) in a format different from that specified for './_sidebar.md'. With hooks enabled I can modify the sidebar information to the format Docsify wants.

#### What does the proposed API look like?

No changes to the API

#### How should this be implemented in your opinion?

Add `beforeEach` and `AfterEach` hooks to `proto._renderSidebar` when invoking `proto.renderTo` in the same pattern as `proto._renderMain` in 'src/render/index.js'. Though I am not sure since I cannot claim to fully understand the code.

#### Are you willing to work on this yourself?

Only if a maintainer will discuss proposed changes in code and verify my changes! Last thing I want to do is upload a poor PR that breaks things!!!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.