Skip to content

Commit

Permalink
Refactor code block file path labels to Tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 17, 2024
1 parent baaf8de commit da7ad01
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 30 deletions.
2 changes: 1 addition & 1 deletion _media/app.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<small class="filepath not-prose"><span class="sr-only">Filepath: </span>{{ $path }}</small>
<small class="relative top-0 right-0 float-right opacity-50 hover:opacity-100 transition-opacity duration-250 not-prose hidden md:block"><span class="sr-only">Filepath: </span>{{ $path }}</small>
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function testProcessorExpandsFilepathDirectiveInStandardCodeblock()
HTML;

$expected = <<<'HTML'
<pre><code class="language-html"><small class="filepath not-prose"><span class="sr-only">Filepath: </span>foo.html</small></code></pre>
<pre><code class="language-html"><small class="relative top-0 right-0 float-right opacity-50 hover:opacity-100 transition-opacity duration-250 not-prose hidden md:block"><span class="sr-only">Filepath: </span>foo.html</small></code></pre>
HTML;

$this->assertSame($expected, CodeblockFilepathProcessor::postprocess($html));
Expand All @@ -215,7 +215,7 @@ public function testProcessorExpandsFilepathDirectiveInTorchlightCodeblock()
HTML;

$expected = <<<'HTML'
<pre><code class="torchlight"><!-- Syntax highlighted by torchlight.dev --><small class="filepath not-prose"><span class="sr-only">Filepath: </span>foo.html</small><div class="line"><span class="line-number">1</span>&nbsp;</div></code></pre>
<pre><code class="torchlight"><!-- Syntax highlighted by torchlight.dev --><small class="relative top-0 right-0 float-right opacity-50 hover:opacity-100 transition-opacity duration-250 not-prose hidden md:block"><span class="sr-only">Filepath: </span>foo.html</small><div class="line"><span class="line-number">1</span>&nbsp;</div></code></pre>
HTML;

$this->assertSame($expected, CodeblockFilepathProcessor::postprocess($html));
Expand All @@ -230,7 +230,7 @@ public function testProcessorEscapesHtmlByDefault()

$escaped = e('<a href="">Link</a>');
$expected = <<<HTML
<pre><code class="language-html"><small class="filepath not-prose"><span class="sr-only">Filepath: </span>$escaped</small></code></pre>
<pre><code class="language-html"><small class="relative top-0 right-0 float-right opacity-50 hover:opacity-100 transition-opacity duration-250 not-prose hidden md:block"><span class="sr-only">Filepath: </span>$escaped</small></code></pre>
HTML;

$this->assertSame($expected, CodeblockFilepathProcessor::postprocess($html));
Expand All @@ -246,7 +246,7 @@ public function testProcessorDoesNotEscapeHtmlIfConfigured()
HTML;

$expected = <<<'HTML'
<pre><code class="language-html"><small class="filepath not-prose"><span class="sr-only">Filepath: </span><a href="">Link</a></small></code></pre>
<pre><code class="language-html"><small class="relative top-0 right-0 float-right opacity-50 hover:opacity-100 transition-opacity duration-250 not-prose hidden md:block"><span class="sr-only">Filepath: </span><a href="">Link</a></small></code></pre>
HTML;

$this->assertSame($expected, CodeblockFilepathProcessor::postprocess($html));
Expand Down
2 changes: 1 addition & 1 deletion packages/hydefront/dist/hyde.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/*! HydeFront v3.4.1 | MIT License | https://hydephp.com*/
.prose blockquote.info{@apply border-blue-500}.prose blockquote.success{@apply border-green-500}.prose blockquote.warning{@apply border-amber-500}.prose blockquote.danger{@apply border-red-600}pre>code>.filepath{position:relative;top:-0.25rem;right:.25rem;float:right;opacity:.5;transition:opacity .25s}pre>code>.filepath:hover{opacity:1}@media screen and (max-width: 767px){pre>code>.filepath{display:none}}/*# sourceMappingURL=hyde.css.map */
.prose blockquote.info{@apply border-blue-500}.prose blockquote.success{@apply border-green-500}.prose blockquote.warning{@apply border-amber-500}.prose blockquote.danger{@apply border-red-600}/*# sourceMappingURL=hyde.css.map */
2 changes: 1 addition & 1 deletion packages/hydefront/dist/hyde.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/hydefront/hyde.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
*/

@use 'sass/markdown/blockquotes';
@use 'sass/markdown/codeblocks';
21 changes: 0 additions & 21 deletions packages/hydefront/sass/markdown/codeblocks.scss

This file was deleted.

0 comments on commit da7ad01

Please sign in to comment.