X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=utils%2Fdebian%2Fdebian_build.gradle;h=a0e8cd9bc449b91d9b60e78a39c45394da032277;hb=f2ae581a7c93c7c92a574d6c92ee7e0d9fb7b775;hp=998645af0586afc701c1742ca2149dc676f9e875;hpb=6fa882584a8e33a1c9975391dfe34520940ba8c6;p=jalview.git diff --git a/utils/debian/debian_build.gradle b/utils/debian/debian_build.gradle index 998645a..a0e8cd9 100644 --- a/utils/debian/debian_build.gradle +++ b/utils/debian/debian_build.gradle @@ -2,27 +2,10 @@ * For properties set within build.gradle, use camelCaseNoSpace. */ import org.apache.tools.ant.filters.ReplaceTokens -import com.vladsch.flexmark.util.ast.Node -import com.vladsch.flexmark.html.HtmlRenderer -import com.vladsch.flexmark.parser.Parser -import com.vladsch.flexmark.util.data.MutableDataSet -import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension -import com.vladsch.flexmark.ext.tables.TablesExtension -import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension -import com.vladsch.flexmark.ext.autolink.AutolinkExtension -import com.vladsch.flexmark.ext.anchorlink.AnchorLinkExtension -import com.vladsch.flexmark.ext.toc.TocExtension - -buildscript { - dependencies { - classpath "com.vladsch.flexmark:flexmark-all:0.62.0" - } -} plugins { id 'java' id 'application' - id 'com.palantir.git-version' version '0.12.3' } // in ext the values are cast to Object. Ensure string values are cast as String (and not GStringImpl) for later use @@ -65,7 +48,7 @@ def overrideProperties(String propsFileName, boolean output = false) { } } -ext { +project.ext { jalviewDirAbsolutePath = file(jalviewDir).getAbsolutePath() jalviewDirRelativePath = jalviewDir @@ -115,10 +98,6 @@ ext { install4jApplicationName = "${jalview_name}" - def details = versionDetails() - gitHash = details.gitHash - gitBranch = details.branchName - println("Using a ${CHANNEL} profile.") additional_compiler_args = [] @@ -257,85 +236,6 @@ def getDate(format) { } -def convertMdToHtml (FileTree mdFiles, File cssFile) { - MutableDataSet options = new MutableDataSet() - - def extensions = new ArrayList<>() - extensions.add(AnchorLinkExtension.create()) - extensions.add(AutolinkExtension.create()) - extensions.add(StrikethroughExtension.create()) - extensions.add(TaskListExtension.create()) - extensions.add(TablesExtension.create()) - extensions.add(TocExtension.create()) - - options.set(Parser.EXTENSIONS, extensions) - - // set GFM table parsing options - options.set(TablesExtension.WITH_CAPTION, false) - options.set(TablesExtension.COLUMN_SPANS, false) - options.set(TablesExtension.MIN_HEADER_ROWS, 1) - options.set(TablesExtension.MAX_HEADER_ROWS, 1) - options.set(TablesExtension.APPEND_MISSING_COLUMNS, true) - options.set(TablesExtension.DISCARD_EXTRA_COLUMNS, true) - options.set(TablesExtension.HEADER_SEPARATOR_COLUMN_MATCH, true) - // GFM anchor links - options.set(AnchorLinkExtension.ANCHORLINKS_SET_ID, false) - options.set(AnchorLinkExtension.ANCHORLINKS_ANCHOR_CLASS, "anchor") - options.set(AnchorLinkExtension.ANCHORLINKS_SET_NAME, true) - options.set(AnchorLinkExtension.ANCHORLINKS_TEXT_PREFIX, "") - - Parser parser = Parser.builder(options).build() - HtmlRenderer renderer = HtmlRenderer.builder(options).build() - - mdFiles.each { mdFile -> - // add table of contents - def mdText = "[TOC]\n"+mdFile.text - - // grab the first top-level title - def title = null - def titleRegex = /(?m)^#(\s+|([^#]))(.*)/ - def matcher = mdText =~ titleRegex - if (matcher.size() > 0) { - // matcher[0][2] is the first character of the title if there wasn't any whitespace after the # - title = (matcher[0][2] != null ? matcher[0][2] : "")+matcher[0][3] - } - // or use the filename if none found - if (title == null) { - title = mdFile.getName() - } - - Node document = parser.parse(mdText) - String htmlBody = renderer.render(document) - def htmlText = ''' - - -
- - - -''' - htmlText += ((title != null) ? "