我想将java specification documentation转换为易于编辑的格式(markdown或asciidoc)并上传GitHub Gist并自定义(添加我的代码体验和注释 . )我想转换为something like this

我使用一个名为pandoc的工具,它允许我们从HTML转换为markdown .

我试过以下:

Technique 1 我试图在index.html上转换java规范的所有组件表

pandoc -f html -t markdown -o test2.md  
https://docs.orac le.com/javase/specs/jls/se10/html/index.html`

我得到了这个:tes2.md(我没有在这里上传,因为内容文件太长了)

问题1:此markdown文件没有java规范文档的内容 . 我希望我在markdown文件中得到markdown toc(组件表)和java规范文档内容,如this

问题2:当点击此降价文件上的链接时,我得到404错误页面 .

Technique 2(Better than technique 1) 我使用HTTrack下载了TOC的所有HTML文件,并尝试单独转换所有文件 .

pandoc -f html-native_divs-native_spans -i jls-1.html -t markdown -o test2.md

Problem 1 :我得到了以下markdown文件,其中包含无法重定向到同一文档的另一部分的组件链接表 . 当我点击这个链接时,它们返回外部GitHub页面:https://gist.github.com/lostdinar2/jls-1.html#jls-1.1这是不可用的 . test3.md

problem 1 的演示:

1)我想将此HTML内部id链接(#)转换为重定向到同一文档的另一部分的markdown内部链接

<dt><span class="section"><a href="jls-2.html#jls-2.2">2.2. The Lexical Grammar</a></span></dt>

[link text](#abcd)

2)但是pandoc无法将此链接转换为markdown内部链接.Pandoc创建如下的外部链接:https://gist.github.com/lostdinar2/jls-1.html#jls-1.1

是否有一个pandoc参数来解决这个问题?我在pandoc文档上搜索但我不能做这个功能 .