help translations
This commit is contained in:
parent
4e5796ea3e
commit
c8c7e1546f
11 changed files with 1044 additions and 347 deletions
|
|
@ -1,4 +1,10 @@
|
|||
ext.markdownToHTML = { markdownPath, htmlPath ->
|
||||
ext.convertHelpDocs = {markdownDir, htmlDir ->
|
||||
fileTree(markdownDir).getFiles().parallelStream().forEach { File markdownPath ->
|
||||
markdownToHtml(markdownPath.path, "${htmlDir}/${markdownPath.name.replaceAll("\\.md\$", ".html")}")
|
||||
}
|
||||
}
|
||||
|
||||
static markdownToHtml(markdownPath, htmlPath) {
|
||||
def text = new File(markdownPath).text
|
||||
|
||||
text = convertHeaders(text)
|
||||
|
|
@ -63,7 +69,7 @@ static convertHeaders(markdown) {
|
|||
}
|
||||
|
||||
def header = line.replaceAll("^#+", "").trim()
|
||||
def anchor = header.toLowerCase().replaceAll("[^a-z0-9]+", "-").replaceAll("[\\-]+\$", "")
|
||||
def anchor = header.toLowerCase().replaceAll("[^\\d\\p{L}]+", "-").replaceAll("[\\-]+\$", "")
|
||||
|
||||
return "<h${headerNumber} id=\"${anchor}\">${header}</h${headerNumber}>"
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue