Skip to content

Build your personal knowledge base with Trilium Notes

added underline heading style and make it a default

zadamc508217604d0
diff --git a/src/public/app/dialogs/options/appearance.js b/src/public/app/dialogs/options/appearance.js
index bfd03b0653..8743800257 100644
--- a/src/public/app/dialogs/options/appearance.js
+++ b/src/public/app/dialogs/options/appearance.js
@@ -34,6 +34,7 @@ const TPL = `
<label for="heading-style">Heading style</label>
<select class="form-control" id="heading-style">
<option value="plain">Plain</option>
+ <option value="underline">Underline</option>
<option value="markdown">Markdown-style</option>
</select>
</div>
diff --git a/src/public/app/widgets/type_widgets/editable_text.js b/src/public/app/widgets/type_widgets/editable_text.js
index 3dd231177a..17856c2401 100644
--- a/src/public/app/widgets/type_widgets/editable_text.js
+++ b/src/public/app/widgets/type_widgets/editable_text.js
@@ -48,11 +48,11 @@ const TPL = `
margin-top: 0 !important;
}
- .note-detail-editable-text h2 { font-size: 1.8em; }
- .note-detail-editable-text h3 { font-size: 1.6em; }
- .note-detail-editable-text h4 { font-size: 1.4em; }
- .note-detail-editable-text h5 { font-size: 1.2em; }
- .note-detail-editable-text h6 { font-size: 1.1em; }
+ .note-detail-editable-text h2 { font-size: 1.6em; }
+ .note-detail-editable-text h3 { font-size: 1.4em; }
+ .note-detail-editable-text h4 { font-size: 1.2em; }
+ .note-detail-editable-text h5 { font-size: 1.1em; }
+ .note-detail-editable-text h6 { font-size: 1.0em; }
body.heading-style-markdown .note-detail-editable-text h2::before { content: "##\\2004"; color: var(--muted-text-color); }
body.heading-style-markdown .note-detail-editable-text h3::before { content: "###\\2004"; color: var(--muted-text-color); }
@@ -60,6 +60,12 @@ const TPL = `
body.heading-style-markdown .note-detail-editable-text h5::before { content: "#####\\2004"; color: var(--muted-text-color); }
body.heading-style-markdown .note-detail-editable-text h6::before { content: "######\\2004"; color: var(--muted-text-color); }
+ body.heading-style-underline .note-detail-editable-text h2 { border-bottom: 1px solid var(--main-border-color); }
+ body.heading-style-underline .note-detail-editable-text h3 { border-bottom: 1px solid var(--main-border-color); }
+ body.heading-style-underline .note-detail-editable-text h4:not(.include-note-title) { border-bottom: 1px solid var(--main-border-color); }
+ body.heading-style-underline .note-detail-editable-text h5 { border-bottom: 1px solid var(--main-border-color); }
+ body.heading-style-underline .note-detail-editable-text h6 { border-bottom: 1px solid var(--main-border-color); }
+
.note-detail-editable-text-editor {
padding-top: 10px;
border: 0 !important;
diff --git a/src/public/app/widgets/type_widgets/read_only_text.js b/src/public/app/widgets/type_widgets/read_only_text.js
index 59777b7568..21d6dbba80 100644
--- a/src/public/app/widgets/type_widgets/read_only_text.js
+++ b/src/public/app/widgets/type_widgets/read_only_text.js
@@ -7,18 +7,26 @@ const TPL = `
<div class="note-detail-readonly-text note-detail-printable">
<style>
/* h1 should not be used at all since semantically that's a note title */
- .note-detail-readonly-text h1 { font-size: 2.0em; }
- .note-detail-readonly-text h2 { font-size: 1.8em; }
- .note-detail-readonly-text h3 { font-size: 1.6em; }
- .note-detail-readonly-text h4 { font-size: 1.4em; }
- .note-detail-readonly-text h5 { font-size: 1.2em; }
- .note-detail-readonly-text h6 { font-size: 1.1em; }
+ .note-detail-readonly-text h1 { font-size: 1.8em; }
+ .note-detail-readonly-text h2 { font-size: 1.6em; }
+ .note-detail-readonly-text h3 { font-size: 1.4em; }
+ .note-detail-readonly-text h4 { font-size: 1.2em; }
+ .note-detail-readonly-text h5 { font-size: 1.1em; }
+ .note-detail-readonly-text h6 { font-size: 1.0em; }
+ body.heading-style-markdown .note-detail-readonly-text h1::before { content: "#\\2004"; color: var(--muted-text-color); }
body.heading-style-markdown .note-detail-readonly-text h2::before { content: "##\\2004"; color: var(--muted-text-color); }
body.heading-style-markdown .note-detail-readonly-text h3::before { content: "###\\2004"; color: var(--muted-text-color); }
body.heading-style-markdown .note-detail-readonly-text h4:not(.include-note-title)::before { content: "####\\2004"; color: var(--muted-text-color); }
body.heading-style-markdown .note-detail-readonly-text h5::before { content: "#####\\2004"; color: var(--muted-text-color); }
body.heading-style-markdown .note-detail-readonly-text h6::before { content: "######\\2004"; color: var(--muted-text-color); }
+
+ body.heading-style-underline .note-detail-readonly-text h1 { border-bottom: 1px solid var(--main-border-color); }
+ body.heading-style-underline .note-detail-readonly-text h2 { border-bottom: 1px solid var(--main-border-color); }
+ body.heading-style-underline .note-detail-readonly-text h3 { border-bottom: 1px solid var(--main-border-color); }
+ body.heading-style-underline .note-detail-readonly-text h4:not(.include-note-title) { border-bottom: 1px solid var(--main-border-color); }
+ body.heading-style-underline .note-detail-readonly-text h5 { border-bottom: 1px solid var(--main-border-color); }
+ body.heading-style-underline .note-detail-readonly-text h6 { border-bottom: 1px solid var(--main-border-color); }
.note-detail-readonly-text {
padding-left: 24px;
diff --git a/src/services/options_init.js b/src/services/options_init.js
index e7a55cff20..d0e2cd2038 100644
--- a/src/services/options_init.js
+++ b/src/services/options_init.js
@@ -85,7 +85,7 @@ const defaultOptions = [
{ name: 'promotedAttributesExpanded', value: 'true', isSynced: true },
{ name: 'similarNotesExpanded', value: 'true', isSynced: true },
{ name: 'debugModeEnabled', value: 'false', isSynced: false },
- { name: 'headingStyle', value: 'markdown', isSynced: true },
+ { name: 'headingStyle', value: 'underline', isSynced: true },
{ name: 'autoCollapseNoteTree', value: 'true', isSynced: true },
];