diff --git a/TODO.md b/TODO.md deleted file mode 100644 index ee7c0cef4..000000000 --- a/TODO.md +++ /dev/null @@ -1,21 +0,0 @@ -# Task List For RIDDL - -## RIDDL Language Improvements -* Incorporate definitions of fast data flow: pipes, streamlets (input, output, flow) and their - piping connections (consumers & producers). -* Support entity messaging within handlers to allow for aggregated root entities passing "tell" - operations to aggregated entities as actors -* Allow entities and contexts to define functions with Gherkin style specification -* Support arithmetic numeric computations as part of boolean/logic expressions where ever they - occur (e.g. invariants) -* ~~Allow multiple named state specifications in an entity to allow entities that are finite state - machines with FSM state transitions specified in handlers~~ - -## Implement Hugo Site Translator -* Translate RIDDL AST to Hugo site source as .md files -* Generate diagrams to include in the Hugo site to include: context maps, sequence diagrams, - entity diagrams & ERDs, data flow diagrams for pipes & messages -* Create a riddl-hugo-theme that provides all the shortcodes and YW styling for generated docs. -* Allow and validate riddl-hugo-theme shortcodes in the documentation of definitions. - - diff --git a/config.toml b/config.toml deleted file mode 100644 index e6b6ee9d2..000000000 --- a/config.toml +++ /dev/null @@ -1,132 +0,0 @@ -######################## Hugo Configuration #################### - -# Configure GeekDocs -baseUrl = "https://example.com/" -languageCode = "en-us" -title = "Unspecified Site Title" -name = "Unspecified Project Name" -description = "Unspecified Project Description" -tags = ["docs", "documentation", "responsive", "simple", "riddl"] -min_version = "0.83.0" -theme = [ "hugo-geekdoc" ] - -# Author information from config -[author] - name = "Not Provided" - email = "somebody@somewere.tld" - homepage = "https://example.org/" - -# Required to get well formatted code blocks -pygmentsUseClasses = true -pygmentsCodeFences = true -disablePathToLower = true -enableGitInfo = true -pygmentsStyle = "monokailight" - -# Required if you want to render robots.txt template -enableRobotsTXT = true - - -# markup(down?) rendering configuration -[markup.goldmark.renderer] - # Needed for mermaid shortcode - unsafe = true -[markup.tableOfContents] - startLevel = 1 - endLevel = 9 -[markup.goldmark.extensions] - definitionList = true - footnote = true - linkify = true - strikethrough = true - table = true - taskList = true - typographer = true - - -[taxonomies] - tag = "tags" - -[params] - # (Optional, default 6) Set how many table of contents levels to be showed on page. - # Use false to hide ToC, note that 0 will default to 6 (https://gohugo.io/functions/default/) - # You can also specify this parameter per page in front matter. - geekdocToC = false - - # (Optional, default static/brand.svg) Set the path to a logo for the Geekdoc - # relative to your 'static/' folder. - geekdocLogo = "images/logo.png" - - # (Optional, default false) Render menu from data file in 'data/menu/main.yaml'. - # See also https://geekdocs.de/usage/menus/#bundle-menu. - geekdocMenuBundle = false - - # (Optional, default false) Collapse all menu entries, can not be overwritten - # per page if enabled. Can be enabled per page via `geekdocCollapseSection`. - geekdocCollapseAllSections = false - - # (Optional, default true) Show page navigation links at the bottom of each - # docs page (bundle menu only). - geekdocNextPrev = true - - # (Optional, default true) Show a breadcrumb navigation bar at the top of each docs page. - # You can also specify this parameter per page in front matter. - geekdocBreadcrumb = true - - # (Optional, default none) Set source repository location. Used for 'Edit page' links. - # You can also specify this parameter per page in front matter. - geekdocRepo = "" - - # (Optional, default none) Enable 'Edit page' links. Requires 'GeekdocRepo' param - # and path must point to 'content' directory of repo. - # You can also specify this parameter per page in front matter. - geekdocEditPath = "edit/main/src/main/riddl" - - # (Optional, default true) Enables search function with flexsearch. - # Index is built on the fly and might slow down your website. - geekdocSearch = true - - # (Optional, default false) Display search results with the parent folder as prefix. This - # option allows you to distinguish between files with the same name in different folders. - # NOTE: This parameter only applies when 'geekdocSearch = true'. - geekdocSearchShowParent = true - - # (Optional, default none) Add a link to your Legal Notice page to the site footer. - # It can be either a remote url or a local file path relative to your content directory. - geekdocLegalNotice = "/legal" - - # (Optional, default none) Add a link to your Privacy Policy page to the site footer. - # It can be either a remote url or a local file path relative to your content directory. - geekdocPrivacyPolicy = "/privacy" - - # (Optional, default true) Add an anchor link to headlines. - geekdocAnchor = true - - # (Optional, default true) Copy anchor url to clipboard on click. - geekdocAnchorCopy = true - - # (Optional, default true) Enable or disable image lazy loading for images rendered - # by the 'img' shortcode. - geekdocImageLazyLoading = true - - # (Optional, default false) Set HTMl to .Site.BaseURL if enabled. It might be required - # if a subdirectory is used within Hugos BaseURL. - # See https://developer.mozilla.org/de/docs/Web/HTML/Element/base. - geekdocOverwriteHTMLBase = false - - # (Optional, default false) Auto-decrease brightness of images and add a slightly grayscale to avoid - # bright spots while using the dark mode. - geekdocDarkModeDim = true - - # (Optional, default true) Display a "Back to top" link in the site footer. - geekdocBackToTop = true - - # (Optional, default false) Enable or disable adding tags for post pages automatically to the - # navigation sidebar. - geekdocTagsToMenu = true - - # (Optional, default 'title') Configure how to sort file-tree menu entries. Possible options are 'title', - # 'linktitle', 'date', 'publishdate', 'expirydate' or 'lastmod'. Every option can be used with a reverse - # modifier as well e.g. 'title_reverse'. - geekdocFileTreeSortBy = "title" - diff --git a/content/Root/_index.md b/content/Root/_index.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/content/_index.md b/content/_index.md deleted file mode 100644 index 345885f47..000000000 --- a/content/_index.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "Index" -weight: 10 -draft: "false" -description: "The main index to the content" -geekdocAnchor: true -geekdocToC: 4 - ---- - -## *Landscape View* -{{< mermaid class="text-center">}} -flowchart TB -subgraph Root ["Root
No brief description.
(Arbitrary Technology)
"] - subgraph substitutions ["substitutions
No brief description.
(Arbitrary Technology)
"] - end - style substitutions font-size:1pc,fill:#2222AA,stroke:black,stroke-width:5,border:solid,color:white,margin-top:36px -end -style Root font-size:1pc,fill:#000088,stroke:black,stroke-width:6,border:solid,color:white,margin-top:36px -{{< /mermaid >}} - -## *Domains* -* [substitutions](substitutions/) - -## *Indices* -* [Glossary](glossary) -* [To Do List](todolist) -* [Statistics](statistics) - -## *Textual Full Index* -{{< toc-tree >}} diff --git a/content/glossary.md b/content/glossary.md deleted file mode 100644 index b3b0a8f06..000000000 --- a/content/glossary.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "Glossary Of Terms" -weight: 970 -draft: "false" -description: "A generated glossary of terms" -geekdocAnchor: true -geekdocToC: 4 - ---- -| Term | Type | Brief Description | -| :---: | :---: | :--- | -| [`Root`](/) | [Root](https://riddl.tech/concepts/root/) | -- undefined -- | -| [`referenced`](/substitutions/referenced) | [Context](https://riddl.tech/concepts/context/) | -- undefined -- | -| [`substitutions`](/substitutions) | [Domain](https://riddl.tech/concepts/domain/) | -- undefined -- | diff --git a/content/statistics.md b/content/statistics.md deleted file mode 100644 index ec2416baa..000000000 --- a/content/statistics.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Model Statistics" -weight: 990 -draft: "false" -description: "Statistical information about the RIDDL model documented" -geekdocAnchor: true -geekdocToC: 4 - ---- -| Category | count | % of All | % documented | number empty | avg completeness | avg complexity | avg containment | -| :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | -| Context | 1 | 33.33333333333333 | 0.0 | 1 | 0.0 | 0.0 | 0.0 | -| Root | 1 | 33.33333333333333 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | -| Domain | 1 | 33.33333333333333 | 0.4 | 0 | 18.181818181818183 | 6000.0 | 2.0 | -| All | 3 | 100.0 | 0.4 | 1 | 5.714285714285714 | 2000.0 | 0.6666666666666666 | diff --git a/content/substitutions/_index.md b/content/substitutions/_index.md deleted file mode 100644 index 1f68bc79f..000000000 --- a/content/substitutions/_index.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "substitutions: Domain" -weight: 10 -draft: "false" -description: "substitutions has no brief description." -geekdocAnchor: true -geekdocToC: 4 -geekdocCollapseSection: true -geekdocFilePath: no-such-file ---- -| Item | Value | -| :---: | :--- | -| _Briefly_ | Brief description missing. | -| _Authors_ | | -| _Definition Path_ | substitutions | -| _View Source Link_ | [string(1:1)]() | - -## *Description* - This substitutions domain contains (context substitutions.referenced)[/substitutions/referenced] - which maps to https://www.merriam-webster.com/ - -## *Contexts* -* [referenced](referenced) - -## *Types* - -## *Used By None* - -## *Uses Nothing* - -## *Textual Domain Index* -{{< toc-tree >}} diff --git a/content/substitutions/referenced/_index.md b/content/substitutions/referenced/_index.md deleted file mode 100644 index c4345c3b4..000000000 --- a/content/substitutions/referenced/_index.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: "referenced: Context" -weight: 10 -draft: "false" -description: "referenced has no brief description." -geekdocAnchor: true -geekdocToC: 4 -geekdocCollapseSection: true -geekdocFilePath: no-such-file ---- -| Item | Value | -| :---: | :--- | -| _Briefly_ | Brief description missing. | -| _Authors_ | | -| _Definition Path_ | substitutions.referenced | -| _View Source Link_ | [string(2:3)]() | - -## *Context Map* -{{< mermaid class="text-center">}} -C4Context - title C4 Containment Diagram for [Context 'referenced'] - Enterprise_Boundary(Root,Root,"Context 'referenced' is not described.") { - System_Boundary(substitutions,substitutions,"Context 'referenced' is not described.") { - Boundary(Context 'referenced', Context 'referenced', "Context 'referenced' is not described.") { - } - } - } -{{< /mermaid >}} - -## *Types* - -## *Used By None* - -## *Uses Nothing* - -## *Textual Context Index* -{{< toc-tree >}} diff --git a/content/todolist.md b/content/todolist.md deleted file mode 100644 index 6609c551d..000000000 --- a/content/todolist.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "To Do List" -weight: 980 -draft: "false" -description: "A list of definitions needing more work" -geekdocAnchor: true -geekdocToC: 4 - ---- - -## *Definitions With Missing Content* - -### _Unspecified Author_ -* [Context 'referenced' In substitutions](/substitutions/referenced) diff --git a/hugo/src/main/scala/com/reactific/riddl/hugo/HugoPass.scala b/hugo/src/main/scala/com/reactific/riddl/hugo/HugoPass.scala index b19e8da6f..ae30285eb 100644 --- a/hugo/src/main/scala/com/reactific/riddl/hugo/HugoPass.scala +++ b/hugo/src/main/scala/com/reactific/riddl/hugo/HugoPass.scala @@ -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( @@ -94,12 +94,10 @@ case class HugoPass(input: PassInput, outputs: PassesOutput, state: HugoTranslat 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) @@ -125,13 +123,16 @@ case class HugoPass(input: PassInput, outputs: PassesOutput, state: HugoTranslat 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) } } diff --git a/hugo/src/main/scala/com/reactific/riddl/hugo/MarkdownWriter.scala b/hugo/src/main/scala/com/reactific/riddl/hugo/MarkdownWriter.scala index c22955c6f..3061a2517 100644 --- a/hugo/src/main/scala/com/reactific/riddl/hugo/MarkdownWriter.scala +++ b/hugo/src/main/scala/com/reactific/riddl/hugo/MarkdownWriter.scala @@ -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", "Source Link", entry.sourceLink) + val term = s"[${mono(entry.term)}](${entry.link})$source_link" + val concept_link = + s"[${entry.kind.toLowerCase}](https://riddl.tech/concepts/${entry.kind.toLowerCase}/)" + emitTableRow(term, concept_link, entry.brief) } def emitGlossary( @@ -1041,7 +1041,7 @@ case class MarkdownWriter(filePath: Path, state: HugoTranslatorState) extends Te case class GlossaryEntry( term: String, - typ: String, + kind: String, brief: String, path: Seq[String], link: String = "", diff --git a/hugo/src/test/scala/com/reactific/riddl/hugo/MarkdownWriterTest.scala b/hugo/src/test/scala/com/reactific/riddl/hugo/MarkdownWriterTest.scala index a03cb6fb8..057526d43 100644 --- a/hugo/src/test/scala/com/reactific/riddl/hugo/MarkdownWriterTest.scala +++ b/hugo/src/test/scala/com/reactific/riddl/hugo/MarkdownWriterTest.scala @@ -125,8 +125,8 @@ class MarkdownWriterTest extends HugoTestBase { |--- || Term | Type | Brief Description | || :---: | :---: | :--- | - || [`one`](A/B/one)[{{< icon "gdoc_github" >}}](https://example.com/blob/main/src/main/riddl/one "GitHub Link") | [Term](https://riddl.tech/concepts/term/) | The first term | - || [`two`](A/B/C/two)[{{< icon "gdoc_github" >}}](https://example.com/blob/main/src/main/riddl/two "GitHub Link") | [Term](https://riddl.tech/concepts/term/) | The second term | + || [`one`](A/B/one)[{{< icon "gdoc_github" >}}](https://example.com/blob/main/src/main/riddl/one "Source Link") | [term](https://riddl.tech/concepts/term/) | The first term | + || [`two`](A/B/C/two)[{{< icon "gdoc_github" >}}](https://example.com/blob/main/src/main/riddl/two "Source Link") | [term](https://riddl.tech/concepts/term/) | The second term | |""".stripMargin output mustBe expected } diff --git a/language/src/main/scala/com/reactific/riddl/language/AST.scala b/language/src/main/scala/com/reactific/riddl/language/AST.scala index 5eb728e31..63e5961fe 100644 --- a/language/src/main/scala/com/reactific/riddl/language/AST.scala +++ b/language/src/main/scala/com/reactific/riddl/language/AST.scala @@ -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