nus-mtp / sashimi-note

A flexible and extensible document viewing and editing platform.
https://nus-mtp.github.io/sashimi-note/
MIT License
8 stars 1 forks source link

Inject line number into the rendered markdown HTML #389

Closed amoshydra closed 7 years ago

amoshydra commented 7 years ago

Done a similar implementation like the markdown-it demo page https://github.com/markdown-it/markdown-it/blob/master/support/demo_template/index.js#L165

For now it will only track the line number for paragraph and header elements at the level 1 hierarchy. These should be sufficient for implementing a very basic scroll sync mechanism.

Other level 1 hierarchy element that are not included in this implementation includes

amoshydra commented 7 years ago

@chuajiaxuan will need your help in updating the test data.

Update: I have updated the test data in a separate PR #390. If the changed is ok, you may merge the #390 into this PR.

chuajiaxuan commented 7 years ago

@amoshydra Approved PR #390 already!

amoshydra commented 7 years ago

@chuajiaxuan This pr does not contain code for scroll sync yet. Instead, it is a requirement for an upcoming implementation of scroll sync.