mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 20:36:13 +01:00
basic book rendering of code and image notes
This commit is contained in:
@@ -36,6 +36,18 @@ class NoteDetailBook {
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
else if (note.type === 'code') {
|
||||
const fullNote = await server.get('notes/' + note.noteId);
|
||||
|
||||
if (fullNote.content.trim() === "") {
|
||||
return "";
|
||||
}
|
||||
|
||||
return $("<pre>").text(fullNote.content);
|
||||
}
|
||||
else if (note.type === 'image') {
|
||||
return $("<img>").attr("src", `api/images/${note.noteId}/${note.title}`);
|
||||
}
|
||||
else {
|
||||
return "<em>Content of this note cannot be displayed in the book format</em>";
|
||||
}
|
||||
|
||||
@@ -820,8 +820,9 @@ a.external:not(.no-arrow):after, a[href^="http://"]:not(.no-arrow):after, a[href
|
||||
}
|
||||
|
||||
.note-book {
|
||||
border-radius: 5px;
|
||||
border-radius: 10px;
|
||||
background-color: var(--accented-background-color);
|
||||
padding: 15px;
|
||||
margin-top: 10px;
|
||||
margin: 10px;
|
||||
margin-left: 0;
|
||||
}
|
||||
Reference in New Issue
Block a user