Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown scroll sync between preview and src #2373

Open
4 tasks done
guanglinn opened this issue Jul 27, 2024 · 6 comments
Open
4 tasks done

Markdown scroll sync between preview and src #2373

guanglinn opened this issue Jul 27, 2024 · 6 comments

Comments

@guanglinn
Copy link
Contributor

guanglinn commented Jul 27, 2024

⚠️ This issue respects the following points: ⚠️

  • This is a enhancement/feature request. Not a bug or question.
  • The topic is not already reported at Issues. (I've searched it).
  • Markor is up to date. See Releases for the latest version. Updates are available from F-Droid and GitHub.
  • The wanted feature/enhancement is not present in the latest development version (git master). (Please download and try the test version of Markor, named Marder. Don't worry; Markor and Marder appear as completely separate applications. You can install both side-by-side, and Markor's settings are not touched. If your desired feature is present, you don't need to open this issue. The change will be part of the next Markor update.)

Description

This is a feature request.
Hope Markor supports scroll synchronization between markdown preview in view-mode and its source code in edit-mode.

Information

Android version: Android 12
Device: Huawei Nova 8
App Version: 2.12.5 (code 154)

Source

GitHub Releases

Format / File type

Markdown

Additional info / Log

-
@gsantner
Copy link
Owner

#2189 #679 #1070

@guanglinn
Copy link
Contributor Author

I am sorry for not noticing those closed issues.

@guanglinn
Copy link
Contributor Author

guanglinn commented Jul 27, 2024

This is an advanced feature for Markor, but I noticed that Visual Studio Code does well in Markdown scroll sync, the code of this feature is here
vscode/extensions/markdown-language-features/preview-src/scroll-sync.ts,
and the related issue from VSCode
Support to scroll markdown preview with source scrolling.

It may be a very valuable reference for us to analyze its principle and implementation. @gsantner @harshad1

2024-07-28-vscode-scroll-sync.mp4

@harshad1
Copy link
Collaborator

To this end every node in the markdown html now has a line=# attribute. This should be sufficient to jump when going back and forth if handled well, I think

@gsantner
Copy link
Owner

gsantner commented Jul 27, 2024

Unfortunatley it's though markdown specific and next up people cry out when it is ""broken/unavailable/not works"" for other formats. It's not generic solveable in easy way

@guanglinn
Copy link
Contributor Author

guanglinn commented Jul 27, 2024

I think it is feasible on Markor to a certain extent, maybe we can try to implement it on Markdown first.

If we master the implementation of the feature principle in code and it works well, then it could be easily implemented for other formats.

@guanglinn guanglinn changed the title Markdown scroll sync in preview and src Markdown scroll sync between preview and src Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants