Vladimir Schneider

vsch ·

vsch/flexmark-java

Correct Usage of Extension

help wanted question

Jira renderer extension is an extension to the HTML Renderer. As such it requires AST generated from Markdown not HTML.

It is intended to be used for rendering Markdown to JIRA not HTML to JIRA.

Depending on the complexity of HTML you may be able to conv...

vsch/flexmark-java

integrate YUML and websequence diagram with flexmark

You need to create a custom HTML renderer to convert the YUMLBlockQuote to the image tag you showed.

You can take a look at the CoreNodeRenderer.java in core flexmark module for an example of rendering multi-line text as URL. The multi-line UR...

vsch/flexmark-java

integrate YUML and websequence diagram with flexmark

The syntax is close to the GitLab block quotes which use >>> instead of %%% so this extension is ideal for implementing the parser extension for parsing the syntax. flexmark-ext-gitlab

You only need the code for the yUML block element (equivalent to G...

vsch/flexmark-java

integrate YUML and websequence diagram with flexmark

How would YUML diagrams be created in markdown?

In my plugin I use fenced code with info set to to render PlantUML diagrams. I do this by creating a custom renderer for fenced code that converts ones with info to image links to images created with P...

GitQLab/gitq.com

GitHub issue completions do not work

bug

@steveluo, accepted.

I will do PRs so you can review. Don't worry about the refactoring before release.

You would be surprised how much input users provide and help you get the project moving faster. I would not have half the features in flexmark-java...

GitQLab/gitq.com

GitHub issue completions do not work

bug

Would it be possible to add completions for issues when using #?

GitHub does have the API to get issues.

Is GitQ source code available? I could take a look if I can start being useful and add a feature.

It is half of the GitHub integration which I think...

vsch/flexmark-java

Hooks into wikilinks extension rendering?

You should not use relative links for your href. The About page is really at not . When you create the relative link for a page at the browser sees it as located in so any relative links in that page will be relative to the page directory. Hence you s...

vsch/flexmark-java

Hooks into wikilinks extension rendering?

@clartaq, the rendering of the WikiLink will use whatever value is defined by the resolver for the url attribute:

ResolvedLink resolvedLink = context.resolveLink(WikiLinkExtension.WIKI_LINK, node.getLink().unescape(), null);
html.attr("href", resolve...
vsch/flexmark-java

Where is the JavaDoc?

document question

@coreagile, I have this on the todo list, including marked the task help wanted. I don't know how to set it up with maven build and cannot afford the time to search for the information at the moment.

If you know where I can find information specific to t...

vsch/flexmark-java

Hooks into wikilinks extension rendering?

You definitely should use the Wiki link extension for parsing wiki links and optionally wiki images ![[]].

To complete the functionality you need to create a custom LinkResolver which will convert the wiki page text to a URL based on your rules.

vsch/flexmark-java

Use flexmark-java to generate documents and reports based on templates

I am not familiar with Docmosis but don't see why markdown generated from a template would make any difference to the parser or the renderers.

Once you have a Markdown source, no matter how you derived it, you can parse it to an AST and then render ...

vsch/flexmark-java

Prepend image links with custom URL

question

vsch/flexmark-java

Prepend image links with custom URL

question

@Frituurpanda, the best example for this is in the new module flexmark-docx-converter it has a custom link resolver with separate prefix for page relative links like your example and site relative links that start with /.

vsch/flexmark-java

Set content of html blocks

question

@eikek, yes the cause is the same. You can get around it for now by setting the Parser.BLANK_LINES_IN_AST option. Which is how the Formatter was tested. However this causes extra blank lines in Markdown to be preserved.

The fix will not require blank lin...

vsch/flexmark-java

Set content of html blocks

question

@eikek, the missing blank line is a bug. Thank you for catching it. #146

The removal of indentation is by design because the indentation is not significant and during formatting it is reduced to minimum necessary.

I am fixing the bug now.

vsch/flexmark-java

Replace all link targets in markdown ast

question

You are welcome.

Your use case was not addressed by the library and was a good reason for some cleanup.

vsch/flexmark-java

Replace all link targets in markdown ast

question

@eikek, repo updated, maven update in progress. Sample for changing URLs and output using formatter: FormatterWithMods.java

vsch/flexmark-java

Replace all link targets in markdown ast

question

@eikek, it is a bit convoluted because each node keeps track of the source position and each node text part. I am making a new release that cleaned up the link related nodes to make your use case implementation easier.

The new release is coming shortly w...

vsch/flexmark-java

Specify css when converting to pdf

question

@mkanada, since the PDF converter takes HTML you can add the CSS to the HTML before passing it to the exportToPdf method by wrapping the rendered HTML in <html><head>....</head><body> and </body> with CSS given by:

<link rel="stylesheet" href="file:...
vsch/flexmark-java

Find document modified region

question

@iuscl-ide, markdown uses indentation and prefixes based on context so the safest bet is to walk the AST up until you get the document level element and use its text range. Walk AST up until no... or then use this node as the minimal element to re-parse.

vsch/flexmark-java

how to add attribute for the <a>

pegdown migration

Please take a look at the samples provided for attributes: AttributeProviderSample and AttributeProviderSample2

If you need to change the URL of a link then you need a LinkResolver and the sample for it: PegdownCustomLinkResolverOptions