Skip to content

Commit

Permalink
add jekyll include support to docx converter
Browse files Browse the repository at this point in the history
  • Loading branch information
vsch committed Mar 30, 2020
1 parent e746b9b commit f2aa458
Show file tree
Hide file tree
Showing 131 changed files with 5,777 additions and 185 deletions.
7 changes: 7 additions & 0 deletions .idea/markdown-navigator.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ optimization of implementation classes. Changes are detailed in

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

### 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)
### 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)

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

Expand Down Expand Up @@ -54,7 +54,7 @@ following sample:
<dependency>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-all</artifactId>
<version>0.60.2</version>
<version>0.61.0</version>
</dependency>
```

Expand Down Expand Up @@ -93,7 +93,7 @@ public class BasicSample {
#### Building via Gradle

```shell
compile 'com.vladsch.flexmark:flexmark-all:0.60.2'
compile 'com.vladsch.flexmark:flexmark-all:0.61.0'
```

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

### Latest Additions and Changes

* Major reorganization and code cleanup of implementation in version 0.60.2, see
* Major reorganization and code cleanup of implementation in version 0.61.0, see
[Version-0.60.0-Changes](../../wiki/Version-0.60.0-Changes)
* [Flexmark Architecture and Dependencies Diagrams](https://sourcespy.com/github/flexmark/)
thanks to great work by [Alex Karezin](mailto:[email protected]) you can get an overview
Expand Down
32 changes: 29 additions & 3 deletions VERSION-TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

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

## Next 0.60.xx
## Next 0.61.xx

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

## 0.61.0

* Fix: enable original spec tests
* Fix: merge [#391, PR: Fix: CRLF line separator in fenced code blocks produce redundant CR.]
* Fix: merge [#387, JUnit is in the compile scope]
* Add: ability to insert anchor ref targets to `HtmlIdGenerator` when scanning a document.
* Add: add `LinkResolverBasicContext` as base interface of `LinkResolverContext` to allow simple
context to pass to `LinkResolver` when resolving links without needing to implement all unused
methods of `LinkResolverContext`.
* Break: change argument to `LinkResolver` and `LinkResolverFactory` to
`LinkResolverBasicContext`. Except for `JekyllTagExtension`, the argument is still
`LinkResolverContext` and passed value can be cast to this if required.
* Add: support for `JekyllTagBlock` with `include` directive to `DocxRenderer`

Use `{% include includeFile %}` to include the file into the source document. `includeFile` is
resolved relative to `DocxRenderer.DOC_RELATIVE_URL` or `DocxRenderer.DOC_ROOT_URL`. The
latter is used if `includeFile` starts with `/`

Will only include files if `JekyllTagExtension.LINK_RESOLVER_FACTORIES` is not empty, in which
case the link resolvers will be used to resolve `includeFile` to full file path. Use singleton
list of `DocxLinkResolver.Factory` instance to resolve using doc relative and root url paths.

## 0.60.2

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

<!-- @IGNORE PREVIOUS: link -->

[#292, 0.40.0: JUnit is in the compile scope]: https://github.com/vsch/flexmark-java/issues/292
[#293, YamlFrontMatterBlock rendered as markdown does not preserve nested lists]: https://github.com/vsch/flexmark-java/issues/293
[#294, BlankLine nodes within BlockQuote change in behaviour]: https://github.com/vsch/flexmark-java/issues/294
Expand Down Expand Up @@ -2272,6 +2297,8 @@ Please give feedback on the upcoming changes if you have concerns about breaking
[#381, StackOverflowError with long base64 image and LINKS\_ALLOW\_MATCHED\_PARENTHESES disabled]: https://github.com/vsch/flexmark-java/issues/381
[#382, Is there an option for number of whitespaces needed to create sub-lists?]: https://github.com/vsch/flexmark-java/issues/382
[#384, Markdown parser produces invalid HTML]: https://github.com/vsch/flexmark-java/issues/384
[#387, JUnit is in the compile scope]: https://github.com/vsch/flexmark-java/pull/387
[#391, PR: Fix: CRLF line separator in fenced code blocks produce redundant CR.]: https://github.com/vsch/flexmark-java/pull/391
[Awesome Console]: https://plugins.jetbrains.com/plugin/7677-awesome-console "Awesome Console"
[HtmlToMarkdownCustomizedSample.java]: https://github.com/vsch/flexmark-java/blob/master/flexmark-java-samples/src/com/vladsch/flexmark/java/samples/HtmlToMarkdownCustomizedSample.java
[Kijimuna]: https://github.com/Kijimuna
Expand All @@ -2283,5 +2310,4 @@ Please give feedback on the upcoming changes if you have concerns about breaking
[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
<!-- @IGNORE PREVIOUS: link -->
[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
<!-- @IGNORE PREVIOUS: link -->

2 changes: 1 addition & 1 deletion flexmark-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-java</artifactId>
<version>0.60.2</version>
<version>0.61.0</version>
</parent>

<artifactId>flexmark-all</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion flexmark-core-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-java</artifactId>
<version>0.60.2</version>
<version>0.61.0</version>
</parent>

<artifactId>flexmark-core-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,13 @@ static class CustomLinkResolverImpl implements LinkResolver {

final String docUrl;

public CustomLinkResolverImpl(LinkResolverContext context) {
public CustomLinkResolverImpl(LinkResolverBasicContext context) {
docUrl = DOC_RELATIVE_URL.get(context.getOptions());
}

@NotNull
@Override
public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverContext context, @NotNull ResolvedLink link) {
public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverBasicContext context, @NotNull ResolvedLink link) {
if (node instanceof Link) {
Link linkNode = (Link) node;
if (linkNode.getUrl().equals("/url")) {
Expand All @@ -351,7 +351,7 @@ public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverContext
static class Factory extends IndependentLinkResolverFactory {
@NotNull
@Override
public LinkResolver apply(@NotNull LinkResolverContext context) {
public LinkResolver apply(@NotNull LinkResolverBasicContext context) {
return new CustomLinkResolverImpl(context);
}
}
Expand All @@ -367,13 +367,13 @@ public void withOptions_customLinkResolver() {
}

static class CustomRefLinkResolverImpl implements LinkResolver {
public CustomRefLinkResolverImpl(LinkResolverContext context) {
public CustomRefLinkResolverImpl(LinkResolverBasicContext context) {

}

@NotNull
@Override
public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverContext context, @NotNull ResolvedLink link) {
public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverBasicContext context, @NotNull ResolvedLink link) {
if (node instanceof LinkRef || node instanceof ImageRef) {
RefNode linkNode = (RefNode) node;
if (linkNode.getReference().startsWith(":")) {
Expand All @@ -386,7 +386,7 @@ public ResolvedLink resolveLink(@NotNull Node node, @NotNull LinkResolverContext
static class Factory extends IndependentLinkResolverFactory {
@NotNull
@Override
public LinkResolver apply(@NotNull LinkResolverContext context) {
public LinkResolver apply(@NotNull LinkResolverBasicContext context) {
return new CustomLinkResolverImpl(context);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
FullOrigSpecCoreTest.class,
FullOrigSpec027CoreTest.class,
FullOrigSpec028CoreTest.class,
FullOrigSpec029CoreTest.class,
ComboCoreSpecTest.class,
ComboCoreDirectionalSpecTest.class,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ final public class FullOrigSpec027CoreTest extends OrigSpecCoreTest {
public FullOrigSpec027CoreTest() {
super(OPTIONS);
}

@Override
@NotNull
protected ResourceLocation getSpecResourceLocation() {
return RESOURCE_LOCATION;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ final public class FullOrigSpec028CoreTest extends OrigSpecCoreTest {
public FullOrigSpec028CoreTest() {
super(OPTIONS);
}

@Override
@NotNull
protected ResourceLocation getSpecResourceLocation() {
return RESOURCE_LOCATION;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.vladsch.flexmark.core.test.util.renderer;

import com.vladsch.flexmark.parser.ParserEmulationProfile;
import com.vladsch.flexmark.test.util.spec.ResourceLocation;
import com.vladsch.flexmark.util.data.DataHolder;
import org.jetbrains.annotations.NotNull;

final public class FullOrigSpec029CoreTest extends OrigSpecCoreTest {
static final String SPEC_RESOURCE = "/spec.0.29.txt";
final public static @NotNull ResourceLocation RESOURCE_LOCATION = ResourceLocation.of(SPEC_RESOURCE);
final private static DataHolder OPTIONS = ParserEmulationProfile.COMMONMARK_0_29.getProfileOptions().toImmutable();

public FullOrigSpec029CoreTest() {
super(OPTIONS);
}

@Override
@NotNull
protected ResourceLocation getSpecResourceLocation() {
// FIX: implement 0.29 spec and enable test
//return RESOURCE_LOCATION;
return ResourceLocation.NULL;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ final public class FullOrigSpecCoreTest extends OrigSpecCoreTest {
public FullOrigSpecCoreTest() {
super(null);
}

@Override
@NotNull
protected ResourceLocation getSpecResourceLocation() {
return RESOURCE_LOCATION;
}
}
3 changes: 2 additions & 1 deletion flexmark-docx-converter/flexmark-docx-converter.iml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
<orderEntry type="library" name="org.docx4j:docx4j-JAXB-Internal" level="project" />
<orderEntry type="library" name="log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" name="org.jetbrains:annotations" level="project" />
<orderEntry type="module" module-name="flexmark-ext-jekyll-tag" />
</component>
</module>
</module>
6 changes: 5 additions & 1 deletion flexmark-docx-converter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-java</artifactId>
<version>0.60.2</version>
<version>0.61.0</version>
</parent>

<artifactId>flexmark-docx-converter</artifactId>
Expand Down Expand Up @@ -51,6 +51,10 @@
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-ext-ins</artifactId>
</dependency>
<dependency>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-ext-jekyll-tag</artifactId>
</dependency>
<dependency>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-ext-superscript</artifactId>
Expand Down
Loading

0 comments on commit f2aa458

Please sign in to comment.