Skip to content
Snippets Groups Projects
Commit abce0e34 authored by William Billingsley's avatar William Billingsley
Browse files

Update to doctacular 0.3-M3

parent 475d88f0
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,6 @@
"build": {
"dockerfile": "Dockerfile"
},
"updateContentCommand": "sbt fastOptJS fullOptJS",
"postCreateCommand": "nohup http-server -p 8080 &",
"extensions": [
"scalameta.metals",
......
......@@ -7,14 +7,10 @@ scalaVersion := "3.1.0"
// Don't automatically call main
scalaJSUseMainModuleInitializer := false
resolvers += "jitpack" at "https://jitpack.io"
updateOptions := updateOptions.value.withLatestSnapshots(false)
//updateOptions := updateOptions.value.withLatestSnapshots(false)
libraryDependencies ++= Seq(
// "org.scala-js" %%% "scalajs-dom" % "1.1.0",
"com.github.wbillingsley.veautiful" %%% "veautiful" % "v0.3-SNAPSHOT",
"com.github.wbillingsley.veautiful" %%% "doctacular" % "v0.3-SNAPSHOT",
"com.wbillingsley" %%% "doctacular" % "0.3-M3",
)
......
sbt.version = 1.6.2
\ No newline at end of file
sbt.version = 1.8.0
\ No newline at end of file
......@@ -5,7 +5,7 @@
package acssite
import com.wbillingsley.veautiful.html.{<, DElement, Markup, VHtmlNode, ^}
import com.wbillingsley.veautiful.html.{<, DElement, Markup, DHtmlContent, ^}
import com.wbillingsley.veautiful.templates.{DeckBuilder, VSlides}
import scala.collection.mutable
......@@ -18,7 +18,7 @@ object Common {
given markdownGenerator:Markup = new Markup({ (s:String) => js.Dynamic.global.marked.parse(s).asInstanceOf[String] })
def markdown(s:String):VHtmlNode = markdownGenerator.Fixed(s)
def markdown(s:String) = markdownGenerator.Fixed(s)
/** Circuits Up! Logo */
......@@ -26,7 +26,7 @@ object Common {
<.span()
}
def downloadFromGitHub(project:String, user:String="UNEcosc250"):VHtmlNode = {
def downloadFromGitHub(project:String, user:String="UNEcosc250"):DHtmlContent = {
<.a(
^.cls := "btn btn-secondary",
^.href := s"https://github.com/$user/$project/archive/master.zip",
......
package acssite
import com.wbillingsley.veautiful.html.{<, VHtmlNode, ^}
import com.wbillingsley.veautiful.html.{<, DHtmlContent, ^}
import com.wbillingsley.veautiful.templates.DeckBuilder
/**
......@@ -35,7 +35,7 @@ extension (db:DeckBuilder) {
}
/** A title slide for the front of the deck */
def titleSlide(title:String, subtitle:String, authorCard:VHtmlNode, logos:VHtmlNode):DeckBuilder = {
def titleSlide(title:String, subtitle:String, authorCard:DHtmlContent, logos:DHtmlContent):DeckBuilder = {
db.veautifulSlide(
<.div(
<.h1(^.attr("style") := "margin-bottom: 0; font-size: 60px", title),
......@@ -63,7 +63,7 @@ extension (db:DeckBuilder) {
def bootStrapMediaBox(imageUrl:String, content:VHtmlNode) = {
def bootStrapMediaBox(imageUrl:String, content:DHtmlContent) = {
<.div(^.cls := "media",
<.img(^.src := imageUrl, ^.cls := "mr-3", ^.attr("style") := "height: 150px"),
<.div(^.cls := "media-body", ^.attr("style") := "text-align: left;", content)
......
......@@ -2,6 +2,7 @@ package courses
import com.wbillingsley.veautiful.Unique
import com.wbillingsley.veautiful.html.{<, DElement, SVG, Styling, VHtmlComponent, ^, EventMethods}
import com.wbillingsley.veautiful.svg.DSvgContent
import org.scalajs.dom
......@@ -14,7 +15,7 @@ case class HPlanChooser(course:Course) extends VHtmlComponent {
<("select")(
^.on("change") ==> { (evt) =>
selected = evt.inputValue
rerender(),
rerender()
},
^.attr("name") := "Plan",
for
......@@ -189,7 +190,7 @@ case class HPlanPrereqWidget(course:Course, plan:Plan) extends VHtmlComponent {
def columnTransform(i:Int, gutter:Boolean = false):String = s"translate(${columnX(i, gutter)}, 0)"
def svg(el:PrereqElement):(Int, <.SingleChild[dom.svg.G]) = el match {
def svg(el:PrereqElement):(Int, DSvgContent) = el match {
// A single unit is
case s:String =>
1 -> singleUnitBox(s)
......
package courses
import com.wbillingsley.veautiful.Unique
import com.wbillingsley.veautiful.html.{<, DElement, SVG, Styling, VHtmlComponent, ^}
import com.wbillingsley.veautiful.html.{<, DElement, SVG, Styling, ^}
import com.wbillingsley.veautiful.svg.{DSvgContent, DSvgComponent}
import org.scalajs.dom
/**
* Lays out the structure of a course vertically, so that groups of subjects can be seen
* more easily
*/
case class PlanPrereqWidget(plan:Plan) extends VHtmlComponent {
case class PlanPrereqWidget(plan:Plan) extends DSvgComponent {
import acssite.given
......@@ -110,7 +111,7 @@ case class PlanPrereqWidget(plan:Plan) extends VHtmlComponent {
}
def svg(offset:Int, el:PrereqElement):(Int, <.SingleChild[dom.svg.G]) = el match {
def svg(offset:Int, el:PrereqElement):(Int, DSvgContent) = el match {
case s:String =>
1 -> singleUnitBox(offset, s)
/*SVG.g(
......@@ -141,7 +142,7 @@ case class PlanPrereqWidget(plan:Plan) extends VHtmlComponent {
}
val planStrings = flatStrings(plan)
println(planStrings)
// println(planStrings)
def prereqLines(plan: Plan, active:Option[String]) =
def arrow(startRow:Int, endRow:Int, number:Int) =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment