Skip to content

Commit

Permalink
links in synopsis and deprecation documentation are now also processed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Oct 28, 2024
1 parent 44915c5 commit 00ff6ce
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/lang/rascal/tutor/apidoc/GenerateMarkdown.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ list[Output] declInfo2Doc(str parent, d:moduleInfo(), list[str] overloads, PathC
Output::empty(),
out("\<div class=\"theme-doc-version-badge badge badge--secondary\"\>rascal-<getRascalVersion()>\</div\><if (pcfg.isPackageCourse) {> \<div class=\"theme-doc-version-badge badge badge--secondary\"\><pcfg.packageName>-<pcfg.packageVersion>\</div\><}>"),
Output::empty(),
*[out(defLine) | str defLine <- split("\n", trim(d.synopsis))],
*compileMarkdown(split("\n", trim(d.synopsis)), 1, 0, pcfg, exec, ind, dtls), // TODO line and offset
out("#### Usage"),
Output::empty(),
out("```rascal"),
Expand All @@ -121,8 +121,7 @@ list[Output] declInfo2Doc(str parent, d:moduleInfo(), list[str] overloads, PathC
list[Output] declInfo2Doc(str parent, d:functionInfo(), list[str] overloads, PathConfig pcfg, CommandExecutor exec, Index ind, list[str] dtls, bool demo) =
[
out("## function <d.name> {<moduleFragment(d.moduleName)>-<d.name>}"),
empty(),
*[out(defLine) | str defLine <- split("\n", trim(d.synopsis))],
*compileMarkdown(split("\n", trim(d.synopsis)), 1, 0, pcfg, exec, ind, dtls), // TODO line and offset
empty(),
out("```rascal"),
*([ *[out(defLine) | str defLine <- split("\n", ov)], empty() | ov <- overloads][..-1]),
Expand All @@ -134,7 +133,7 @@ list[Output] declInfo2Doc(str parent, d:functionInfo(), list[str] overloads, Pat
list[Output] declInfo2Doc(str parent, d:testInfo(), list[str] overloads, PathConfig pcfg, CommandExecutor exec, Index ind, list[str] dtls, bool demo) =
[
out("## test <d.name> {<moduleFragment(d.moduleName)>-<d.name>}"),
*[out(defLine) | str defLine <- split("\n", trim(d.synopsis))],
*compileMarkdown(split("\n", trim(d.synopsis)), 1, 0, pcfg, exec, ind, dtls), // TODO line and offset
Output::empty(),
out("```rascal"),
*[out(defLine) | str defLine <- split("\n", d.fullTest)],
Expand All @@ -149,7 +148,7 @@ list[Output] declInfo2Doc(str parent, d:testInfo(), list[str] overloads, PathCon
list[Output] declInfo2Doc(str parent, d:dataInfo(), list[str] overloads, PathConfig pcfg, CommandExecutor exec, Index ind, list[str] dtls, bool demo) =
[
out("## data <d.name> {<moduleFragment(d.moduleName)>-<d.name>}"),
*[out(defLine) | str defLine <- split("\n", trim(d.synopsis))],
*compileMarkdown(split("\n", trim(d.synopsis)), 1, 0, pcfg, exec, ind, dtls), // TODO line and offset
empty(),
*[
out("```rascal"),
Expand All @@ -164,7 +163,7 @@ list[Output] declInfo2Doc(str parent, d:testInfo(), list[str] overloads, PathCon
list[Output] declInfo2Doc(str parent, d:syntaxInfo(), list[str] overloads, PathConfig pcfg, CommandExecutor exec, Index ind, list[str] dtls, bool demo) =
[
out("## syntax <d.name> {<moduleFragment(d.moduleName)>-<d.name>}"),
*[out(defLine) | str defLine <- split("\n", trim(d.synopsis))],
*compileMarkdown(split("\n", trim(d.synopsis)), 1, 0, pcfg, exec, ind, dtls), // TODO line and offset
empty(),
*[
out("```rascal"),
Expand All @@ -179,7 +178,7 @@ list[Output] declInfo2Doc(str parent, d:syntaxInfo(), list[str] overloads, PathC
list[Output] declInfo2Doc(str parent, d:aliasInfo(), list[str] overloads, PathConfig pcfg, CommandExecutor exec, Index ind, list[str] dtls, bool demo) =
[
out("## alias <d.name> {<moduleFragment(d.moduleName)>-<d.name>}"),
*[out(defLine) | str defLine <- split("\n", trim(d.synopsis))],
*compileMarkdown(split("\n", trim(d.synopsis)), 1, 0, pcfg, exec, ind, dtls), // TODO line and offset
empty(),
out("```rascal"),
*[out(removeNewlines(ov)), empty() | ov <- overloads][..-1],
Expand Down

0 comments on commit 00ff6ce

Please sign in to comment.