mirror of https://github.com/apache/lucene.git
support tables in generated html documentation (#489)
Tables can be used in markdown (e.g. MIGRATE.md) and will become html tables in our generated HTML docs on the website.
This commit is contained in:
parent
5aa9da9ead
commit
453168ec76
|
@ -19,6 +19,7 @@ import com.vladsch.flexmark.ast.Heading;
|
|||
import com.vladsch.flexmark.ext.abbreviation.AbbreviationExtension;
|
||||
import com.vladsch.flexmark.ext.attributes.AttributesExtension;
|
||||
import com.vladsch.flexmark.ext.autolink.AutolinkExtension;
|
||||
import com.vladsch.flexmark.ext.tables.TablesExtension;
|
||||
import com.vladsch.flexmark.html.HtmlRenderer;
|
||||
import com.vladsch.flexmark.parser.Parser;
|
||||
import com.vladsch.flexmark.parser.ParserEmulationProfile;
|
||||
|
@ -37,6 +38,7 @@ buildscript {
|
|||
classpath "com.vladsch.flexmark:flexmark-ext-abbreviation:${scriptDepVersions['flexmark']}"
|
||||
classpath "com.vladsch.flexmark:flexmark-ext-attributes:${scriptDepVersions['flexmark']}"
|
||||
classpath "com.vladsch.flexmark:flexmark-ext-autolink:${scriptDepVersions['flexmark']}"
|
||||
classpath "com.vladsch.flexmark:flexmark-ext-tables:${scriptDepVersions['flexmark']}"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +107,12 @@ class MarkdownFilter extends FilterReader {
|
|||
// convert the markdown
|
||||
MutableDataSet options = new MutableDataSet();
|
||||
options.setFrom(ParserEmulationProfile.MARKDOWN);
|
||||
options.set(Parser.EXTENSIONS, [ AbbreviationExtension.create(), AutolinkExtension.create(), AttributesExtension.create() ]);
|
||||
options.set(Parser.EXTENSIONS, [
|
||||
AbbreviationExtension.create(),
|
||||
AutolinkExtension.create(),
|
||||
AttributesExtension.create(),
|
||||
TablesExtension.create(),
|
||||
]);
|
||||
options.set(HtmlRenderer.RENDER_HEADER_ID, true);
|
||||
options.set(HtmlRenderer.MAX_TRAILING_BLANK_LINES, 0);
|
||||
Document parsed = Parser.builder(options).build().parse(markdownSource);
|
||||
|
|
Loading…
Reference in New Issue