-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display bibtex code in DOI citations
Issue: RiverBench/RiverBench#130
- Loading branch information
1 parent
e2f37f0
commit 1fcb0c7
Showing
5 changed files
with
62 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.github.riverbench.ci_worker | ||
package util.doc | ||
|
||
trait DocAnnotationContext: | ||
private val annotations = collection.mutable.ArrayBuffer.empty[String] | ||
|
||
def registerAnnotation(text: String): Int = | ||
annotations.addOne(text) | ||
annotations.size | ||
|
||
protected def wrapSection(text: StringBuilder): StringBuilder = | ||
if annotations.isEmpty then | ||
text | ||
else | ||
text | ||
.insert(0, "<div class=\"annotate\" markdown>\n\n") | ||
.append("\n</div>\n\n") | ||
for i <- annotations.indices do | ||
text.append(f"${i + 1}. ${annotations(i)}\n") | ||
text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters