File tree 2 files changed +19
-4
lines changed
assets/components/Website/Docs
2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,27 @@ import { highlightCode } from "../../../helpers/highlightCode";
10
10
import { TransitionRoot } from " @headlessui/vue" ;
11
11
import { ClipboardDocumentIcon } from " @heroicons/vue/24/solid" ;
12
12
13
- const language = ref (" php" );
14
13
const formattedCode = ref (" " );
15
14
const code = ref (slots .default ()[0 ].children );
16
15
16
+ const props = defineProps ({
17
+ lang: {
18
+ type: String ,
19
+ default: " php" ,
20
+ },
21
+ noHighlight: {
22
+ type: Boolean ,
23
+ default: false ,
24
+ },
25
+ });
26
+
17
27
const highlight = () => {
18
- formattedCode .value = highlightCode (code .value , language .value );
28
+ if (props .noHighlight === true ) {
29
+ formattedCode .value = code .value ;
30
+ return ;
31
+ }
32
+
33
+ formattedCode .value = highlightCode (code .value , props .lang );
19
34
};
20
35
21
36
onMounted (() => {
@@ -66,7 +81,7 @@ const clipboardAvailable = computed(() => {
66
81
<span class =" absolute right-4 top-4 font-mono text-[10px] text-pink-600" >Copied!</span >
67
82
</TransitionRoot >
68
83
<div class =" mb-4 overflow-y-scroll rounded-md border border-gray-600 bg-gray-900 p-4" >
69
- <pre ><code class =" block text-xs " :class =" language " v-html =" formattedCode" ></code ></pre >
84
+ <pre ><code class =" block text-xs" :class =" lang " v-html =" formattedCode" ></code ></pre >
70
85
</div >
71
86
</div >
72
87
</template >
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ echo $count / $numberCount;</pre
64
64
</ul >
65
65
66
66
<p >Our problem file might look like the following.</p >
67
- <CodeBlock lang =" md" >
67
+ <CodeBlock lang =" md" no-highlight >
68
68
<pre >
69
69
Write a program that accepts one or more numbers as command-line arguments and prints the mean average of those numbers to the console (stdout).
70
70
You can’t perform that action at this time.
0 commit comments