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 viewer links #5898

Merged
merged 7 commits into from
May 5, 2023
Merged

Conversation

lkishalmi
Copy link
Contributor

Well, this one is just another low hanging fruit.

First, I've upgraded the flexmark-java library to 0.62.2 (the last which supported Java 8), that might not have been necessary, but 0.50.x is getting dated.

I moved the Preview tab to the first in multiview. I think the generic use case with Markdown files is more read than write oriented.

Then I've added a hyperlink listener to handle the internal and external links.

Added LSP label as previosly to markdown only the LSP modules had dependenct on the flexmark-java libraries.

@lkishalmi lkishalmi added LSP [ci] enable Language Server Protocol tests Upgrade Library Library (Dependency) Upgrade Editor labels Apr 28, 2023
@lkishalmi lkishalmi added this to the NB19 milestone Apr 28, 2023
@mbien
Copy link
Member

mbien commented Apr 28, 2023

I've upgraded the flexmark-java library to 0.62.2 (the last which supported Java 8)

and

Added LSP label as previosly to markdown only the LSP modules had dependenct on the flexmark-java libraries.

if #5852 makes it in you can probably update to the latest version of flexmark-java, since it moves the LSP job to 11 and disables CV on 8, so tests should pass.

@Chris2011
Copy link
Contributor

I moved the Preview tab to the first in multiview. I think the generic use case with Markdown files is more read than write oriented.

@lkishalmi can you please show a screenshot what do you mean with this? I really want to have a splitted view this is why I use this plugin with all of the options: https://github.com/moacirrf/netbeans-markdown (single source, single preview, split source and preview). I don't want to have just source or preview. So if that means you hide it really behind the preview than -1 because your first PR seemed way better.

@neilcsmith-net
Copy link
Member

I moved the Preview tab to the first in multiview. I think the generic use case with Markdown files is more read than write oriented.

I'm with @Chris2011 here if it means opening the preview ahead of the source. My usage is definitely more (like 95%+) write than read oriented. I use NetBeans to edit a bunch of Jekyll, MkDocs, etc. sites and always use the browser for preview with live updates on save.

Option to open the preview in browser with live update directly from NetBeans might be a nice enhancement to this incidentally.

if #5852 makes it in you can probably update to the latest version of flexmark-java, since it moves the LSP job to 11 and disables CV on 8, so tests should pass.

We'll probably need a new label for PRs that do that too? Will follow up on that PR - "as they need to" should be part of the review process.

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

I left an inline comment about the handling of the libraries in the license files.

I agree with Neil, that the preview should not be the default. The IDE is for editing files, not viewing them.

@lkishalmi
Copy link
Contributor Author

I've upgraded the flexmark-java library to 0.62.2 (the last which supported Java 8)

and

Added LSP label as previosly to markdown only the LSP modules had dependenct on the flexmark-java libraries.

if #5852 makes it in you can probably update to the latest version of flexmark-java, since it moves the LSP job to 11 and disables CV on 8, so tests should pass.

Well, I just want to be nice with the JDK Museum folk, not to shoot them on foot with one of the fist commits for NB19 (they might be running LSP on JDK8).

@lkishalmi
Copy link
Contributor Author

@Chris2011
image

Just moved the preview button to the first position. NetBeans built-in split view does the trick.

I think, creating a custom EditorSupport can make the preview live.

@Chris2011
Copy link
Contributor

Thx so I did get it wrong :). Thx for the info and clarification. Great work, really @lkishalmi .

@mbien
Copy link
Member

mbien commented May 1, 2023

+1 for not changing the order of source/preview/history and to open the source view by default just like with other files.

Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

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

code looks good to me

paperwork still complainaing:

 BUILD FAILED
/home/runner/work/netbeans/netbeans/nbbuild/build.xml:1627: Failed VerifyLibsAndLicenses test(s):
Some license files have incorrect headers
ide/libs.flexmark/external/flexmark-0.62.2-license.txt contains a license body which does not match that in nbbuild/licenses/BSD-flexmark: mismatch around: '20, Vladimir Schneid' vs. '18, Vladimir Schneid'
ide/libs.flexmark/external/flexmark-0.62.2-license.txt mentions a nonexistent binary in Files: flexmark-util-0.62.2.jar

@mbien
Copy link
Member

mbien commented May 2, 2023

(and don't forget to squash :))

@lkishalmi
Copy link
Contributor Author

Yeah, I know. I'm doing the last testing of the live preview functionality...

@lkishalmi
Copy link
Contributor Author

Well, I made a the preview live, so it updates on editor changes without saving the document. It flickers most of the time due to re-rendering. Went to document level change instead of calling JEditorPane.setText(), that seems cause less flicker.

Tables are supported as well.

Theoretically it is easy to add the spellchecker what we have on plain text documents back, though it looks a bit weird as too many things are underlined...

it would be great if someone could add some CSS to the preview. I've tried one, Could get borders for the table, but I'm really not talented in this.

image

So I left it out. What about a joint effort @matthiasblaesing ?

@lkishalmi lkishalmi requested a review from mbien May 4, 2023 03:07
@Chris2011
Copy link
Contributor

@lkishalmi it should look like just as simple as possible. https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables. If you can't handle it, I can do it. Need to have a look.

@lkishalmi lkishalmi merged commit 86fb03e into apache:master May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Editor LSP [ci] enable Language Server Protocol tests Need Squashing Upgrade Library Library (Dependency) Upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants