From 75b94deeb70f10d2904c6e89f97ddf746f4d3729 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 16 Apr 2019 21:10:26 -0600 Subject: [PATCH 1/3] updates --- CHANGELOG.md | 2 +- README.md | 88 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 62 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fe492b..578443d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.0.0 -## mm/dd/2019 +## 04/16/2019 1. [](#new) * Initial Version diff --git a/README.md b/README.md index cf561c6..9c70251 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You should now have all the plugin files under # Languages included -Prism.js supports currently [176 languages](http://prismjs.com/#languages-list), at the time of this edit, but the ones included in this specific version is: +Prism.js supports currently [176 languages](http://prismjs.com/#languages-list), at the time of this edit, but the ones included in this specific version are: * markup * html @@ -75,31 +75,31 @@ This build of Prism also includes the following plugins: In your markdown, you can create a block of code, and assign the language to it. You can choose between the list above. Example: -``` ```php - ['onPageInitialized', 0], - 'onShortcodeHandlers' => ['onShortcodeHandlers', 0], - 'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0], - ]; - } -} -``` + ```php + ['onPageInitialized', 0], + 'onShortcodeHandlers' => ['onShortcodeHandlers', 0], + 'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0], + ]; + } + } + ``` ``` # Advanced Usage @@ -113,6 +113,8 @@ To get access to advanced options that can be set individually, you can use the [/prism] ``` +for line numbers, or: + ``` [prism classes="language-bash command-line" cl-prompt="\[foo@localhost\] $"] cd ~/webroot @@ -120,7 +122,26 @@ git clone -b master https://github.com/getgrav/grav.git [/prism] ``` -... more to come ... +for a command prompt, or: + +``` +[prism classes="language-yaml" highlight="2,4"] +enabled: true +theme: prism-base16-ocean.dark.css +all-pre-blocks: true +plugins: + line-numbers: false + command-line: false + command-line-prompt: '$' +[/prism] +``` + +to highlight lines 2 and 4. + +Find out more about these options by checking out the [Prism.js plugins page](https://prismjs.com/#plugins). + + + # Configuration @@ -136,7 +157,20 @@ plugins: command-line-prompt: '$' ``` -You can also override the default theme for a page with the option `theme`: +You can also override configuration settings at the page level by prefixing options with `prism-highlight:`. For example you could set a different theme, and turning on line numbers on a particular page with: + +```yaml +title: My Page +prism-highlight: + theme: base16-duotone-dark.light.css + plugins: + line-numbers: true +``` + + +### Themes + +The themes available are: ``` base16-duotone-dark.dark.css From 3e061fe7a1b24b9a6a3973abcb9117fd02b9b95e Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 16 Apr 2019 21:16:13 -0600 Subject: [PATCH 2/3] bluerprints updated --- blueprints.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/blueprints.yaml b/blueprints.yaml index e196431..f85af7f 100755 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -32,4 +32,48 @@ form: size: large data-options@: '\Grav\Plugin\PrismHighlightPlugin::themeOptions' + all-pre-blocks: + type: toggle + label: All Pre Blocks + highlight: 1 + default: 1 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool + + section_plugins: + type: section + title: Plugins Options + underline: true + + plugins.line-numbers: + type: toggle + label: Line Numbers + highlight: 0 + default: 0 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool + + plugins.command-line: + type: toggle + label: Command Line + highlight: 0 + default: 0 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool + + plugins.command-line-prompt: + type: text + size: small + label: Command Line Prompt + + From affebc7ffc374e1c78c091ea9d72d0fd367529d8 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 16 Apr 2019 21:17:46 -0600 Subject: [PATCH 3/3] prepare for release --- LICENSE | 2 +- blueprints.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LICENSE b/LICENSE index 10909b6..03160a1 100755 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Grav, PrismJS +Copyright (c) 2019 Trilby Media, PrismJS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/blueprints.yaml b/blueprints.yaml index f85af7f..b2d64d5 100755 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,14 +1,14 @@ name: Prism Highlighter version: 1.0.0 -description: "This plugin provides code highlighting functionality via the [Prism.js](http://prismjs.com/) syntax highlighter." +description: "This plugin provides code highlighting functionality via the [Prism.js](http://prismjs.com/) syntax highlighter with lots of themes and plugins." icon: code author: - name: Team Grav - email: devs@getgrav.org - url: http://getgrav.org -homepage: https://github.com/getgrav/grav-prism-highlight -keywords: highlight, plugin, code, prism -bugs: https://github.com/getgrav/grav-prism-highlight/issues + name: Trilby Media + email: hello@trilby.media + url: https://trilby.media +homepage: https://github.com/trilbymedia/grav-prism-highlight +keywords: highlight, plugin, code, prism.js +bugs: https://github.com/trilbymedia/grav-prism-highlight/issues license: MIT form: