fixed caching issues when building the Help page
This commit is contained in:
parent
008880a644
commit
fb0d182092
2 changed files with 6 additions and 7 deletions
|
|
@ -36,7 +36,7 @@ tasks.register('convertHelp') {
|
||||||
outputs.file HELP_HTML
|
outputs.file HELP_HTML
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
markdownToHTML(HELP_MARKDOWN, HELP_HTML, getVersionName())
|
markdownToHTML(HELP_MARKDOWN, HELP_HTML)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,6 +58,7 @@ tasks.register('updateManifest') {
|
||||||
clean {
|
clean {
|
||||||
delete LANGUAGES_OUTPUT_DIR
|
delete LANGUAGES_OUTPUT_DIR
|
||||||
delete DICTIONARIES_OUTPUT_DIR
|
delete DICTIONARIES_OUTPUT_DIR
|
||||||
|
delete HELP_HTML
|
||||||
}
|
}
|
||||||
|
|
||||||
// using the exported Closures directly causes weird values, hence the extra wrappers here
|
// using the exported Closures directly causes weird values, hence the extra wrappers here
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
ext.markdownToHTML = { markdownPath, htmlPath, version ->
|
ext.markdownToHTML = { markdownPath, htmlPath ->
|
||||||
def text = new File(markdownPath).text
|
def text = new File(markdownPath).text
|
||||||
|
|
||||||
text = convertHeaders(text, version)
|
text = convertHeaders(text)
|
||||||
text = convertOrderedLists(text)
|
text = convertOrderedLists(text)
|
||||||
text = convertUnorderedLists(text)
|
text = convertUnorderedLists(text)
|
||||||
text = convertInlineTags(text)
|
text = convertInlineTags(text)
|
||||||
|
|
@ -51,7 +51,7 @@ static insertIndex(html, index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static convertHeaders(markdown, version) {
|
static convertHeaders(markdown) {
|
||||||
def html = markdown.split("\n").collect { line ->
|
def html = markdown.split("\n").collect { line ->
|
||||||
if (line.startsWith("#")) {
|
if (line.startsWith("#")) {
|
||||||
def headerNumber = 0
|
def headerNumber = 0
|
||||||
|
|
@ -65,9 +65,7 @@ static convertHeaders(markdown, version) {
|
||||||
def header = line.replaceAll("^#+", "").trim()
|
def header = line.replaceAll("^#+", "").trim()
|
||||||
def anchor = header.toLowerCase().replaceAll("[^a-z0-9]+", "-")
|
def anchor = header.toLowerCase().replaceAll("[^a-z0-9]+", "-")
|
||||||
|
|
||||||
return "<h${headerNumber} id=\"${anchor}\">" +
|
return "<h${headerNumber} id=\"${anchor}\">${header}</h${headerNumber}>"
|
||||||
"${header}${headerNumber == 1 ? " v" + version : ''}" +
|
|
||||||
"</h${headerNumber}>"
|
|
||||||
} else {
|
} else {
|
||||||
return line
|
return line
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue