mirror of
https://github.com/usememos/memos.git
synced 2026-12-01 16:29:18 +01:00
chore: remove unused syntax
- Removed the wikilink extension from markdown services in test and API service. - Deleted the DefaultLink and WikiLink components, simplifying link handling. - Updated ConditionalComponent to remove wikilink checks. - Adjusted MemoContent to exclude wikilink handling in markdown rendering. - Refined markdown styles for compact rendering, enhancing readability. - Added a Markdown Styling Guide to document the new compact styling approach.
This commit is contained in:
+172
-87
@@ -22,7 +22,7 @@
|
||||
.markdown-content ul.contains-task-list,
|
||||
.prose ul.contains-task-list {
|
||||
padding: 0 !important;
|
||||
margin: 0.5rem 0 !important;
|
||||
margin: 0.25rem 0 !important;
|
||||
list-style: none !important;
|
||||
margin-block-start: 0 !important;
|
||||
margin-block-end: 0 !important;
|
||||
@@ -48,8 +48,8 @@
|
||||
.prose ul.contains-task-list li.task-list-item {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
gap: 0.5rem !important;
|
||||
margin: 0.125rem 0 !important;
|
||||
gap: 0.375rem !important;
|
||||
margin: 0.0625rem 0 !important;
|
||||
padding: 0 !important;
|
||||
line-height: 1.5rem !important;
|
||||
list-style: none !important;
|
||||
@@ -105,81 +105,111 @@
|
||||
|
||||
/* ========================================
|
||||
* Markdown Content Styles
|
||||
* Custom minimal styles for markdown rendering
|
||||
* Compact spacing optimized for memos/notes
|
||||
*
|
||||
* Key principles:
|
||||
* 1. Block elements use 8px (0.5rem) bottom margin (compact)
|
||||
* 2. First child has no top margin, last child has no bottom margin
|
||||
* 3. Nested elements have minimal spacing
|
||||
* 4. Inline elements have no vertical spacing
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content {
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
color: var(--foreground);
|
||||
white-space: pre-line; /* Preserve newlines but collapse multiple spaces */
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
/* Block elements should not inherit pre-line */
|
||||
/* ========================================
|
||||
* First/Last Child Normalization
|
||||
* Remove boundary spacing to prevent double margins
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content > :first-child {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
.markdown-content > :last-child {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
* Block Elements
|
||||
* Compact 8px bottom margin
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content p,
|
||||
.markdown-content blockquote,
|
||||
.markdown-content ul,
|
||||
.markdown-content ol,
|
||||
.markdown-content dl,
|
||||
.markdown-content table,
|
||||
.markdown-content pre,
|
||||
.markdown-content hr {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
* Headings
|
||||
* Compact spacing for visual separation
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content h1,
|
||||
.markdown-content h2,
|
||||
.markdown-content h3,
|
||||
.markdown-content h4,
|
||||
.markdown-content h5,
|
||||
.markdown-content h6,
|
||||
.markdown-content p,
|
||||
.markdown-content ul,
|
||||
.markdown-content ol,
|
||||
.markdown-content pre,
|
||||
.markdown-content blockquote,
|
||||
.markdown-content table {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
/* Code blocks need pre-wrap */
|
||||
.markdown-content pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/* Headings */
|
||||
.markdown-content h1 {
|
||||
font-size: 1.875rem;
|
||||
font-weight: 700;
|
||||
line-height: 2.25rem;
|
||||
margin-top: 1rem;
|
||||
.markdown-content h6 {
|
||||
margin-top: 0.75rem;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.markdown-content h1 {
|
||||
font-size: 2em;
|
||||
font-weight: 700;
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.markdown-content h2 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
line-height: 2rem;
|
||||
margin-top: 0.75rem;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 1.5em;
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.markdown-content h3 {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.75rem;
|
||||
margin-top: 0.75rem;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
.markdown-content h4 {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.markdown-content h5 {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
.markdown-content h4,
|
||||
.markdown-content h5,
|
||||
.markdown-content h6 {
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.75rem;
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 0.85em;
|
||||
color: var(--muted-foreground);
|
||||
}
|
||||
|
||||
/* First heading has no top margin */
|
||||
.markdown-content > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
/* ========================================
|
||||
* Paragraphs
|
||||
* ======================================== */
|
||||
|
||||
/* Paragraphs */
|
||||
.markdown-content p {
|
||||
margin: 0.5rem 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* Links */
|
||||
/* ========================================
|
||||
* Links
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content a {
|
||||
color: var(--primary);
|
||||
text-decoration: underline;
|
||||
@@ -190,10 +220,12 @@
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
/* Lists - MINIMAL spacing */
|
||||
/* ========================================
|
||||
* Lists
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content ul,
|
||||
.markdown-content ol {
|
||||
margin: 0.5rem 0;
|
||||
padding-left: 1.5em;
|
||||
list-style-position: outside;
|
||||
}
|
||||
@@ -207,25 +239,34 @@
|
||||
}
|
||||
|
||||
.markdown-content li {
|
||||
margin: 0.125rem 0;
|
||||
margin-top: 0.125rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.markdown-content li > p {
|
||||
margin-bottom: 0.125rem;
|
||||
}
|
||||
|
||||
/* Nested lists should have minimal spacing */
|
||||
.markdown-content li > ul,
|
||||
.markdown-content li > ol {
|
||||
margin-top: 0.125rem;
|
||||
margin-bottom: 0.125rem;
|
||||
}
|
||||
|
||||
/* First and last items in lists */
|
||||
.markdown-content li:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown-content li:last-child {
|
||||
margin-bottom: 0;
|
||||
.markdown-content li + li {
|
||||
margin-top: 0.125rem;
|
||||
}
|
||||
|
||||
/* Nested lists */
|
||||
.markdown-content li > ul,
|
||||
.markdown-content li > ol {
|
||||
margin: 0.25rem 0;
|
||||
}
|
||||
/* ========================================
|
||||
* Code (inline and blocks)
|
||||
* ======================================== */
|
||||
|
||||
/* Code */
|
||||
.markdown-content code {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.875em;
|
||||
@@ -238,76 +279,120 @@
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.875rem;
|
||||
background: var(--muted);
|
||||
padding: 0.75rem 1rem;
|
||||
border-radius: 0.5rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-radius: 0.375rem;
|
||||
overflow-x: auto;
|
||||
margin: 0.75rem 0;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.markdown-content pre code {
|
||||
background: none;
|
||||
padding: 0;
|
||||
font-size: inherit;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* Blockquotes */
|
||||
/* ========================================
|
||||
* Blockquotes
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content blockquote {
|
||||
border-left: 3px solid var(--border);
|
||||
padding-left: 1rem;
|
||||
margin: 0.75rem 0;
|
||||
padding: 0 0.75rem;
|
||||
color: var(--muted-foreground);
|
||||
font-style: italic;
|
||||
border-left: 0.25rem solid var(--border);
|
||||
}
|
||||
|
||||
/* Horizontal rule */
|
||||
.markdown-content blockquote > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown-content blockquote > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
* Horizontal Rules
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content hr {
|
||||
border: none;
|
||||
border-top: 1px solid var(--border);
|
||||
margin: 1rem 0;
|
||||
height: 0.25em;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
/* ========================================
|
||||
* Tables
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content table {
|
||||
display: block;
|
||||
width: 100%;
|
||||
width: max-content;
|
||||
max-width: 100%;
|
||||
overflow: auto;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
margin: 0.75rem 0;
|
||||
}
|
||||
|
||||
.markdown-content th,
|
||||
.markdown-content td {
|
||||
.markdown-content table th,
|
||||
.markdown-content table td {
|
||||
padding: 0.25rem 0.5rem;
|
||||
border: 1px solid var(--border);
|
||||
padding: 0.5rem;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.markdown-content th {
|
||||
background: var(--muted);
|
||||
.markdown-content table th {
|
||||
font-weight: 600;
|
||||
background: var(--muted);
|
||||
}
|
||||
|
||||
/* Images */
|
||||
.markdown-content table tr {
|
||||
background: transparent;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.markdown-content table tr:nth-child(2n) {
|
||||
background: var(--muted);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
* Images
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
border-radius: 0.5rem;
|
||||
margin: 0.75rem 0;
|
||||
}
|
||||
|
||||
/* Strong/Bold */
|
||||
/* ========================================
|
||||
* Inline Elements
|
||||
* No vertical spacing
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Emphasis/Italic */
|
||||
.markdown-content em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* Inline elements shouldn't add vertical spacing */
|
||||
.markdown-content code,
|
||||
.markdown-content strong,
|
||||
.markdown-content em,
|
||||
.markdown-content a {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
* Strikethrough (GFM)
|
||||
* ======================================== */
|
||||
|
||||
.markdown-content del {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user