mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Fixed Callback Doc Handler for a very long last page.
This commit is contained in:
parent
2c4c627ff5
commit
08695e1233
@ -52,7 +52,7 @@ object CallbackDocHandler {
|
||||
|
||||
if (callbacks.nonEmpty) {
|
||||
val pages = mutable.Buffer.empty[String]
|
||||
pages += callbacks.toArray.sorted.foldLeft("") {
|
||||
val lastPage = callbacks.toArray.sorted.foldLeft("") {
|
||||
(last, doc) =>
|
||||
if (last.lines.length + 2 + doc.lines.length > 12) {
|
||||
// We've potentially got some pretty long documentation here, split it up first
|
||||
@ -62,6 +62,9 @@ object CallbackDocHandler {
|
||||
else if (last.nonEmpty) last + "\n\n" + doc
|
||||
else doc
|
||||
}
|
||||
// The last page may be too long as well.
|
||||
lastPage.lines.grouped(12).map(_.mkString("\n")).foreach(pages += _)
|
||||
|
||||
Option(pages.map(page => new CallbackDocRecipe(stack, page)))
|
||||
}
|
||||
else None
|
||||
|
Loading…
x
Reference in New Issue
Block a user