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