Skip to content

Commit

Permalink
Minor improvements, upgrade to geekdoc 0.42.1
Browse files Browse the repository at this point in the history
Signed-off-by: reidspencer <reid.spencer@yoppworks.com>
  • Loading branch information
reid-spencer committed Oct 19, 2023
1 parent 712924b commit a0a71fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
15 changes: 8 additions & 7 deletions hugo/src/main/scala/com/reactific/riddl/hugo/HugoPass.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import scala.collection.mutable

object HugoPass extends PassInfo {
val name: String = "hugo"
val geekDoc_version = "v0.40.1"
val geekDoc_version = "v0.41.2"
val geekDoc_file = "hugo-geekdoc.tar.gz"
val geekDoc_url = java.net.URI
.create(
Expand Down Expand Up @@ -94,12 +94,10 @@ case class HugoPass(input: PassInput, state: HugoTranslatorState) extends Pass(i
case container: Definition =>
// Everything else is a container and definitely needs its own page
// and glossary entry.
state.addToGlossary(container, stack)
val (mkd, parents) = setUpContainer(container, state, stack)
container match {
case a: Application => mkd.emitApplication(a, stack)
case out: Output => state.addToGlossary(out, stack)
case in: Input => state.addToGlossary(in, stack)
case grp: Group => state.addToGlossary(grp, stack)
case t: Type => mkd.emitType(t, stack)
case s: State =>
val maybeType = refMap.definitionOf[Type](s.typ.pathId, s)
Expand All @@ -125,13 +123,16 @@ case class HugoPass(input: PassInput, state: HugoTranslatorState) extends Pass(i
case s: Saga => mkd.emitSaga(s, parents)
case e: Epic => mkd.emitEpic(e, stack)
case uc: UseCase => mkd.emitUseCase(uc, stack)

// All of the bleow are handled above in the outer match statement, and within their
// respective containers
case _: Author | _: Enumerator | _: Field | _: Method | _: Term | _: Constant | _: Invariant | _: Replica |
_: Inlet | _: Outlet | _: Connector | _: SagaStep | _: User | _: Interaction | _: RootContainer |
_: Include[Definition] @unchecked =>
// All these are handled above in the outer match statement, and within their
// respective containers
case out: Output =>
case in: Input =>
case grp: Group =>
}
state.addToGlossary(container, stack)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,12 +968,12 @@ case class MarkdownWriter(filePath: Path, state: HugoTranslatorState) extends Te
else { "" }
}

private def emitTermRow(term: GlossaryEntry): Unit = {
val slink = makeIconLink("gdoc_github", "GitHub Link", term.sourceLink)
val trm = s"[${mono(term.term)}](${term.link})$slink"
val typ =
s"[${term.typ}](https://riddl.tech/concepts/${term.typ.toLowerCase}/)"
emitTableRow(trm, typ, term.brief)
private def emitTermRow(entry: GlossaryEntry): Unit = {
val source_link = makeIconLink("gdoc_github", "GitHub Link", entry.sourceLink)
val term = s"[${mono(entry.term)}](${entry.link})$source_link"
val concept_link =
s"[${entry.typ}](https://riddl.tech/concepts/${entry.typ.toLowerCase}/)"
emitTableRow(term, concept_link, entry.brief)
}

def emitGlossary(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ object AST { // extends ast.AbstractDefinitions with ast.Definitions with ast.Op
with FunctionDefinition
with ProjectorDefinition {
override def format: String = s"${id.format}(${args.map(_.format).mkString(", ")}): ${typeEx.format}"
final val kind: String = "Field"
final val kind: String = "Method"
}

/** A type expression that contains an aggregation of fields
Expand Down

0 comments on commit a0a71fb

Please sign in to comment.