AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

[feature]: include code-snippets from urls

Open mdopp opened this issue 3 years ago • 1 comments

1~3 main use cases of the proposed feature

As a developer I would like to refer snippets of code from existing repositories, instead of copying them into a "knowlage base". Therefore it would be great, to directly refer directly into files on GitLab or GitHub, with "line 30-38" or "function abc()". Knowing that there is real code used for this page, could also enable an notification system, letting me know, that the page might have to be updated, due to changed references. This will avoid outdated documentation.

Ideas for solution

Keep the "snipped" for codes, but instead of copying in the code, just add a url-reference, that might include line numbers

i.E. https://github.com/toeverything/AFFiNE/blob/bcf3a04500cf21a4986eff9d95f95a711303aba2/libs/datasource/jwst/src/lib.rs#L2

Affine should copy the code into the page, so that it is available even if i.E. Github is down. Also it could check on page reloads, if the file has been changed, and inform the author, that this page might have to be updated.

what types of users can benefit from using your proposed feature

developers

Additional context

No response

mdopp avatar Aug 17 '22 15:08 mdopp

1~3 main use cases of the proposed feature

As a developer I would like to refer snippets of code from existing repositories, instead of copying them into a "knowlage base". Therefore it would be great, to directly refer directly into files on GitLab or GitHub, with "line 30-38" or "function abc()". Knowing that there is real code used for this page, could also enable an notification system, letting me know, that the page might have to be updated, due to changed references. This will avoid outdated documentation.

Ideas for solution

Keep the "snipped" for codes, but instead of copying in the code, just add a url-reference, that might include line numbers

i.E.

https://github.com/toeverything/AFFiNE/blob/bcf3a04500cf21a4986eff9d95f95a711303aba2/libs/datasource/jwst/src/lib.rs#L2

Affine should copy the code into the page, so that it is available even if i.E. Github is down. Also it could check on page reloads, if the file has been changed, and inform the author, that this page might have to be updated.

what types of users can benefit from using your proposed feature

developers

Additional context

No response

This is a good idea and helpful for content positioning. We will discuss this feature in the team

tzhangchi avatar Aug 18 '22 02:08 tzhangchi