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 +4 -4
- data/Gemfile +14 -0
- data/README.md +62 -0
- data/Rakefile +20 -0
- data/bin/console +15 -0
- data/bin/rails +14 -0
- data/bin/setup +8 -0
- data/lib/vitepress/rails/version.rb +1 -1
- data/lib/vitepress/tasks/vitepress/build.rake +37 -0
- data/lib/vitepress/tasks/vitepress/init/config.js +4 -0
- data/lib/vitepress/tasks/vitepress/init/index.md +25 -0
- data/lib/vitepress/tasks/vitepress/init/package.json +4 -0
- data/lib/vitepress/tasks/vitepress/install.rake +8 -0
- data/sig/vitepress/rails.rbs +6 -0
- metadata +13 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dedbe372715777b6f811161f40652f9197aa0b8d5ac324af5111d2cadcec35ec
|
4
|
+
data.tar.gz: 800e17e91840b8e41ea08de8894c4269ae98c720deeddecc10ff1df8ce52b1ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6410d722b48436dc70f8d4477f7c2e8172b183cb174e31f712c52ff778aa05d1b6570fbe735661e35d7e3570cda294b40d79bce28b0790b2fed923ce0c689a11
|
7
|
+
data.tar.gz: 45de6006269917000307314012f1500eaed470a304f4c5b2a955d0b9ac47232adee98d3bbef156f3967cd34311ae4f63513d632d969a6d69896acc0bd054fa27
|
data/Gemfile
ADDED
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,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,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
|
+
|
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.
|
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
|