jekyll-chatgpt 0.1.0 → 0.1.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 +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 +13 -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: df806f086dc3c108ccea2a6da2cb345e9ab78727a4af4a322f71f0008f16a18d
|
4
|
+
data.tar.gz: 4f47aef25ea39650dbd7c79b0e0720b4e50cee94cd02630913d5e1d7098ebebb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 542d8f8bb29c08f4423345377ef29b21f617a2b04524c3c19e4d6f1b36356710318b1e915be942c51099ab0c75713818e17a2f345714110f418ca774af3aabe0
|
7
|
+
data.tar.gz: 6297013655425806d279593bbd82321c14c7f712bfc11d8943a16fba4f0a8e6931ebc3ede795ce4e6c4ebb3cba718d527a93024728cb0fa540e57b0d1528cf62
|
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,23 @@
|
|
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`
|
30
21
|
{% endfor %}
|
31
22
|
</div>
|
32
23
|
</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.1
|
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: []
|