jekyll-chatgpt 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -4
- data/lib/chatgpt.html +1 -2
- data/lib/chatgpt_innermessage.html +10 -0
- data/lib/chatgpt_message.html +14 -22
- data/lib/jekyll-chatgpt/version.rb +1 -1
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9745e6b96766af9f9ee820f1bbddaae749abec521f6a9dee44852d888aacad99
|
4
|
+
data.tar.gz: 9fbbb02a9740f94c67a6b11843c0e969854fc39cb9031d33a8820f22a626dbf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb4e6b1b27a65d87c391712ee8041295a7a1aec2e4640d26f0fbc2880b346e18aabfddcb331090fc5f62bbe83088fa0fe9bb2eb149c14f4635f8e0c0654d6375
|
7
|
+
data.tar.gz: 53f4394e44e94aed87abb411ca706c8a50167a16071e5308cb9ce6c46fcb62d9a931bd44fbe925eb678cd1ef835c254542d5b624e9fd501c271634291e7ca909
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# JekyllChatgpt
|
2
2
|
|
3
|
-
This plugin inctroduces a `chatgpt` Liquid filter that formats ChatGPT conversations. It only uses CSS to navigate in branching conversations. A [live demo of deploying the demo branch of this repository to Github pages is available](https://pierre-couy.dev/jekyll-chatgpt)
|
3
|
+
This plugin inctroduces a `chatgpt` Liquid filter that formats ChatGPT conversations. It only uses CSS to navigate in branching conversations. A [live demo of deploying the demo branch of this repository to Github pages is available](https://pierre-couy.dev/jekyll-chatgpt) ([code](https://github.com/pcouy/jekyll-chatgpt/tree/demo))
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -12,6 +12,12 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
12
12
|
|
13
13
|
$ gem install jekyll-chatgpt
|
14
14
|
|
15
|
+
After installing, don't forget to update your `_config.yml` to include the plugin :
|
16
|
+
|
17
|
+
```yaml
|
18
|
+
plugins: [other-plugins, jekyll-picture-tag-ng]
|
19
|
+
```
|
20
|
+
|
15
21
|
Optionally, include a stylesheet for code syntax highlighting in ChatGPT output. If you already have a code highlighting theme set up for your site, it should automatically be used.
|
16
22
|
|
17
23
|
## Usage
|
@@ -25,15 +31,23 @@ Optionally, include a stylesheet for code syntax highlighting in ChatGPT output.
|
|
25
31
|
|
26
32
|
The necessary styles will automatically be inlined when using the filter. You can override the default colors by providing the following variables in your `_sass/_colors.sass` file : `$color1`, `$color1-alt`, `$color2`, `$color2-alt`, `$cyan`
|
27
33
|
|
34
|
+
### Live demo
|
35
|
+
|
36
|
+
You can browse the [code for the live demo](https://github.com/pcouy/jekyll-chatgpt/tree/demo) which is intended to be a minimal example of using the plugin.
|
37
|
+
|
28
38
|
## Development
|
29
39
|
|
30
|
-
After
|
40
|
+
After cloning the repo, you can run the following commands in a local jekyll website's folder to start hacking on the code of `jekyll-chatgpt` (you'll need to replace the path in the second command :
|
41
|
+
|
42
|
+
$ bundle remove jekyll-chatgpt # if you previously used jekyll-chatgpt from rubygems
|
43
|
+
$ bundle add --path /absolute/or/relative/path/to/your/local/jekyll-chatgpt/repo jekyll-chatgpt
|
44
|
+
$ bundle exec jekyll serve # Re-run this when you want to test changes to your local jekyll-chatgpt
|
31
45
|
|
32
|
-
To
|
46
|
+
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
33
47
|
|
34
48
|
## Contributing
|
35
49
|
|
36
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
50
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/pcouy/jekyll-chatgpt.
|
37
51
|
|
38
52
|
## License
|
39
53
|
|
data/lib/chatgpt.html
CHANGED
@@ -5,6 +5,5 @@
|
|
5
5
|
<section class="chatgpt-conversation">
|
6
6
|
<h1>{{ conversation.title }}</h1>
|
7
7
|
{% assign message=conversation.mapping | find_exp:"item", "item.parent == nil" %}
|
8
|
-
{%
|
9
|
-
{% include chatgpt_message.html %}
|
8
|
+
{% include chatgpt_message.html message=message %}
|
10
9
|
</section>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="chatgpt-messagechild">
|
2
|
+
<input type="radio"
|
3
|
+
name="chatgpt-{{ include.outer_message.id }}"
|
4
|
+
id="chatgpt-control-{{ include.inner_message.id }}"
|
5
|
+
class="chatgpt-control"
|
6
|
+
{% if forloop.first %}checked{% endif %}
|
7
|
+
>
|
8
|
+
<label for="chatgpt-control-{{ include.inner_message.id }}">{{ forloop.index }}</label>
|
9
|
+
{% include chatgpt_message.html message=include.inner_message %}
|
10
|
+
</div>
|
data/lib/chatgpt_message.html
CHANGED
@@ -1,32 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
<div class="chatgpt-messagebody chatgpt-role-{{ outer_message.message.author.role }}">
|
1
|
+
<div class="chatgpt-message" id="{{include.message.id}}">
|
2
|
+
{% if include.message.message %}
|
3
|
+
<div class="chatgpt-messagebody chatgpt-role-{{ include.message.message.author.role }}">
|
5
4
|
{% if mdfy %}
|
6
|
-
{{
|
5
|
+
{{ include.message.message.content.parts[0] | markdownify }}
|
7
6
|
{% else %}
|
8
|
-
<pre>{{
|
7
|
+
<pre>{{ include.message.message.content.parts[0] }}</pre>
|
9
8
|
{% endif %}
|
10
9
|
</div>
|
11
10
|
{% endif %}
|
12
11
|
<div class="chatgpt-messagechildren">
|
13
|
-
{% for child_id in
|
14
|
-
<!-- D {% increment depth %} -->
|
12
|
+
{% for child_id in include.message.children %}
|
15
13
|
{% assign inner_message=conversation.mapping[child_id] %}
|
16
|
-
{%
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
<label for="chatgpt-control-{{ inner_message.id }}">{{ forloop.index }}</label>
|
25
|
-
{% include chatgpt_message.html %}
|
26
|
-
</div>
|
27
|
-
{% assign messages = messages | slice: 0, depth %}
|
28
|
-
{% assign outer_message=messages.last %}
|
29
|
-
<!-- D {% decrement depth %} -->
|
14
|
+
{% include chatgpt_innermessage.html
|
15
|
+
outer_message=include.message
|
16
|
+
inner_message=inner_message
|
17
|
+
%}
|
18
|
+
{% comment %}
|
19
|
+
# Do not use `inner_message` in this partial after this point, as it
|
20
|
+
# will be overriden by the recursive include of `chatgpt_message.html`
|
21
|
+
{% endcomment %}
|
30
22
|
{% endfor %}
|
31
23
|
</div>
|
32
24
|
</div>
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-chatgpt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pcouy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
12
|
-
dependencies:
|
11
|
+
date: 2023-04-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: jekyll
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.2'
|
13
27
|
description: Use OpenAI API JSON as data files and display branching conversations
|
14
28
|
on your website
|
15
29
|
email:
|
@@ -25,16 +39,17 @@ files:
|
|
25
39
|
- Rakefile
|
26
40
|
- lib/chatgpt.html
|
27
41
|
- lib/chatgpt.sass
|
42
|
+
- lib/chatgpt_innermessage.html
|
28
43
|
- lib/chatgpt_message.html
|
29
44
|
- lib/jekyll-chatgpt.rb
|
30
45
|
- lib/jekyll-chatgpt/version.rb
|
31
46
|
- sig/jekyll_chatgpt.rbs
|
32
|
-
homepage: https://
|
47
|
+
homepage: https://pierre-couy.dev/projects/jekyll-chatgpt.html
|
33
48
|
licenses:
|
34
49
|
- MIT
|
35
50
|
metadata:
|
36
51
|
allowed_push_host: https://rubygems.org
|
37
|
-
homepage_uri: https://
|
52
|
+
homepage_uri: https://pierre-couy.dev/projects/jekyll-chatgpt.html
|
38
53
|
source_code_uri: https://github.com/pcouy/jekyll-chatgpt
|
39
54
|
post_install_message:
|
40
55
|
rdoc_options: []
|