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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb1b5f419fe7df8334c5248d953838081ac4c8237a202b259c2f4fb2267878f1
4
- data.tar.gz: 12271c751c986329d8e8590c52cadcee09f6e565f517101ba7ce9295ba77d92f
3
+ metadata.gz: 9745e6b96766af9f9ee820f1bbddaae749abec521f6a9dee44852d888aacad99
4
+ data.tar.gz: 9fbbb02a9740f94c67a6b11843c0e969854fc39cb9031d33a8820f22a626dbf4
5
5
  SHA512:
6
- metadata.gz: 3d06af997f0486c935098393a264e2e3511374a73bcf9a655bb429ea78264b47eed601a6a5909f1fc59716c1e39b2b786ee68a465f5b850a8a5a23a05e89cec9
7
- data.tar.gz: 0601fc5c41c7da82658c2f40376fee4388664c9c326e506fbef93cf2cc53a0bcd21129fdeb0a5e498cc5c6a111f023644e0fe966954b488f3aa34d69c23248ce
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 checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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 install this gem onto your local machine, run `bundle exec rake install`. 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).
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/[USERNAME]/jekyll_chatgpt.
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
- {% assign messages=conversation.mapping | where_exp:"item", "item.parent == nil" %}
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>
@@ -1,32 +1,24 @@
1
- {% assign outer_message=messages | last %}
2
- <div class="chatgpt-message" id="{{outer_message.id}}">
3
- {% if outer_message.message %}
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
- {{ outer_message.message.content.parts[0] | markdownify }}
5
+ {{ include.message.message.content.parts[0] | markdownify }}
7
6
  {% else %}
8
- <pre>{{ outer_message.message.content.parts[0] }}</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 outer_message.children %}
14
- <!-- D {% increment depth %} -->
12
+ {% for child_id in include.message.children %}
15
13
  {% assign inner_message=conversation.mapping[child_id] %}
16
- {% assign messages = messages | push: inner_message %}
17
- <div class="chatgpt-messagechild">
18
- <input type="radio"
19
- name="chatgpt-{{ outer_message.id }}"
20
- id="chatgpt-control-{{ inner_message.id }}"
21
- class="chatgpt-control"
22
- {% if forloop.first %}checked{% endif %}
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>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllChatgpt
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
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.0
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-10 00:00:00.000000000 Z
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://github.com/pcouy/jekyll-chatgpt
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://github.com/pcouy/jekyll-chatgpt
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: []