Skip to content

Commit f2aa458

Browse files
committed
add jekyll include support to docx converter
1 parent e746b9b commit f2aa458

131 files changed

Lines changed: 5777 additions & 185 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/markdown-navigator.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ optimization of implementation classes. Changes are detailed in
2424

2525
### master [![Build status](https://travis-ci.org/vsch/flexmark-java.svg?branch=master)](https://travis-ci.org/vsch/flexmark-java)
2626

27-
### latest [![Maven Central status](https://img.shields.io/maven-central/v/com.vladsch.flexmark/flexmark.svg)](https://search.maven.org/search?q=g:com.vladsch.flexmark)<!-- @IGNORE PREVIOUS: link --> [![Build status](https://travis-ci.org/vsch/flexmark-java.svg?branch=0.60.2)](https://travis-ci.org/vsch/flexmark-java) [![Javadocs](https://www.javadoc.io/badge/com.vladsch.flexmark/flexmark.svg)](https://www.javadoc.io/doc/com.vladsch.flexmark/flexmark)
27+
### latest [![Maven Central status](https://img.shields.io/maven-central/v/com.vladsch.flexmark/flexmark.svg)](https://search.maven.org/search?q=g:com.vladsch.flexmark)<!-- @IGNORE PREVIOUS: link --> [![Build status](https://travis-ci.org/vsch/flexmark-java.svg?branch=0.61.0)](https://travis-ci.org/vsch/flexmark-java) [![Javadocs](https://www.javadoc.io/badge/com.vladsch.flexmark/flexmark.svg)](https://www.javadoc.io/doc/com.vladsch.flexmark/flexmark)
2828

2929
<!-- [![codecov](https://codecov.io/gh/vsch/flexmark-java/branch/master/graph/badge.svg)](https://codecov.io/gh/vsch/flexmark-java) -->
3030

@@ -54,7 +54,7 @@ following sample:
5454
<dependency>
5555
<groupId>com.vladsch.flexmark</groupId>
5656
<artifactId>flexmark-all</artifactId>
57-
<version>0.60.2</version>
57+
<version>0.61.0</version>
5858
</dependency>
5959
```
6060

@@ -93,7 +93,7 @@ public class BasicSample {
9393
#### Building via Gradle
9494

9595
```shell
96-
compile 'com.vladsch.flexmark:flexmark-all:0.60.2'
96+
compile 'com.vladsch.flexmark:flexmark-all:0.61.0'
9797
```
9898

9999
#### Building with Android Studio
@@ -183,7 +183,7 @@ custom node renderer if you need to override the generated link HTML.
183183

184184
### Latest Additions and Changes
185185

186-
* Major reorganization and code cleanup of implementation in version 0.60.2, see
186+
* Major reorganization and code cleanup of implementation in version 0.61.0, see
187187
[Version-0.60.0-Changes](../../wiki/Version-0.60.0-Changes)
188188
* [Flexmark Architecture and Dependencies Diagrams](https://sourcespy.com/github/flexmark/)
189189
thanks to great work by [Alex Karezin](mailto:javadiagrams@gmail.com) you can get an overview

VERSION-TODO.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
- [Release 0.60.0](#release-0600)
88
- [API Refactoring](#api-refactoring)
9-
- [Next 0.60.xx](#next-060xx)
9+
- [Next 0.61.xx](#next-061xx)
10+
- [0.61.0](#0610)
1011
- [0.60.2](#0602)
1112
- [0.60.0](#0600)
1213
- [0.59.124](#059124)
@@ -175,7 +176,7 @@ Please give feedback on the upcoming changes if you have concerns about breaking
175176
* `com.vladsch.flexmark.util.ast.NodeAdaptingVisitHandler`
176177
* `com.vladsch.flexmark.util.ast.NodeAdaptingVisitor`
177178

178-
## Next 0.60.xx
179+
## Next 0.61.xx
179180

180181
+ [ ] Fix: replace `PrefixedSubSequence` and `SegmentedSequence.create()` with non builder
181182
arguments to use `SequenceBuilder` throughout library code, except where
@@ -213,6 +214,28 @@ Please give feedback on the upcoming changes if you have concerns about breaking
213214
`|` for each line that was wrapped. Otherwise, it is impossible to tell where each line
214215
ends and another begins.
215216

217+
## 0.61.0
218+
219+
* Fix: enable original spec tests
220+
* Fix: merge [#391, PR: Fix: CRLF line separator in fenced code blocks produce redundant CR.]
221+
* Fix: merge [#387, JUnit is in the compile scope]
222+
* Add: ability to insert anchor ref targets to `HtmlIdGenerator` when scanning a document.
223+
* Add: add `LinkResolverBasicContext` as base interface of `LinkResolverContext` to allow simple
224+
context to pass to `LinkResolver` when resolving links without needing to implement all unused
225+
methods of `LinkResolverContext`.
226+
* Break: change argument to `LinkResolver` and `LinkResolverFactory` to
227+
`LinkResolverBasicContext`. Except for `JekyllTagExtension`, the argument is still
228+
`LinkResolverContext` and passed value can be cast to this if required.
229+
* Add: support for `JekyllTagBlock` with `include` directive to `DocxRenderer`
230+
231+
Use `{% include includeFile %}` to include the file into the source document. `includeFile` is
232+
resolved relative to `DocxRenderer.DOC_RELATIVE_URL` or `DocxRenderer.DOC_ROOT_URL`. The
233+
latter is used if `includeFile` starts with `/`
234+
235+
Will only include files if `JekyllTagExtension.LINK_RESOLVER_FACTORIES` is not empty, in which
236+
case the link resolvers will be used to resolve `includeFile` to full file path. Use singleton
237+
list of `DocxLinkResolver.Factory` instance to resolve using doc relative and root url paths.
238+
216239
## 0.60.2
217240

218241
* Fix: change formatter sub-context rendering node to nullable
@@ -2239,6 +2262,8 @@ Please give feedback on the upcoming changes if you have concerns about breaking
22392262
* `com.vladsch.flexmark.formatter.internal.NodeFormatterSubContext` to `com.vladsch.flexmark.formatter.NodeFormatterSubContext`
22402263
<!--@formatter:on-->
22412264

2265+
<!-- @IGNORE PREVIOUS: link -->
2266+
22422267
[#292, 0.40.0: JUnit is in the compile scope]: https://github.com/vsch/flexmark-java/issues/292
22432268
[#293, YamlFrontMatterBlock rendered as markdown does not preserve nested lists]: https://github.com/vsch/flexmark-java/issues/293
22442269
[#294, BlankLine nodes within BlockQuote change in behaviour]: https://github.com/vsch/flexmark-java/issues/294
@@ -2272,6 +2297,8 @@ Please give feedback on the upcoming changes if you have concerns about breaking
22722297
[#381, StackOverflowError with long base64 image and LINKS\_ALLOW\_MATCHED\_PARENTHESES disabled]: https://github.com/vsch/flexmark-java/issues/381
22732298
[#382, Is there an option for number of whitespaces needed to create sub-lists?]: https://github.com/vsch/flexmark-java/issues/382
22742299
[#384, Markdown parser produces invalid HTML]: https://github.com/vsch/flexmark-java/issues/384
2300+
[#387, JUnit is in the compile scope]: https://github.com/vsch/flexmark-java/pull/387
2301+
[#391, PR: Fix: CRLF line separator in fenced code blocks produce redundant CR.]: https://github.com/vsch/flexmark-java/pull/391
22752302
[Awesome Console]: https://plugins.jetbrains.com/plugin/7677-awesome-console "Awesome Console"
22762303
[HtmlToMarkdownCustomizedSample.java]: https://github.com/vsch/flexmark-java/blob/master/flexmark-java-samples/src/com/vladsch/flexmark/java/samples/HtmlToMarkdownCustomizedSample.java
22772304
[Kijimuna]: https://github.com/Kijimuna
@@ -2283,5 +2310,4 @@ Please give feedback on the upcoming changes if you have concerns about breaking
22832310
[migrate flexmark-java 0_40_x to 0_42_0]: https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_40_x%20to%200_42_0.xml
22842311
<!-- @IGNORE PREVIOUS: link -->
22852312
[migrate flexmark-java 0_42_x to 0_50_0.xml]: https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_42_x%20to%200_50_0.xml
2286-
<!-- @IGNORE PREVIOUS: link -->
22872313

flexmark-all/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.vladsch.flexmark</groupId>
99
<artifactId>flexmark-java</artifactId>
10-
<version>0.60.2</version>
10+
<version>0.61.0</version>
1111
</parent>
1212

1313
<artifactId>flexmark-all</artifactId>

flexmark-core-test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.vladsch.flexmark</groupId>
66
<artifactId>flexmark-java</artifactId>
7-
<version>0.60.2</version>
7+
<version>0.61.0</version>
88
</parent>
99

1010
<artifactId>flexmark-core-test</artifactId>

flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/html/HtmlRendererTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,13 @@ static class CustomLinkResolverImpl implements LinkResolver {
332332

333333
final String docUrl;
334334

335-
public CustomLinkResolverImpl(LinkResolverContext context) {
335+
public CustomLinkResolverImpl(LinkResolverBasicContext context) {
336336
docUrl = DOC_RELATIVE_URL.get(context.getOptions());
337337
}
338338

339339
@NotNull
340340
@Override
341-
public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverContext context, @NotNull ResolvedLink link) {
341+
public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverBasicContext context, @NotNull ResolvedLink link) {
342342
if (node instanceof Link) {
343343
Link linkNode = (Link) node;
344344
if (linkNode.getUrl().equals("/url")) {
@@ -351,7 +351,7 @@ public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverContext
351351
static class Factory extends IndependentLinkResolverFactory {
352352
@NotNull
353353
@Override
354-
public LinkResolver apply(@NotNull LinkResolverContext context) {
354+
public LinkResolver apply(@NotNull LinkResolverBasicContext context) {
355355
return new CustomLinkResolverImpl(context);
356356
}
357357
}
@@ -367,13 +367,13 @@ public void withOptions_customLinkResolver() {
367367
}
368368

369369
static class CustomRefLinkResolverImpl implements LinkResolver {
370-
public CustomRefLinkResolverImpl(LinkResolverContext context) {
370+
public CustomRefLinkResolverImpl(LinkResolverBasicContext context) {
371371

372372
}
373373

374374
@NotNull
375375
@Override
376-
public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverContext context, @NotNull ResolvedLink link) {
376+
public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverBasicContext context, @NotNull ResolvedLink link) {
377377
if (node instanceof LinkRef || node instanceof ImageRef) {
378378
RefNode linkNode = (RefNode) node;
379379
if (linkNode.getReference().startsWith(":")) {
@@ -386,7 +386,7 @@ public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverContext
386386
static class Factory extends IndependentLinkResolverFactory {
387387
@NotNull
388388
@Override
389-
public LinkResolver apply(@NotNull LinkResolverContext context) {
389+
public LinkResolver apply(@NotNull LinkResolverBasicContext context) {
390390
return new CustomLinkResolverImpl(context);
391391
}
392392
}

flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/renderer/CoreRendererTestSuite.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
FullOrigSpecCoreTest.class,
1212
FullOrigSpec027CoreTest.class,
1313
FullOrigSpec028CoreTest.class,
14+
FullOrigSpec029CoreTest.class,
1415
ComboCoreSpecTest.class,
1516
ComboCoreDirectionalSpecTest.class,
1617
})

flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/renderer/FullOrigSpec027CoreTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ final public class FullOrigSpec027CoreTest extends OrigSpecCoreTest {
1313
public FullOrigSpec027CoreTest() {
1414
super(OPTIONS);
1515
}
16+
17+
@Override
18+
@NotNull
19+
protected ResourceLocation getSpecResourceLocation() {
20+
return RESOURCE_LOCATION;
21+
}
1622
}

flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/renderer/FullOrigSpec028CoreTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ final public class FullOrigSpec028CoreTest extends OrigSpecCoreTest {
1313
public FullOrigSpec028CoreTest() {
1414
super(OPTIONS);
1515
}
16+
17+
@Override
18+
@NotNull
19+
protected ResourceLocation getSpecResourceLocation() {
20+
return RESOURCE_LOCATION;
21+
}
1622
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.vladsch.flexmark.core.test.util.renderer;
2+
3+
import com.vladsch.flexmark.parser.ParserEmulationProfile;
4+
import com.vladsch.flexmark.test.util.spec.ResourceLocation;
5+
import com.vladsch.flexmark.util.data.DataHolder;
6+
import org.jetbrains.annotations.NotNull;
7+
8+
final public class FullOrigSpec029CoreTest extends OrigSpecCoreTest {
9+
static final String SPEC_RESOURCE = "/spec.0.29.txt";
10+
final public static @NotNull ResourceLocation RESOURCE_LOCATION = ResourceLocation.of(SPEC_RESOURCE);
11+
final private static DataHolder OPTIONS = ParserEmulationProfile.COMMONMARK_0_29.getProfileOptions().toImmutable();
12+
13+
public FullOrigSpec029CoreTest() {
14+
super(OPTIONS);
15+
}
16+
17+
@Override
18+
@NotNull
19+
protected ResourceLocation getSpecResourceLocation() {
20+
// FIX: implement 0.29 spec and enable test
21+
//return RESOURCE_LOCATION;
22+
return ResourceLocation.NULL;
23+
}
24+
}

0 commit comments

Comments
 (0)