Skip to content

Conversation

@CFFinch62
Copy link

@CFFinch62 CFFinch62 commented Jan 23, 2026

This PR adds the markdown-preview. It includes the plugin source files and meson build integration.

Fixes #340

Screenshot from 2026-01-23 18 45 36

@jeremypw
Copy link
Collaborator

Thanks for this extensive contribution! The idea of a markdown previewer has been floated before (see #340) but was closed as there wasn't unequivocal support before. However its worth taking another look now - the amount of extra code isn't huge. The code looks well-written on first review but will need to get approval of the design team regarding design details. CI is not currently passing. I'll spend some time review in depth this weekend hopefully.

@jeremypw jeremypw requested a review from a team January 23, 2026 18:14
@CFFinch62
Copy link
Author

Thanks for the consideration. I did review #340 but it was nearly 8 years ago so I thought that considerations may be different now. Also, while it is mostly to suit my personal needs as all my repos have a lot of markdown files, it is nice to not have to have another app open to do the preview of the markdown. If it work sgreat. No harm, no foul. I am also a newbie contributor and am learnign as I go. Thanks again for even being considered.

@CFFinch62
Copy link
Author

CFFinch62 commented Jan 23, 2026

I also noticed that my code causes preview to almost completely overlays the markdown being edited on first activation. This was not a problem for me as theview is adjuistable but probably shoudl be corrected. I also noticed that if I activate/deactuvate/reactivate the preview it crashes the app. As I said I am a newbie and maybe a bit over anxious to contribute before I tested wel enough. I can make all necessary fixes very quickly. Sorry for any confusion or wasted time I may have, or will, cause.

Copy link
Collaborator

@jeremypw jeremypw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial look is promising, one major bug so far:

Toggling the preview on and off with the headerbar button crashed Code entirely.

@jeremypw
Copy link
Collaborator

I also noticed that my code causes preview to almost completely overlays the markdown being edited. This was not a problme for me but probably shoudl be corrected. I can do that very quickly if required.

Yes, I noticed that too - I think it would be better for the preview to take no more that 50% if the available space initially (maybe adjusting zoom accordingly). The position and zoom level should also be saved and restored from settings.

There are a number of possible refinements but I don't want to distract from getting the basic design and stability right.

@jeremypw
Copy link
Collaborator

You can cure the lint failure in CI by installing and using vala-lint (should be details in the developer section of the elementary website). The code-style overall looks close to elementary style though.

@jeremypw
Copy link
Collaborator

Also, while it is mostly to suit my personal needs as all my repos have a lot of markdown files, it is nice to not have to have another app open to do the preview of the markdown.

I agree provided it is closely aligned with the intended purpose of Code as a code development tool. The general ethos of elementary is towards narrowly focused apps rather the "all bells and whistles".

…/deactivations, imges render properly within the preiview pane, preiew and edited fiel split is now 50/50 at activation
@CFFinch62
Copy link
Author

I will work on the CI stuff to clean it up and have already made fixes to the preview plugin in that include:

  • code app would carsh if a preview was dectivated and then reactivated on same file
  • images were not rendering properly in the preview
  • edited file view and preview view did not show 50/50 and now they do

perhaps we should close this PR undone so I can put together a more complete and properly tested one for you to review?

@jeremypw
Copy link
Collaborator

perhaps we should close this PR undone so I can put together a more complete and properly tested one for you to review?

I would convert it to draft while you are making changes and then change back to ready for review when ready. You can ask for a re-review by clicking on the symbol next to the reviewer's name above. The commits will be squashed when merged into main so it doesn't matter how many there are.

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

Successfully merging this pull request may close these issues.

Markdown Preview Plugin

2 participants