azu / gitbook-plugin-include-codeblock

GitBook plugin for including file
Other
40 stars 25 forks source link

Parsing code from URL (Feature) #42

Open gdolle opened 7 years ago

gdolle commented 7 years ago

If a code is already hosted on github (or elsewhere), you might want to avoid code duplication and parse the code from the url (e.g raw github, gists, ... etc).

For example

[import:"marker0"](https://raw.githubusercontent.com/azu/gitbook-plugin-include-codeblock/master/example/src/marker.ts)
azu commented 7 years ago

This features includes other issue. It need to access network in each build process. Also, It should have effective cache system(maybe already exist some npm modules).

Edit: My position about this proposal https://github.com/azu/gitbook-plugin-include-codeblock/pull/43#issuecomment-274780365

This feature will add complexity to this plugin. We should take care adding this feature.

prudhomm commented 7 years ago

It would be really nice to have this feature, typically when we have to document a code and the book is not in the same repo ! it allows to keep the code up to date and avoir code duplication

hamishwillee commented 6 years ago

I would love this feature. Please update doc here to remove "url" as an option - until this feature is added.

azu commented 6 years ago

@hamishwillee Thanks. fixed in https://github.com/azu/gitbook-plugin-include-codeblock/commit/c97000c2d9fa57effb5b190fd16c9223b859bbed