wfxr/code-minimap

A lib crate API?

zesterer opened this issue · 4 comments

Hello. I'm interested in using code-minimap in a text editor project. Might it be possible to expose this crate as a library by adding a lib.rs interface?

wfxr commented

@zesterer No problem. But I’m going to take a vacation soon. Can you submit a PR? Or if you are not in a hurry, I will do this after vacation.

EDIT:
I am going to finish it before the vacation, maybe tomorrow.

wfxr commented

Hi @zesterer . I updated the project layout. Now it can be used as a lib, not well ducumented although.

The usage is straightforward. A simple example can be found in examples directory:
https://github.com/wfxr/code-minimap/blob/master/examples/simple.rs

Hi @wfxr, would it also be possible to have a function to only construct and get the entire minimap without also printing it?

Perhaps the caller could do something with each frame instead of printing it?

wfxr commented

@Dophin2009 Yes, I think there should be such an api. Thank you!