@@ -0,0 +1,3098 @@
+package com.deepoove.poi.plugin.markdown;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0Aimport org.apache.commons.io.FileUtils;%0Aimport org.commonmark.Extension;%0Aimport org.commonmark.ext.gfm.tables.TablesExtension;%0Aimport org.commonmark.node.AbstractVisitor;%0Aimport org.commonmark.node.BulletList;%0Aimport org.commonmark.node.Link;%0Aimport org.commonmark.node.ListItem;%0Aimport org.commonmark.node.Node;%0Aimport org.commonmark.node.Paragraph;%0Aimport org.commonmark.node.Text;%0Aimport org.commonmark.parser.Parser;%0A%0Apublic class DocsifyTest %7B%0A%0A    String docsifyFolder = %22/Users/Sayi/docs%22;%0A%0A//    @BeforeEach%0A    @SuppressWarnings(%22unchecked%22)%0A    public void init() throws IOException %7B%0A        Path path = Paths.get(%22docsify%22);%0A        Files.createDirectories(path);%0A%0A        FileUtils.cleanDirectory(new File(%22docsify%22));%0A%0A        Collection%3CFile%3E listFiles = FileUtils.listFiles(new File(docsifyFolder), new String%5B%5D %7B %22png%22 %7D, true);%0A        for (File src : listFiles) %7B%0A            FileUtils.copyFile(src, new File(%22docsify/%22 + src.getName()));%0A%0A        %7D%0A    %7D%0A%0A//    @Test%0A    public void testConvertAllInOne() throws Exception %7B%0A        StringBuilder all = new StringBuilder();%0A%0A        String toc = new String(Files.readAllBytes(Paths.get(docsifyFolder, %22_sidebar.md%22)));%0A        List%3CExtension%3E extensions = Arrays.asList(TablesExtension.create());%0A        Parser parser = Parser.builder().extensions(extensions).build();%0A        Node node = parser.parse(toc);%0A        node.accept(new AbstractVisitor() %7B%0A            @Override%0A            public void visit(BulletList listBlock) %7B%0A                Node node = listBlock.getFirstChild();%0A                while (null != node) %7B%0A                    if (node instanceof ListItem) %7B%0A                        Node itemNode = node.getFirstChild();%0A                        while (null != itemNode) %7B%0A                            Paragraph p = (Paragraph) itemNode;%0A                            Node toc = p.getFirstChild();%0A                            Link t = (Link) toc;%0A                            String destination = t.getDestination();%0A                            String title = ((Text) t.getFirstChild()).getLiteral();%0A                            all.append(%22%5Cn## %22 + title + %22%5Cn%22);%0A                            try %7B%0A                                all.append(new String(%0A                                        Files.readAllBytes(Paths.get(docsifyFolder, destination, %22README.md%22))));%0A                            %7D catch (IOException e) %7B%0A                                e.printStackTrace();%0A                            %7D%0A                            itemNode = itemNode.getNext();%0A                        %7D%0A                    %7D%0A                    node = node.getNext();%0A                %7D%0A            %7D%0A        %7D);%0A%0A        System.out.println(all);%0A        Path file = Files.createFile(Paths.get(%22docsify/all.md%22));%0A        Files.write(file, all.toString().getBytes());%0A%0A    %7D%0A%0A%7D%0A

convert docsify to word