This repository has been archived by the owner on Nov 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nuxt-styleguide-renderer-default): add markup highlighting
by using prism.js for code blocks. fixes #15
- Loading branch information
Markus Siering
committed
Nov 8, 2018
1 parent
c815531
commit ba8daef
Showing
6 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
packages/nuxt-styleguide-renderer-default/component/CodeBlock.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<Prism :language="language"> | ||
<slot /> | ||
</Prism> | ||
</template> | ||
|
||
<style> | ||
@import 'prismjs/themes/prism.css'; | ||
</style> | ||
|
||
<script> | ||
import 'prismjs' | ||
import Prism from 'vue-prism-component' | ||
export default { | ||
name: 'CodeBlock', | ||
components: { | ||
Prism, | ||
}, | ||
props: { | ||
language: { | ||
type: String, | ||
default: 'html', | ||
}, | ||
}, | ||
} | ||
</script> |
9 changes: 5 additions & 4 deletions
9
packages/nuxt-styleguide-renderer-default/component/CodeView.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters