diff --git a/package.json b/package.json index 34fdc1a9a..2de832e09 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "v-clipboard": "^3.0.0-next.1", "vue": "^2.6.12", "vue-chartjs": "^5.2.0", + "vue-highlightjs": "^1.3.3", "vue-i18n": "^8.28.2", "vue-multiselect": "^2.1.6", "vue-read-more-smooth": "^0.1.8", diff --git a/src/StacBrowser.vue b/src/StacBrowser.vue index f516c71e6..2deafc46d 100644 --- a/src/StacBrowser.vue +++ b/src/StacBrowser.vue @@ -35,6 +35,10 @@ import { import "bootstrap/dist/css/bootstrap.css"; import "bootstrap-vue/dist/bootstrap-vue.css"; +import VueHighlightJS from "vue-highlightjs"; +import 'highlight.js/lib/languages/python'; +import 'highlight.js/styles/github.css'; + import ErrorAlert from './components/ErrorAlert.vue'; import StacHeader from './components/StacHeader.vue'; @@ -49,8 +53,9 @@ import { getBest, prepareSupported } from './locale-id'; Vue.use(AlertPlugin); Vue.use(ButtonGroupPlugin); Vue.use(ButtonPlugin); -Vue.use(BadgePlugin); +Vue.use(BadgePlugin) Vue.use(CardPlugin); +Vue.use(VueHighlightJS); Vue.use(LayoutPlugin); Vue.use(SpinnerPlugin); @@ -392,4 +397,4 @@ export default { @import '~bootstrap-vue/src/index.scss'; @import "./theme/page.scss"; @import "./theme/custom.scss"; - \ No newline at end of file + diff --git a/src/components/CodeBox.vue b/src/components/CodeBox.vue new file mode 100644 index 000000000..3931ac3e8 --- /dev/null +++ b/src/components/CodeBox.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/src/components/SearchCode.vue b/src/components/SearchCode.vue new file mode 100644 index 000000000..f24a06c21 --- /dev/null +++ b/src/components/SearchCode.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/src/components/SearchFilter.vue b/src/components/SearchFilter.vue index c359eb8bc..afa655cec 100644 --- a/src/components/SearchFilter.vue +++ b/src/components/SearchFilter.vue @@ -112,13 +112,17 @@ {{ $t('submit') }} {{ $t('reset') }} + {{ $t('exampleCode') }} + + +