Skip to content

Commit 03a5e38

Browse files
authored
Markdown Live View
2 parents e382496 + d2f1f41 commit 03a5e38

17 files changed

+1143
-109
lines changed

api-link-parser.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ function decodeLink(url) {
8282
linkData.contents = linkData.contents.slice(0, (-lastEntry.length - 1));
8383

8484
// if linked file can be viewed live
85-
if (lastEntry.endsWith('.html') || lastEntry.endsWith('.svg')) {
85+
if (lastEntry.endsWith('.html') || lastEntry.endsWith('.svg') ||
86+
lastEntry.endsWith('.md')) {
8687

8788
// show file in live view
8889
linkData.openLive = true;

dark-theme.css

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ cd-el {
141141

142142
-webkit-font-smoothing: antialiased;
143143
border-radius: 0;
144+
display: block;
144145
}
145146

146147
.token.prolog,

filebrowser.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -2558,7 +2558,9 @@ function toggleSidebar(open) {
25582558

25592559
if (isMobile) {
25602560

2561-
document.querySelector('meta[name="theme-color"]').content = '#313744';
2561+
if (!liveView.classList.contains('visible')) {
2562+
document.querySelector('meta[name="theme-color"]').content = '#313744';
2563+
}
25622564

25632565
} else {
25642566

full.css

+7-2
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,8 @@ body.expanded .sidebar-toggle svg .left {
644644
transition-delay: .22s;
645645
}
646646

647-
.live-view.file-open ~ .live-toggle:hover {
647+
.live-view.file-open ~ .live-toggle:hover,
648+
.live-view.visible ~ .live-toggle.popout-hidden:hover {
648649
width: 97px;
649650
transition-delay: .22s;
650651
}
@@ -698,6 +699,10 @@ body.expanded .sidebar-toggle svg .left {
698699
display: none;
699700
}
700701

702+
.live-toggle.popout-hidden .popout {
703+
display: none;
704+
}
705+
701706
.sidebar {
702707
position: fixed;
703708
top: 0;
@@ -1824,7 +1829,7 @@ body:not(.mobile) .dialog .button:not(:active):hover {
18241829
/* left: calc(((100vw - var( --sidebar-width)) / 2) + var(--sidebar-width)); */
18251830
/* left: calc(var(--sidebar-width) / 2); */
18261831
max-width: 356px;
1827-
white-space: pre;
1832+
white-space: pre-wrap;
18281833
overflow-wrap: anywhere;
18291834
transition: 0s .18s, .18s var( --bounce-function) opacity;
18301835
}

full.html

-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@
286286
<script src="bottomfloat.js"></script>
287287

288288
<script src="live-view/extensions/beautifier.min.js" async></script>
289-
<script src="live-view/extensions/module-importer.js"></script>
290289

291290

292291
<script>

0 commit comments

Comments
 (0)