bridgetown-mdjs 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fe089448e5668972743ad5e0e876895b9041c0111e04d16629bb4e29562bfc8
4
- data.tar.gz: 4cf16587c152448a5b7624f2bddbdbfa80013c891f36cf17f08b17dca1daff07
3
+ metadata.gz: 33d28f3d512888b813bc933ca3c5077e5a0d04a7a4c2a3268dc859ed9bf6802e
4
+ data.tar.gz: b03ef48dc0183a9b74f635799657bf74a16d4c7e1d19b99338d885b790084a43
5
5
  SHA512:
6
- metadata.gz: 9d0dc12d8d9462cefc8c32dedf079edce314a0f4cda7efdb9f021c8c646a215ddbcedc71a8c1b50b4d5318a18999b8b9badcf7f689d952f03ce836a5b1f5ae3b
7
- data.tar.gz: 44b432ab46d7cda81d0466214e88141cdbf4c881cc94999e2da59198529c4cd04018ab531e72e55734e34829b661282b3724cd6d05d1c56e0a8b875cd223ba52
6
+ metadata.gz: 96cf42294f391c37bfbe2d37321bbaf44129b164176b7d5954f24695318b702fe24baaa6c30d7d5cfdd14642137a58da572042421de6686a4a450764f082b069
7
+ data.tar.gz: cff481412f456a94d926d1abcc4f11bb407e51f7710fd817be310ad51cccffa31fb958b1087c69aeab3bcc500349678281a0eef43124326c70402dfd69fdc371
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # main
2
2
 
3
+ # 1.0.1 / 2021-04-25
4
+
5
+ * Mark mdjs script output as html safe.
6
+
3
7
  # 1.0.0 / 2021-04-25
4
8
 
5
9
  * Initial release of bridgetown-mdjs.
data/README.md CHANGED
@@ -2,14 +2,18 @@
2
2
 
3
3
  A [Bridgetown](https://www.bridgetownrb.com) plugin to add Kramdown-based support for [Markdown JavaScript (mdjs)](https://rocket.modern-web.dev/docs/markdown-javascript/overview/).
4
4
 
5
+ mdjs is a format which allows you to write executable JavaScript from within Markdown files. The mdjs-compatible parser will extract any fenced code block marked as `js script` and later include the extraction(s) within a `<script type="module">` tag at the bottom of the page layout. This means you can import libraries and web components and define various bits of JS inline with your Markdown content.
5
6
 
7
+ (**Note:** While the mdjs support in Rocket includes stories and HTML component previews, in this initial release for Bridgetown we're only supporting the basic JavaScript code extractions.)
8
+
9
+ _Requires Bridgetown 0.21 or higher._
6
10
 
7
11
  ## Installation
8
12
 
9
13
  Run this command to add this plugin to your site's Gemfile:
10
14
 
11
15
  ```shell
12
- $ bundle add bridgtown-mdjs -g bridgetown_plugins
16
+ $ bundle add bridgetown-mdjs -g bridgetown_plugins
13
17
  ```
14
18
 
15
19
  Then add either a Liquid tag or Ruby helper to your default layout right below the main content.
@@ -30,7 +34,7 @@ Then add either a Liquid tag or Ruby helper to your default layout right below t
30
34
 
31
35
  ## Usage
32
36
 
33
- The plugin will perform the necessary extractions via the [kramdown-parser-gfm-extractions](https://github.com/bridgetownrb/kramdown-parser-gfm-extractions) add-on to any Markdown file in your Bridgetown site.
37
+ The plugin will perform the necessary extractions (via the [kramdown-parser-gfm-extractions](https://github.com/bridgetownrb/kramdown-parser-gfm-extractions) add-on) to any Markdown file in your Bridgetown site.
34
38
 
35
39
  Here's an example Markdown file where you can see mdjs in action:
36
40
 
@@ -25,7 +25,7 @@ module BridgetownMdjs
25
25
  end
26
26
 
27
27
  if jscode.present?
28
- return <<~HTML
28
+ return <<~HTML.html_safe
29
29
  <script type="module">
30
30
  #{jscode}</script>
31
31
  HTML
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgetownMdjs
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-mdjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team