-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add Copy markdown to copy citation #13387
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
base: main
Are you sure you want to change the base?
Conversation
hey ,can you just guide If I am in the right direction or not. |
You could start by fixing your PR description. |
I have made the changes but not able find the fault as I can't see the effect in ui |
Please add a CHANGELOG.md entry. |
Tried out, UI works... Update The content is a bit strange. I checked the code - it seems, citeproc.java is not used correctly? \[1\]L\. Wegmeth\, T\. Vente\, and J\. Beel\, “Recommender Systems Algorithm Selection for Ranking Prediction on Implicit Feedback Datasets\,” in *Proceedings of the 18th ACM Conference on Recommender Systems*\, in RecSys ’24\. New York\, NY\, USA\: Association for Computing Machinery\, Oct\. 2024\, pp\. 1163–1167\. doi\: 10\.1145\/3640457\.3691718\.<br /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a deeper look, I did not see any wiring in the library https://github.com/michel-kraemer/citeproc-java. Please do so.
@@ -5,7 +5,8 @@ | |||
public enum CitationStyleOutputFormat { | |||
|
|||
HTML("html", OS.NEWLINE + "<br>" + OS.NEWLINE), | |||
TEXT("text", ""); | |||
TEXT("text", ""), | |||
MARKDOWN("markdown", OS.NEWLINE + "<br>" + OS.NEWLINE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<br>
is not a good line separator in markdown. Just remove it. Two empty lines are ok.
@@ -120,6 +121,13 @@ static ClipboardContent processHtml(List<String> citations) { | |||
return content; | |||
} | |||
|
|||
static ClipboardContent processMarkdown(List<String> citations) { | |||
String result = String.join(CitationStyleOutputFormat.MARKDOWN.getLineSeparator(), citations); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the convertion to Markdown made?
I think, you need to deal with setOutputFormat
somehow michel-kraemer/citeproc-java@66cad6b
requires flexmark; | ||
requires flexmark.util.ast; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate module requirements detected. The 'flexmark' and 'flexmark.util.ast' modules are already declared earlier in the file, leading to redundant declarations that should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test so that one "sees" a conversion result in the code.
/** | ||
* Insert each citation into HTML. | ||
* convert HTML to markdown using flexmark. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is trivial and simply restates what the code does without providing additional information about the reasoning or important details about the implementation.
JUnit tests of You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide. |
Closes #12552
This pr contains the changes by adding the Markdown citation copy in the preview panel.I have added changes StandardAction.java ,RightClickMenu.java,CitationStyleOutputFormat.java,ClipboardContentGenerator.java by adding Markdown format and their style respectively.
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)