vitepress-rails 0.1.0 → 0.1.1

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: e3630ebac35f9a3cf3c2ebf4d5c027a7557385efd79a92337a8761bc1494a4bf
4
- data.tar.gz: 53358818d780b7aa1131a42ca94fe5c3983405eee9467c2c0fa126cc999bf2c7
3
+ metadata.gz: dedbe372715777b6f811161f40652f9197aa0b8d5ac324af5111d2cadcec35ec
4
+ data.tar.gz: 800e17e91840b8e41ea08de8894c4269ae98c720deeddecc10ff1df8ce52b1ca
5
5
  SHA512:
6
- metadata.gz: 1cc7c0194939b5320f35b037602a0b56f259d0931f2031af775b903e0647941ed03a4c62847c39cd4a6c2a8af9c3c431ef27f6da419afc31674861b37df1866f
7
- data.tar.gz: 861167cb94ba5e10704221df08a36feacf44d01881b26e031c615f67a09fbc2c678c19017a4026d4c501a5f09ce5e913cb084a524b1dfbb7556209bd0064a281
6
+ metadata.gz: 6410d722b48436dc70f8d4477f7c2e8172b183cb174e31f712c52ff778aa05d1b6570fbe735661e35d7e3570cda294b40d79bce28b0790b2fed923ce0c689a11
7
+ data.tar.gz: 45de6006269917000307314012f1500eaed470a304f4c5b2a955d0b9ac47232adee98d3bbef156f3967cd34311ae4f63513d632d969a6d69896acc0bd054fa27
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in vitepress-rails.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
13
+
14
+ gem "switchcop"
data/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # Vitepress::Rails
2
+
3
+ Integrate [Vitepress](https://vitepress.vuejs.org/) into your Rails application.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'vitepress-rails'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install vitepress-rails
20
+
21
+ 1. Run `rails vitepress:install` to add Vitepress to your Rails application and install the necessary dependencies.
22
+
23
+ This command creates docs folder that contains the Vitepress default application.
24
+
25
+ 2. Adds the following line to your `config/routes.rb` file:
26
+
27
+ ```ruby
28
+ mount Vitepress::Engine, at: "/"
29
+ ```
30
+ ***Only works with / path for now***
31
+
32
+ ## Usage
33
+
34
+ 1. Write your `.md` doc inside the `docs` folder.
35
+ 2. Run `rails assets:precompile`.
36
+ 3. Your page can be accessed at `/docs/<your-page-name>`
37
+
38
+ Your `/` path always will be `docs/index.md`
39
+
40
+ ## Development
41
+
42
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can
43
+ also run `bin/console` for an interactive prompt that will allow you to experiment.
44
+
45
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the
46
+ version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,
47
+ push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
48
+
49
+ ## Contributing
50
+
51
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Switchdreams/vitepress-rails. This project is
52
+ intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
53
+ the [code of conduct](https://github.com/SwitchDreams/vitepress-rails/blob/master/CODE_OF_CONDUCT.md).
54
+
55
+ ## License
56
+
57
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
58
+
59
+ ## Code of Conduct
60
+
61
+ Everyone interacting in the Vitepress::Rails project's codebases, issue trackers, chat rooms and mailing lists is
62
+ expected to follow the [code of conduct](https://github.com/SwitchDreams/vitepress-rails/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+ require "vitepress/rails"
6
+
7
+ RSpec::Core::RakeTask.new(:spec)
8
+
9
+ require "rubocop/rake_task"
10
+
11
+ RuboCop::RakeTask.new
12
+
13
+ task default: [:spec, :rubocop]
14
+
15
+ load "rails/tasks/engine.rake"
16
+
17
+ load "rails/tasks/statistics.rake"
18
+
19
+ path = File.expand_path(__dir__)
20
+ Dir.glob("#{path}/tasks/**/*.rake").each { |f| import f }
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "vitepress/rails"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/rails ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails gems
3
+ # installed from the root of your application.
4
+ #
5
+ ENGINE_ROOT = File.expand_path("..", __dir__)
6
+ ENGINE_PATH = File.expand_path("../lib/vitepress/engine", __dir__)
7
+ APP_PATH = File.expand_path("../test/dummy/config/application", __dir__)
8
+
9
+ # Set up gems listed in the Gemfile.
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11
+ require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
12
+
13
+ require "rails/all"
14
+ require "rails/engine/commands"
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Vitepress
4
4
  module Rails
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :vitepress do
4
+ desc "Build your docs"
5
+ task build: :environment do
6
+ Dir.chdir("./docs") do
7
+ unless system "yarn install && yarn docs:build"
8
+ raise "vitepress: docs:build failed"
9
+ end
10
+
11
+ # Move html files to pages folder
12
+ Dir.glob(".vitepress/dist/**/*.html").each do |file|
13
+ dir = File.dirname(file)
14
+ filename = File.basename(file)
15
+
16
+ dest = File.join("../app/views/pages", dir.remove(".vitepress/dist"))
17
+ FileUtils.mkdir_p(dest)
18
+
19
+ FileUtils.copy_file(file, File.join(dest, filename))
20
+ end
21
+
22
+ # Move assets files to public
23
+ if Dir.exist?(".vitepress/dist/assets")
24
+ FileUtils.copy_entry(".vitepress/dist/assets", "../public/assets")
25
+ end
26
+
27
+ # Copy public files
28
+ if Dir.exist?("public")
29
+ FileUtils.copy_entry("public", "../public")
30
+ end
31
+ end
32
+ end
33
+ end
34
+
35
+ if Rake::Task.task_defined?("assets:precompile")
36
+ Rake::Task["assets:precompile"].enhance(["vitepress:build"])
37
+ end
@@ -0,0 +1,4 @@
1
+ export default {
2
+ title: 'VitePress Rails',
3
+ description: 'Docs with vitepress-rails',
4
+ }
@@ -0,0 +1,25 @@
1
+ ---
2
+ # https://vitepress.dev/reference/default-theme-home-page
3
+ layout: home
4
+
5
+ hero:
6
+ name: "VitePress Rails"
7
+ text: "Docs with vitepress-rails"
8
+ tagline: My great project tagline
9
+ actions:
10
+ - theme: brand
11
+ text: Markdown Examples
12
+ link: /markdown-examples
13
+ - theme: alt
14
+ text: API Examples
15
+ link: /api-examples
16
+
17
+ features:
18
+ - title: Feature A
19
+ details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
20
+ - title: Feature B
21
+ details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
22
+ - title: Feature C
23
+ details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
24
+ ---
25
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "app",
3
+ "private": "true"
4
+ }
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :vitepress do
4
+ desc "Install vitepress"
5
+ task install: :environment do
6
+ system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("./init/install.rb", __dir__)}"
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ module Vitepress
2
+ module Rails
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vitepress-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - PedroAugustoRamalhoDuarte
@@ -45,12 +45,24 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - Gemfile
49
+ - README.md
50
+ - Rakefile
51
+ - bin/console
52
+ - bin/rails
53
+ - bin/setup
48
54
  - lib/vitepress/engine.rb
49
55
  - lib/vitepress/rails.rb
50
56
  - lib/vitepress/rails/finder.rb
51
57
  - lib/vitepress/rails/version.rb
52
58
  - lib/vitepress/railtie.rb
59
+ - lib/vitepress/tasks/vitepress/build.rake
60
+ - lib/vitepress/tasks/vitepress/init/config.js
61
+ - lib/vitepress/tasks/vitepress/init/index.md
53
62
  - lib/vitepress/tasks/vitepress/init/install.rb
63
+ - lib/vitepress/tasks/vitepress/init/package.json
64
+ - lib/vitepress/tasks/vitepress/install.rake
65
+ - sig/vitepress/rails.rbs
54
66
  homepage: https://github.com/SwitchDreams/rest-api-generator
55
67
  licenses:
56
68
  - MIT