Skip to content

Commit

Permalink
Update flexmark-java
Browse files Browse the repository at this point in the history
- Version modification in Build.scala
- Import changed where needed
  • Loading branch information
BryanAbate committed Jun 15, 2019
1 parent eb27b4a commit 75abb0a
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package comment
import dotty.tools.dottydoc.util.syntax._
import dotty.tools.dotc.core.Contexts.Context
import dotty.tools.dotc.util.Spans._
import com.vladsch.flexmark.ast.{ Node => MarkdownNode }
import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode }
import HtmlParsers._
import util.MemberLookup

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import dotty.tools.dotc.printing.Formatting.hl
import scala.collection.mutable
import dotty.tools.dotc.config.Printers.dottydoc
import scala.util.matching.Regex
import com.vladsch.flexmark.ast.{ Node => MarkdownNode }
import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode }
import com.vladsch.flexmark.parser.{ Parser => MarkdownParser }

trait CommentParser extends util.MemberLookup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import dotc.util.Spans._
import dotty.tools.dottydoc.util.syntax._
import util.MemberLookup

import com.vladsch.flexmark.ast.{ Node => MarkdownNode }
import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode}
import com.vladsch.flexmark.html.HtmlRenderer
import com.vladsch.flexmark.parser.Parser
import com.vladsch.flexmark.util.sequence.CharSubSequence
Expand All @@ -17,7 +17,9 @@ object HtmlParsers {

implicit class StringToMarkdown(val text: String) extends AnyVal {
def toMarkdown(origin: Entity)(implicit ctx: Context): MarkdownNode = {
import com.vladsch.flexmark.ast.{ Link, Visitor, VisitHandler, NodeVisitor }
import com.vladsch.flexmark.ast.Link
import com.vladsch.flexmark.util.ast.{Visitor, VisitHandler, NodeVisitor }


val inlineToHtml = InlineToHtml(origin)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package comment
* @note calling `shorten` **will** mutate the Markdown AST node.
*/
class MarkdownShortener {
import com.vladsch.flexmark.util.ast._
import com.vladsch.flexmark.ast._

def shorten(node: Node, maxLen: Int = 150): Node = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dotty.tools
package dottydoc
package staticsite

import com.vladsch.flexmark.util.ast._
import com.vladsch.flexmark.ast._
import com.vladsch.flexmark.util.sequence.CharSubSequence

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dottydoc
package staticsite

import com.vladsch.flexmark.ast._
import com.vladsch.flexmark.util.ast._
import com.vladsch.flexmark.util.sequence.{BasedSequence, CharSubSequence}
import model.{Def, Package, TypeAlias, Val}
import dottydoc.util.MemberLookup
Expand Down
38 changes: 36 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,29 @@ object Build {
)
)

lazy val tastydocSettings = Seq(
baseDirectory in (Compile, run) := baseDirectory.value / "..",
baseDirectory in Test := baseDirectory.value / "..",
libraryDependencies +=
"com.novocode" % "junit-interface" % "0.11",
libraryDependencies ++= {
val flexmarkVersion = "0.40.24"
Seq(
"com.vladsch.flexmark" % "flexmark-all" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-gfm-tasklist" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-gfm-tables" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-autolink" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-anchorlink" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-emoji" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-gfm-strikethrough" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-yaml-front-matter" % flexmarkVersion,
Dependencies.`jackson-dataformat-yaml`,
"nl.big-o" % "liqp" % "0.6.7"
)
}
)

// Settings shared between dotty-doc and dotty-doc-bootstrapped
def dottyDocSettings(implicit mode: Mode) = Seq(
baseDirectory in (Compile, run) := baseDirectory.value / "..",
baseDirectory in Test := baseDirectory.value / "..",
Expand Down Expand Up @@ -396,9 +419,9 @@ object Build {
}.evaluated,

libraryDependencies ++= {
val flexmarkVersion = "0.28.32"
val flexmarkVersion = "0.42.12"
Seq(
"com.vladsch.flexmark" % "flexmark" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-all" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-gfm-tasklist" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-gfm-tables" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-autolink" % flexmarkVersion,
Expand Down Expand Up @@ -976,6 +999,9 @@ object Build {
addCompilerPlugin("org.scalameta" % "semanticdb-scalac" % "4.0.0" cross CrossVersion.full)
)

lazy val `dotty-tastydoc` = project.in(file("tastydoc")).asDottyTastydoc(Bootstrapped)
lazy val `dotty-tastydoc-input` = project.in(file("tastydoc/input")).asDottyTastydocInput(Bootstrapped)

// Depend on dotty-library so that sbt projects using dotty automatically
// depend on the dotty-library
lazy val `scala-library` = project.
Expand Down Expand Up @@ -1263,6 +1289,14 @@ object Build {
dependsOn(dottyCompiler).
settings(semanticdbSettings)

def asDottyTastydoc(implicit mode: Mode): Project = project.withCommonSettings.
aggregate(`dotty-tastydoc-input`).
dependsOn(dottyCompiler).
settings(tastydocSettings)

def asDottyTastydocInput(implicit mode: Mode): Project = project.withCommonSettings.
dependsOn(dottyCompiler)

def asDist(implicit mode: Mode): Project = project.
enablePlugins(PackPlugin).
withCommonSettings.
Expand Down

0 comments on commit 75abb0a

Please sign in to comment.