jekyll-notebook 0.1.0
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 +7 -0
- data/Gemfile +2 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/lib/jekyll/converters/jekyll-notebook.rb +44 -0
- data/lib/jekyll-notebook/version.rb +5 -0
- data/lib/jekyll-notebook.rb +12 -0
- metadata +51 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 9ea1cd28e17d699b6362d4b258eb16c1bd92a42588cc3188e065defa5d5f1583
|
|
4
|
+
data.tar.gz: bc7af9e2afe496cffaef76ebd9b7a6ee42d7fe78d832e05362574980b662db0c
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 33712f196581de0aa26a967d3501e93f5fd162eac882f6b39ae14b75d4cce5980b5c797007206723d2429631543e72fb62f373f4d77a11570f4cb6b8b7bc4df7
|
|
7
|
+
data.tar.gz: e35c82e5aa645ad6b20dc72524368b5e8e941a20cf04bd0c296635d34039a4ee84dd2832b5b06ad5024962d80ca2d49ba7f2c072e75c754c0b7289ca91c5ddc7
|
data/Gemfile
ADDED
data/LICENSE
ADDED
|
File without changes
|
data/README.md
ADDED
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require 'kramdown'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
module Kramdown
|
|
5
|
+
class Converter::Notebook < Converter::Html
|
|
6
|
+
# You can override any function from this page:
|
|
7
|
+
# https://kramdown.gettalong.org/rdoc/Kramdown/Converter/Html.html
|
|
8
|
+
def initialize(root, options)
|
|
9
|
+
super
|
|
10
|
+
end
|
|
11
|
+
def convert_codeblock(el, indent)
|
|
12
|
+
lang = el.attr['class'] || 'plaintext'
|
|
13
|
+
if lang == 'language-code'
|
|
14
|
+
<<~HTML
|
|
15
|
+
<div class="cell">
|
|
16
|
+
<pre data-executable="true"><code class="language-python">#{escape_html(el.value)}</code></pre>
|
|
17
|
+
</div>
|
|
18
|
+
HTML
|
|
19
|
+
else
|
|
20
|
+
super
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
module Jekyll
|
|
27
|
+
module Converters
|
|
28
|
+
class MarkdownNotebook < Markdown
|
|
29
|
+
safe true
|
|
30
|
+
def initialize(config)
|
|
31
|
+
require 'kramdown'
|
|
32
|
+
@config = config
|
|
33
|
+
rescue LoadError
|
|
34
|
+
STDERR.puts 'You are missing a library required for Markdown. Please run:'
|
|
35
|
+
STDERR.puts ' $ [sudo] gem install kramdown'
|
|
36
|
+
raise FatalException.new("Missing dependency: kramdown")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def convert(content)
|
|
40
|
+
Kramdown::Document.new(content, @config['kramdown']).to_notebook
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require 'jekyll'
|
|
2
|
+
|
|
3
|
+
root = File.expand_path('jekyll-notebook', File.dirname(__FILE__))
|
|
4
|
+
require "#{root}/version"
|
|
5
|
+
|
|
6
|
+
require File.expand_path('jekyll/converters/jekyll-notebook', File.dirname(__FILE__))
|
|
7
|
+
|
|
8
|
+
module Jekyll
|
|
9
|
+
module JekyllNotebookConverter
|
|
10
|
+
NOTEBOOK_PAGES = Set.new
|
|
11
|
+
end
|
|
12
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: jekyll-notebook
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- afonzo
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2025-10-17 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Allows fenced code blocks with `code` language to become live, executable
|
|
14
|
+
cells powered by JupyterLite/Thebe.
|
|
15
|
+
email:
|
|
16
|
+
- lcarvalho@mailbox.org
|
|
17
|
+
executables: []
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- Gemfile
|
|
22
|
+
- LICENSE
|
|
23
|
+
- README.md
|
|
24
|
+
- lib/jekyll-notebook.rb
|
|
25
|
+
- lib/jekyll-notebook/version.rb
|
|
26
|
+
- lib/jekyll/converters/jekyll-notebook.rb
|
|
27
|
+
homepage: https://gitlab.com/afonzo/jekyll-notebook
|
|
28
|
+
licenses:
|
|
29
|
+
- GPL-3.0-only
|
|
30
|
+
metadata: {}
|
|
31
|
+
post_install_message:
|
|
32
|
+
rdoc_options: []
|
|
33
|
+
require_paths:
|
|
34
|
+
- lib
|
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: 3.0.0
|
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
|
+
requirements:
|
|
42
|
+
- - ">="
|
|
43
|
+
- !ruby/object:Gem::Version
|
|
44
|
+
version: '0'
|
|
45
|
+
requirements: []
|
|
46
|
+
rubygems_version: 3.3.5
|
|
47
|
+
signing_key:
|
|
48
|
+
specification_version: 4
|
|
49
|
+
summary: A Jekyll plugin that turns code blocks into interactive Jupyter notebook
|
|
50
|
+
cells using Thebe and JupyterLite.
|
|
51
|
+
test_files: []
|