slidict 0.1.2 → 0.1.9

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: be7eb12f72a7017dada85767aef5a2723e0c7ebd28a7d3b8dd5725098903e0c2
4
- data.tar.gz: c7be11bc74153be8ea5fd0ae52e62bcb62fdfed5ec6a57fce05642cc5b341432
3
+ metadata.gz: fbc5e790dd61153be274e56924cf62275c6f7faecc62fadeb1be61112d2b7c22
4
+ data.tar.gz: 0a1af3694e1bce28b2f21a4d0898fad0034ff6fe3460b9d53e18236668a5b4f4
5
5
  SHA512:
6
- metadata.gz: f597120d84f08d011fdae68253d950efae06633fb8e5a15166f86a2e4f995c7b75e0004925b0fa9c385e7514e5b0d421d4eb68edb487e637d7016b9c713d8e3d
7
- data.tar.gz: 26792e2c9d343f849790d4fc83b1bf2cefa7f4a638487eac3ea25c71795713fb960d8cceac0bf8d51390f8d409506906089639e76c70c55bebe58d645651bc37
6
+ metadata.gz: 7f037d810c7174a44b83f83666d186377edc3171d76bbc130f555f856252976065e752e9a44212369bbe08a2354480305ece22b1962851962366137416ef3f60
7
+ data.tar.gz: 141a0c3e8b00c02f35519b293be29b5033ed61ea75959f25a788c6da977d31907c78470a7fba99f7cc8adcf508880e86f90f4e20cde36da21db6d249690e6eff
@@ -19,5 +19,10 @@ categories:
19
19
  - title: '🧰 Maintenance'
20
20
  labels:
21
21
  - 'chore'
22
+ - 'ci'
23
+ - 'docs'
24
+ - 'build'
25
+ - 'perf'
26
+ - 'test'
22
27
  change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
23
28
  no-changes-template: '- No changes'
@@ -0,0 +1,96 @@
1
+ name: Bump Version
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ bump:
7
+ description: Version segment to bump.
8
+ required: true
9
+ default: patch
10
+ type: choice
11
+ options:
12
+ - patch
13
+ - minor
14
+ - major
15
+
16
+ permissions:
17
+ contents: write
18
+ pull-requests: write
19
+
20
+ jobs:
21
+ bump-version:
22
+ name: Bump gem version
23
+ runs-on: ubuntu-latest
24
+
25
+ steps:
26
+ - name: Check out repository
27
+ uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
28
+ with:
29
+ fetch-depth: 0
30
+
31
+ - name: Set up Ruby
32
+ uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0
33
+ with:
34
+ ruby-version: "3.4"
35
+
36
+ - name: Calculate next version
37
+ id: version
38
+ env:
39
+ BUMP: ${{ inputs.bump }}
40
+ run: |
41
+ ruby <<'RUBY' >> "$GITHUB_OUTPUT"
42
+ version_file = "lib/slidict/version.rb"
43
+ content = File.read(version_file)
44
+ current = content[/VERSION\s*=\s*"(\d+\.\d+\.\d+)"/, 1]
45
+ abort "Could not find current version in #{version_file}" unless current
46
+
47
+ major, minor, patch = current.split(".").map(&:to_i)
48
+ case ENV.fetch("BUMP")
49
+ when "major"
50
+ major += 1
51
+ minor = 0
52
+ patch = 0
53
+ when "minor"
54
+ minor += 1
55
+ patch = 0
56
+ when "patch"
57
+ patch += 1
58
+ else
59
+ abort "Unsupported bump value: #{ENV.fetch("BUMP")}"
60
+ end
61
+ target = [major, minor, patch].join(".")
62
+
63
+ puts "current=#{current}"
64
+ puts "next=#{target}"
65
+ RUBY
66
+
67
+ - name: Update version file
68
+ env:
69
+ NEXT_VERSION: ${{ steps.version.outputs.next }}
70
+ run: |
71
+ ruby -e 'path = "lib/slidict/version.rb"; version = ENV.fetch("NEXT_VERSION"); content = File.read(path); updated = content.sub(/VERSION\s*=\s*"\d+\.\d+\.\d+"/, "VERSION = \"#{version}\""); abort "Version was not updated" if updated == content; File.write(path, updated)'
72
+
73
+ - name: Verify gemspec
74
+ run: gem build slidict.gemspec
75
+
76
+ - name: Commit version bump
77
+ env:
78
+ NEXT_VERSION: ${{ steps.version.outputs.next }}
79
+ run: |
80
+ git config user.name "github-actions[bot]"
81
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
82
+ git checkout -B bump-version
83
+ git add lib/slidict/version.rb
84
+ git commit -m "chore: bump version to v${NEXT_VERSION}"
85
+ git push --force-with-lease origin bump-version
86
+
87
+ - name: Create pull request
88
+ env:
89
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90
+ NEXT_VERSION: ${{ steps.version.outputs.next }}
91
+ run: |
92
+ gh pr create \
93
+ --base "${GITHUB_REF_NAME}" \
94
+ --head bump-version \
95
+ --title "chore: bump version to v${NEXT_VERSION}" \
96
+ --body "Bump slidict gem version to v${NEXT_VERSION}."
@@ -12,39 +12,29 @@ jobs:
12
12
  steps:
13
13
  - name: Checkout Code
14
14
  uses: actions/checkout@v3
15
+ with:
16
+ fetch-depth: 0
15
17
 
16
18
  - name: Extract version
17
19
  id: version
18
20
  run: |
19
- version=$(grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" lib/prspec/ruby/version.rb | head -n 1)
21
+ version=$(grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" lib/slidict/version.rb | head -n 1)
20
22
  echo "version=v$version" >> $GITHUB_ENV
21
23
  echo "VERSION_TAG=v$version" >> $GITHUB_ENV
22
24
 
23
- - name: Check if version tag exists
24
- id: check_tag
25
+ - name: Check if version file changed
26
+ id: version_file
25
27
  run: |
26
- if gh release view "$VERSION_TAG" --json tagName > /dev/null 2>&1; then
27
- echo "exists=true" >> $GITHUB_OUTPUT
28
+ if git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" | grep -qx "lib/slidict/version.rb"; then
29
+ echo "changed=true" >> "$GITHUB_OUTPUT"
28
30
  else
29
- echo "exists=false" >> $GITHUB_OUTPUT
31
+ echo "changed=false" >> "$GITHUB_OUTPUT"
30
32
  fi
31
- env:
32
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33
-
34
- - name: Generate CHANGELOG with requarks/changelog-action
35
- if: steps.check_tag.outputs.exists == 'true'
36
- id: changelog
37
- uses: requarks/changelog-action@v1
38
- with:
39
- token: ${{ secrets.GITHUB_TOKEN }}
40
- tag: ${{ env.VERSION_TAG }}
41
- writeToFile: true
42
- changelogFilePath: CHANGELOG.md
43
33
 
44
- - name: Draft release with release-drafter
45
- if: steps.check_tag.outputs.exists == 'false'
34
+ - name: Release with release-drafter
46
35
  uses: release-drafter/release-drafter@v5
47
36
  with:
48
37
  config-name: release-drafter.yml
38
+ publish: ${{ steps.version_file.outputs.changed == 'true' }}
49
39
  env:
50
40
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -2,91 +2,48 @@ name: Ruby Gem
2
2
 
3
3
  on:
4
4
  push:
5
- tags: [ 'v*' ]
5
+ branches:
6
+ - main
7
+ paths:
8
+ - lib/slidict/version.rb
6
9
 
7
10
  jobs:
8
11
  build:
9
12
  name: Build + Publish
10
13
  runs-on: ubuntu-latest
11
14
  permissions:
12
- contents: write
15
+ contents: read
13
16
  packages: write
14
17
 
15
18
  steps:
16
- - uses: actions/checkout@v3
17
- with:
18
- fetch-depth: 0
19
-
20
- - name: Set up Ruby 3.4
21
- uses: ruby/setup-ruby@v1
22
- with:
23
- ruby-version: 3.4.3
24
-
25
- - name: Extract version
26
- id: version
27
- run: |
28
- version=$(echo "${GITHUB_REF#refs/tags/}")
29
- echo "version=$version" >> $GITHUB_ENV
30
-
31
- - name: Check if a previous tag exists
32
- id: previous_tag
33
- run: |
34
- if [ "$(git tag --list 'v*' | wc -l)" -gt 1 ]; then
35
- echo "exists=true" >> $GITHUB_OUTPUT
36
- else
37
- echo "exists=false" >> $GITHUB_OUTPUT
38
- fi
39
-
40
- - name: Generate CHANGELOG
41
- if: steps.previous_tag.outputs.exists == 'true'
42
- id: changelog
43
- uses: requarks/changelog-action@v1
44
- with:
45
- token: ${{ secrets.GITHUB_TOKEN }}
46
- tag: ${{ env.version }}
47
- writeToFile: true
48
- changelogFilePath: CHANGELOG.md
49
- includeRefIssues: true
50
- useGitmojis: true
51
-
52
- - name: Commit updated CHANGELOG.md
53
- if: steps.previous_tag.outputs.exists == 'true'
54
- run: |
55
- git config user.name "github-actions"
56
- git config user.email "github-actions@github.com"
57
- git add CHANGELOG.md
58
- git commit -m "docs: update CHANGELOG for ${{ env.version }}" || echo "No changes to commit"
59
- git push origin HEAD:main
60
- continue-on-error: true
61
-
62
- - name: Update GitHub Release
63
- uses: ncipollo/release-action@v1
64
- with:
65
- allowUpdates: true
66
- tag: ${{ env.version }}
67
- name: ${{ env.version }}
68
- body: ${{ steps.changelog.outputs.changes }}
69
- token: ${{ secrets.GITHUB_TOKEN }}
70
-
71
- - name: Publish to GPR
72
- run: |
73
- mkdir -p $HOME/.gem
74
- touch $HOME/.gem/credentials
75
- chmod 0600 $HOME/.gem/credentials
76
- printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
77
- gem build *.gemspec
78
- gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
79
- env:
80
- GEM_HOST_API_KEY: "Bearer ${{ secrets.GITHUB_TOKEN }}"
81
- OWNER: ${{ github.repository_owner }}
82
-
83
- - name: Publish to RubyGems
84
- run: |
85
- mkdir -p $HOME/.gem
86
- touch $HOME/.gem/credentials
87
- chmod 0600 $HOME/.gem/credentials
88
- printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
89
- gem build *.gemspec
90
- gem push *.gem
91
- env:
92
- GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
19
+ - uses: actions/checkout@v3
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Set up Ruby 3.4
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: 3.4.3
27
+
28
+ - name: Publish to GPR
29
+ run: |
30
+ mkdir -p $HOME/.gem
31
+ touch $HOME/.gem/credentials
32
+ chmod 0600 $HOME/.gem/credentials
33
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
34
+ gem build *.gemspec
35
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
36
+ env:
37
+ GEM_HOST_API_KEY: "${{ secrets.GITHUB_TOKEN }}"
38
+ OWNER: ${{ github.repository_owner }}
39
+
40
+ - name: Publish to RubyGems
41
+ run: |
42
+ mkdir -p $HOME/.gem
43
+ touch $HOME/.gem/credentials
44
+ chmod 0600 $HOME/.gem/credentials
45
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
46
+ gem build *.gemspec
47
+ gem push *.gem
48
+ env:
49
+ GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
data/CHANGELOG.md CHANGED
@@ -1,12 +1,5 @@
1
- ## [v0.1.2] - 2026-06-21
2
- ### :wrench: Chores
3
- - [`12bd765`](https://github.com/slidict/slidict/commit/12bd765c172267431349cf028b011db73f921721) - bump version 0.1.2 *(commit by [@abechan1](https://github.com/abechan1))*
4
- - [`c46fff3`](https://github.com/slidict/slidict/commit/c46fff3fef785e661b2e9cd41fc2f01ae725c984) - stop tracking Gemfile.lock *(commit by [@abechan1](https://github.com/abechan1))*
5
-
6
-
7
1
  ## [Unreleased]
8
2
 
9
3
  ## [0.1.0] - 2026-06-21
10
4
 
11
5
  - Initial release
12
- [v0.1.2]: https://github.com/slidict/slidict/compare/v0.1.1...v0.1.2
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Slidict
2
2
 
3
- Generate presentation-ready slides from a simple conversation.
3
+ Generate presentation source files from a simple conversation.
4
4
 
5
5
  Slidict is a CLI tool that helps you turn rough ideas into presentations through AI-guided conversations.
6
6
 
@@ -9,7 +9,7 @@ Unlike traditional slide generators, Slidict focuses on communication before sli
9
9
  ## Features
10
10
 
11
11
  - Interactive CLI conversation
12
- - Generate Markdown slides for Slidev, Marp, Asciidoctor Reveal.js, and other OSS presentation frameworks
12
+ - Generate slides for Slidev, Marp, Asciidoctor Reveal.js, and other OSS presentation frameworks
13
13
  - Local-first MVP implemented in Ruby
14
14
  - OpenAI Compatible API support, so you can point Slidict at OpenAI, Ollama, LM Studio, vLLM, or any other server implementing the same `/chat/completions` endpoint
15
15
 
@@ -25,10 +25,10 @@ Run the executable directly from this repository:
25
25
  bin/slidict
26
26
  ```
27
27
 
28
- Slidict asks a few questions and writes `slides.md`:
28
+ Slidict asks a few questions and generates presentation source files. For example, this creates a Marp Markdown deck:
29
29
 
30
30
  ```bash
31
- $ bin/slidict
31
+ $ bin/slidict --framework marp --output slides.md
32
32
 
33
33
  What would you like to talk about?
34
34
  > PDF Difference Monitoring Service
@@ -49,14 +49,18 @@ bin/slidict \
49
49
  --duration "5 minutes" \
50
50
  --audience "Engineering managers" \
51
51
  --goal "Approve an MVP pilot" \
52
- --framework slidev \
53
- --output slides.md
52
+ --framework asciidoctor-revealjs \
53
+ --output slides.adoc
54
54
  ```
55
55
 
56
- Output:
56
+ ## Output files
57
+
58
+ Choose the framework and output path that match the presentation tool you want to use. If you omit `--output`, Slidict chooses a framework-specific default:
57
59
 
58
60
  ```text
59
- slides.md
61
+ Slidev -> slides.md
62
+ Marp -> slides.md
63
+ Asciidoctor Reveal.js -> slides.adoc
60
64
  ```
61
65
 
62
66
  ## Configuration
data/lib/slidict/cli.rb CHANGED
@@ -3,6 +3,11 @@
3
3
  module Slidict
4
4
  class CLI
5
5
  DEFAULT_OUTPUT = "slides.md"
6
+ DEFAULT_OUTPUT_BY_FRAMEWORK = {
7
+ "slidev" => "slides.md",
8
+ "marp" => "slides.md",
9
+ "asciidoctor-revealjs" => "slides.adoc"
10
+ }.freeze
6
11
 
7
12
  def initialize(input: $stdin, output: $stdout, renderer: MarkdownRenderer.new)
8
13
  @input = input
@@ -53,7 +58,7 @@ module Slidict
53
58
  private
54
59
 
55
60
  def parse(argv)
56
- options = { output: DEFAULT_OUTPUT, framework: "slidev" }
61
+ options = { framework: "slidev" }
57
62
  args = argv.dup
58
63
 
59
64
  until args.empty?
@@ -85,6 +90,7 @@ module Slidict
85
90
  end
86
91
  end
87
92
 
93
+ options[:output] ||= default_output_for(options[:framework])
88
94
  options
89
95
  end
90
96
 
@@ -130,7 +136,7 @@ module Slidict
130
136
  @output.puts <<~HELP
131
137
  Usage: slidict [options]
132
138
 
133
- Generate presentation-ready Markdown slides from a short conversation.
139
+ Generate presentation source files from a short conversation.
134
140
 
135
141
  Options:
136
142
  --topic TEXT Presentation topic
@@ -143,10 +149,14 @@ module Slidict
143
149
  --llm-api-key KEY API key for the LLM endpoint (env: SLIDICT_LLM_API_KEY)
144
150
  --llm-model NAME Model name to request (env: SLIDICT_LLM_MODEL, default: gpt-4o-mini)
145
151
  --no-llm Skip the LLM call and use the built-in slide template
146
- -o, --output PATH Output file (default: slides.md)
152
+ -o, --output PATH Output file (default depends on --framework)
147
153
  -h, --help Show this help
148
154
  HELP
149
155
  0
150
156
  end
157
+
158
+ def default_output_for(framework)
159
+ DEFAULT_OUTPUT_BY_FRAMEWORK.fetch(framework.to_s.downcase, DEFAULT_OUTPUT)
160
+ end
151
161
  end
152
162
  end
@@ -4,11 +4,12 @@ module Slidict
4
4
  class MarkdownRenderer
5
5
  FRONTMATTER_BY_FRAMEWORK = {
6
6
  "slidev" => "theme: default\nclass: text-center",
7
- "marp" => "marp: true\ntheme: default",
8
- "asciidoctor-revealjs" => "revealjs_theme: white"
7
+ "marp" => "marp: true\ntheme: default"
9
8
  }.freeze
10
9
 
11
10
  def render(deck)
11
+ return render_asciidoctor_revealjs(deck) if deck.framework == "asciidoctor-revealjs"
12
+
12
13
  [frontmatter(deck.framework), deck.slides.map { |slide| render_slide(slide) }.join("\n---\n\n")].join("\n")
13
14
  end
14
15
 
@@ -24,5 +25,15 @@ module Slidict
24
25
  lines.concat(slide.bullets.map { |bullet| "- #{bullet}" })
25
26
  lines.join("\n")
26
27
  end
28
+
29
+ def render_asciidoctor_revealjs(deck)
30
+ lines = ["= #{deck.topic}", ":revealjs_theme: white", ":slidict_generated: #{Time.now.utc.iso8601}", ""]
31
+ lines.concat(deck.slides.flat_map { |slide| render_asciidoctor_slide(slide) })
32
+ lines.join("\n")
33
+ end
34
+
35
+ def render_asciidoctor_slide(slide)
36
+ ["== #{slide.title}", "", *slide.bullets.map { |bullet| "* #{bullet}" }, ""]
37
+ end
27
38
  end
28
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Slidict
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slidict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Abe
@@ -19,6 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - ".github/dependabot.yml"
21
21
  - ".github/release-drafter.yml"
22
+ - ".github/workflows/bump-version.yml"
22
23
  - ".github/workflows/changelog.yml"
23
24
  - ".github/workflows/gem-push.yml"
24
25
  - ".github/workflows/test.yml"