Skip to content

Commit b86373b

Browse files
authored
Merge pull request #7664 from dotty-staging/tastydoc
Tastydoc
2 parents 7185680 + 9e4ee9f commit b86373b

File tree

531 files changed

+18567
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

531 files changed

+18567
-10
lines changed

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,37 @@ community-build/sbt-dotty-sbt
8383

8484
# Vulpix output files
8585
*.check.out
86+
87+
tastydoc/report/report\.aux
88+
89+
tastydoc/report/report\.fdb_latexmk
90+
91+
tastydoc/report/report\.fls
92+
93+
tastydoc/report/report\.synctex\.gz
94+
95+
tastydoc/report/report\.toc
96+
97+
tastydoc/report/report\.out
98+
99+
tastydoc/report/presentation/presentation\.aux
100+
101+
tastydoc/report/presentation/presentation\.fdb_latexmk
102+
103+
tastydoc/report/presentation/presentation\.fls
104+
105+
tastydoc/report/presentation/presentation\.nav
106+
107+
tastydoc/report/presentation/presentation\.out
108+
109+
tastydoc/report/presentation/presentation\.snm
110+
111+
tastydoc/report/presentation/presentation\.synctex\.gz
112+
113+
tastydoc/report/presentation/presentation\.toc
114+
115+
tastydoc/dotty-0\.15\.0-RC1/
116+
117+
tastydoc/report/presentation/presentation\.vrb
118+
119+
tastydoc/dotty-0\.16\.0-RC3/

build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ val `dotty-bench-bootstrapped` = Build.`dotty-bench-bootstrapped`
1717
val `tasty-core` = Build.`tasty-core`
1818
val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped`
1919
val `tasty-core-scala2` = Build.`tasty-core-scala2`
20+
val `dotty-tastydoc` = Build.`dotty-tastydoc`
21+
val `dotty-tastydoc-input` = Build.`dotty-tastydoc-input`
2022
val `scala-library` = Build.`scala-library`
2123
val `scala-compiler` = Build.`scala-compiler`
2224
val `scala-reflect` = Build.`scala-reflect`

doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package comment
66
import dotty.tools.dottydoc.util.syntax._
77
import dotty.tools.dotc.core.Contexts.Context
88
import dotty.tools.dotc.util.Spans._
9-
import com.vladsch.flexmark.ast.{ Node => MarkdownNode }
9+
import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode }
1010
import HtmlParsers._
1111
import util.MemberLookup
1212

doc-tool/src/dotty/tools/dottydoc/model/comment/CommentParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import dotty.tools.dotc.printing.Formatting.hl
1111
import scala.collection.mutable
1212
import dotty.tools.dotc.config.Printers.dottydoc
1313
import scala.util.matching.Regex
14-
import com.vladsch.flexmark.ast.{ Node => MarkdownNode }
14+
import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode }
1515
import com.vladsch.flexmark.parser.{ Parser => MarkdownParser }
1616

1717
trait CommentParser extends util.MemberLookup {

doc-tool/src/dotty/tools/dottydoc/model/comment/HtmlParsers.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import dotc.util.Spans._
88
import dotty.tools.dottydoc.util.syntax._
99
import util.MemberLookup
1010

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

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

2224
val inlineToHtml = InlineToHtml(origin)
2325

@@ -149,4 +151,4 @@ object HtmlParsers {
149151
}
150152
}
151153
}
152-
}
154+
}

doc-tool/src/dotty/tools/dottydoc/model/comment/MarkdownShortener.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ package comment
1010
* @note calling `shorten` **will** mutate the Markdown AST node.
1111
*/
1212
class MarkdownShortener {
13+
import com.vladsch.flexmark.util.ast._
1314
import com.vladsch.flexmark.ast._
1415

1516
def shorten(node: Node, maxLen: Int = 150): Node = {
@@ -80,4 +81,4 @@ class MarkdownShortener {
8081
nodeVisitor.visit(node)
8182
node
8283
}
83-
}
84+
}

doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownCodeBlockVisitor.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package dotty.tools
22
package dottydoc
33
package staticsite
44

5+
import com.vladsch.flexmark.util.ast._
56
import com.vladsch.flexmark.ast._
67
import com.vladsch.flexmark.util.sequence.CharSubSequence
78

@@ -16,4 +17,4 @@ object MarkdownCodeBlockVisitor {
1617
})
1718
)
1819
.visit(node)
19-
}
20+
}

doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownLinkVisitor.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package dottydoc
33
package staticsite
44

55
import com.vladsch.flexmark.ast._
6+
import com.vladsch.flexmark.util.ast._
67
import com.vladsch.flexmark.util.sequence.{BasedSequence, CharSubSequence}
78
import model.{Def, Package, TypeAlias, Val}
89
import dottydoc.util.MemberLookup
@@ -42,4 +43,4 @@ object MarkdownLinkVisitor {
4243
})
4344
)
4445
.visit(node)
45-
}
46+
}

project/Build.scala

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,28 @@ object Build {
374374
dottyLib + File.pathSeparator + findArtifactPath(externalDeps, "scala-library")
375375
}
376376

377+
lazy val tastydocSettings = Seq(
378+
baseDirectory in (Compile, run) := baseDirectory.value / "..",
379+
baseDirectory in Test := baseDirectory.value / "..",
380+
libraryDependencies +=
381+
"com.novocode" % "junit-interface" % "0.11",
382+
libraryDependencies ++= {
383+
val flexmarkVersion = "0.42.12"
384+
Seq(
385+
"com.vladsch.flexmark" % "flexmark-all" % flexmarkVersion,
386+
"com.vladsch.flexmark" % "flexmark-ext-gfm-tasklist" % flexmarkVersion,
387+
"com.vladsch.flexmark" % "flexmark-ext-gfm-tables" % flexmarkVersion,
388+
"com.vladsch.flexmark" % "flexmark-ext-autolink" % flexmarkVersion,
389+
"com.vladsch.flexmark" % "flexmark-ext-anchorlink" % flexmarkVersion,
390+
"com.vladsch.flexmark" % "flexmark-ext-emoji" % flexmarkVersion,
391+
"com.vladsch.flexmark" % "flexmark-ext-gfm-strikethrough" % flexmarkVersion,
392+
"com.vladsch.flexmark" % "flexmark-ext-yaml-front-matter" % flexmarkVersion,
393+
Dependencies.`jackson-dataformat-yaml`,
394+
"nl.big-o" % "liqp" % "0.6.7"
395+
)
396+
}
397+
)
398+
377399
def dottyDocSettings(implicit mode: Mode) = Seq(
378400
baseDirectory in (Compile, run) := baseDirectory.value / "..",
379401
baseDirectory in Test := baseDirectory.value / "..",
@@ -414,9 +436,9 @@ object Build {
414436
}.evaluated,
415437

416438
libraryDependencies ++= {
417-
val flexmarkVersion = "0.28.32"
439+
val flexmarkVersion = "0.42.12"
418440
Seq(
419-
"com.vladsch.flexmark" % "flexmark" % flexmarkVersion,
441+
"com.vladsch.flexmark" % "flexmark-all" % flexmarkVersion,
420442
"com.vladsch.flexmark" % "flexmark-ext-gfm-tasklist" % flexmarkVersion,
421443
"com.vladsch.flexmark" % "flexmark-ext-gfm-tables" % flexmarkVersion,
422444
"com.vladsch.flexmark" % "flexmark-ext-autolink" % flexmarkVersion,
@@ -1021,6 +1043,9 @@ object Build {
10211043
lazy val `dotty-bench` = project.in(file("bench")).asDottyBench(NonBootstrapped)
10221044
lazy val `dotty-bench-bootstrapped` = project.in(file("bench")).asDottyBench(Bootstrapped)
10231045

1046+
lazy val `dotty-tastydoc` = project.in(file("tastydoc")).asDottyTastydoc(Bootstrapped)
1047+
lazy val `dotty-tastydoc-input` = project.in(file("tastydoc/input")).asDottyTastydocInput(Bootstrapped)
1048+
10241049
// Depend on dotty-library so that sbt projects using dotty automatically
10251050
// depend on the dotty-library
10261051
lazy val `scala-library` = project.
@@ -1329,6 +1354,14 @@ object Build {
13291354
settings(commonBenchmarkSettings).
13301355
enablePlugins(JmhPlugin)
13311356

1357+
def asDottyTastydoc(implicit mode: Mode): Project = project.withCommonSettings.
1358+
aggregate(`dotty-tastydoc-input`).
1359+
dependsOn(dottyCompiler).
1360+
settings(tastydocSettings)
1361+
1362+
def asDottyTastydocInput(implicit mode: Mode): Project = project.withCommonSettings.
1363+
dependsOn(dottyCompiler)
1364+
13321365
def asDist(implicit mode: Mode): Project = project.
13331366
enablePlugins(PackPlugin).
13341367
withCommonSettings.

semanticdb/project/build.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=1.2.6

0 commit comments

Comments
 (0)