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

Flexmark's renderer options support #58

Merged
merged 1 commit into from
Sep 9, 2021
Merged

Conversation

c47harsis
Copy link
Contributor

@c47harsis c47harsis commented Apr 24, 2021

  1. Added Flexmark's renderer (https://github.com/vsch/flexmark-java/wiki/Extensions#renderer) options support;
  2. In maven compiler plugin configuration updated source and target versions from 7 to 8.

Fixes #57

1. Added Flexmark's renderer (https://github.com/vsch/flexmark-java/wiki/Extensions#renderer) options support;
2. In maven compiler plugin configuration updated source and target versions from 7 to 8.
@c47harsis
Copy link
Contributor Author

Added <flexmarkRendererOptions> in plugin configuration.
For example, for my case described in #57:

# Table of content
[TOC levels=2-3]

## First header
### Something
### Something else

## Second header
### Something
### Something else

It converted to this:

<ul>
    <li><a href="#first-header">First header</a>
        <ul>
            <li><a href="#something">Something</a></li>
            <li><a href="#something-else">Something else</a></li>
        </ul>
    </li>
    <li><a href="#second-header">Second header</a>
        <ul>
            <li><a href="#something-1">Something</a></li>
            <li><a href="#something-else-1">Something else</a></li>
        </ul>
    </li>
</ul>
<h2><a href="#first-header" id="first-header"></a>First header</h2>
<h3><a href="#something" id="something"></a>Something</h3>
<h3><a href="#something-else" id="something-else"></a>Something else</h3>
<h2><a href="#second-header" id="second-header"></a>Second header</h2>
<h3><a href="#something-1" id="something-1"></a>Something</h3>
<h3><a href="#something-else-1" id="something-else-1"></a>Something else</h3>

Configuration for this:

<plugin>
    <groupId>com.ruleoftech</groupId>
    <artifactId>markdown-page-generator-plugin</artifactId>
    <version>2.3.1-SNAPSHOT</version>
    <executions>
        <execution>
            <phase>process-resources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <pegdownExtensions>EXTANCHORLINKS,TOC,FOOTNOTES,FENCED_CODE_BLOCKS</pegdownExtensions>
        <flexmarkParserOptions></flexmarkParserOptions>
          <!--LOOK AT THIS-->
        <flexmarkRendererOptions>HEADER_ID_GENERATOR_RESOLVE_DUPES</flexmarkRendererOptions>
    </configuration>
</plugin>

Flexmark's renderer options you can find here.

P.S. It would be nice to update Flexmark from 0.50.50 to 0.62.2

@walokra
Copy link
Owner

walokra commented Apr 27, 2021

Thank you for the PR. Looks good.

I'll check it and the possibility to update Flexmark later this week.

@rkulyniak
Copy link

Hello @walokra. Are there any updates on this PR?
This functionality is very important for us. Please take a look when you have time.

@walokra walokra merged commit 96a394f into walokra:master Sep 9, 2021
@walokra
Copy link
Owner

walokra commented Sep 9, 2021

The PR is now merged and it's included on just released version of 2.4.0.

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.

Unique header ids
3 participants