scrapbook 0.2.0 → 0.2.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 +17 -17
- data/app/assets/builds/scrapbook/{tailwind.css → application.css} +0 -0
- data/app/helpers/scrapbook/helper_for_view.rb +5 -1
- data/app/views/layouts/scrapbook/application.html.erb +1 -2
- data/config/routes.rb +1 -1
- data/lib/generators/scrapbook/install_generator.rb +10 -0
- data/lib/scrapbook/engine.rb +1 -1
- data/lib/scrapbook/version.rb +1 -1
- metadata +3 -4
- data/app/assets/stylesheets/scrapbook/application.css +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19b4fdaf3007e60e0cd40c09d70fe04ee9c9b522552dc0060f718aba02fcaadd
|
4
|
+
data.tar.gz: 015d92510a0e2eacff22b81d163983de1ff88d2bc60f7f523e69dbfbc841d591
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c23dc644bb467bd0655a781615095e6cb74fd7ccc47dc0281a1877089bf42617fae23cbc182d290b437f96669328a899cda705a7ea69c299df0fb9f0e58f39c3
|
7
|
+
data.tar.gz: 379b7626edd2752d95c039d6daaf947f668c0dc4a1571685b58879a11509987df0da474184a4f37896c1585135e0ea7bc7be9c044e80bc78385a2f0566c287dc
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ end
|
|
26
26
|
|
27
27
|
And then execute:
|
28
28
|
|
29
|
-
```
|
29
|
+
```
|
30
30
|
$> bundle install
|
31
31
|
$> bundle exec rails generate scrapbook:install
|
32
32
|
```
|
@@ -70,12 +70,12 @@ path you want: `mount Scrapbook::Engine => "/scrappy"`.
|
|
70
70
|
You can configure one or more folders to be separate root scrapbooks via the
|
71
71
|
`config.scrapbook.paths` option. This option defaults to an empty array which allows for
|
72
72
|
using the shovel operator to add your paths:
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
73
|
+
```ruby
|
74
|
+
Rails.application.configure do
|
75
|
+
config.scrapbook.paths << Rails.root.join("scrapbooks/main")
|
76
|
+
config.scrapbook.paths << Rails.root.join("scrapbooks/scratch")
|
77
|
+
end
|
78
|
+
```
|
79
79
|
If no paths have been added, Scrapbook will use `Rails.root.join('scrapbook')` as the
|
80
80
|
location it expects the scrapbook to be at. The first folder path in the array is considered
|
81
81
|
the default scrapbook and will be available at the root mount point configured in the routes
|
@@ -85,17 +85,17 @@ We recommend only running Scrapbook in development / non-production Rails enviro
|
|
85
85
|
However, if you find yourself needing to be able to run it in an environment precompiles its
|
86
86
|
assets, you will need to configure Scrapbook to be part of the precompilation. You can do
|
87
87
|
this by setting `config.scrapbook.precompile_assets` to "true":
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
88
|
+
```ruby
|
89
|
+
Rails.application.configure do
|
90
|
+
config.scrapbook.precompile_assets = true
|
91
|
+
end
|
92
|
+
```
|
93
93
|
|
94
94
|
|
95
95
|
## Contributing
|
96
96
|
|
97
|
-
If you have a question about Scrapbook, feel free to ask in [the repository's
|
98
|
-
[Discussions]. Before starting any work or creating any issues, please read [the
|
97
|
+
If you have a question about Scrapbook, feel free to ask in [the repository's
|
98
|
+
Discussions][Discussions]. Before starting any work or creating any issues, please read [the
|
99
99
|
contribution guidelines](CONTRIBUTING.md).
|
100
100
|
|
101
101
|
## Development Setup
|
@@ -116,7 +116,7 @@ Once Tailwind's CLI has been installed, you can run it using the command below t
|
|
116
116
|
Scrapbook's CSS:
|
117
117
|
|
118
118
|
```
|
119
|
-
$> npx tailwindcss -i app/assets/stylesheets/scrapbook/application.tailwind.css -o app/assets/builds/scrapbook/
|
119
|
+
$> npx tailwindcss -i app/assets/stylesheets/scrapbook/application.tailwind.css -o app/assets/builds/scrapbook/application.css --minify --watch
|
120
120
|
```
|
121
121
|
|
122
122
|
(Note, the "tailwindcss-rails" gem currently doesn't support Rails engines, so we have to
|
@@ -130,7 +130,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
|
|
130
130
|
you may not use this file except in compliance with the License.
|
131
131
|
You may obtain a copy of the License at
|
132
132
|
|
133
|
-
|
133
|
+
[http://www.apache.org/licenses/LICENSE-2.0]()
|
134
134
|
|
135
135
|
Unless required by applicable law or agreed to in writing, software
|
136
136
|
distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -139,4 +139,4 @@ See the License for the specific language governing permissions and
|
|
139
139
|
limitations under the License.
|
140
140
|
|
141
141
|
|
142
|
-
[
|
142
|
+
[Discussions]: https://github.com/bfad/scrapbook/discussions
|
File without changes
|
@@ -11,7 +11,11 @@ module Scrapbook
|
|
11
11
|
def short_path_to(pathname, scrapbook = nil)
|
12
12
|
scrapbook ||= Scrapbook.find_scrapbook_for(pathname)
|
13
13
|
|
14
|
-
|
14
|
+
if scrapbook.root == ::Scrapbook::Engine.config.scrapbook.paths.first
|
15
|
+
view.short_page_path(scrapbook.relative_page_path_for(pathname))
|
16
|
+
else
|
17
|
+
view.book_page_path(scrapbook.relative_page_path_for(pathname), book: scrapbook.name)
|
18
|
+
end
|
15
19
|
end
|
16
20
|
|
17
21
|
def remove_handler_exts_from(pathname)
|
@@ -5,8 +5,7 @@
|
|
5
5
|
<%= csrf_meta_tags %>
|
6
6
|
<%= csp_meta_tag %>
|
7
7
|
|
8
|
-
<%= stylesheet_link_tag "scrapbook/
|
9
|
-
<%= stylesheet_link_tag "scrapbook/application", media: "all" %>
|
8
|
+
<%= stylesheet_link_tag "scrapbook/application", media: "all", "data-turbo-track": "reload" %>
|
10
9
|
</head>
|
11
10
|
<body class="flex">
|
12
11
|
<nav class="flex-none min-w-[20ch] max-w-[50%] h-screen overflow-scroll children:px-4 py-2 border-solid border-sky-700 border-0 border-r"><%= render 'layouts/scrapbook/folder_listing', scrapbook: local_assigns[:scrapbook], pathname: local_assigns[:pathname] %></nav>
|
data/config/routes.rb
CHANGED
@@ -11,6 +11,6 @@ Scrapbook::Engine.routes.draw do
|
|
11
11
|
|
12
12
|
get '.raw/:book/pages/*id', to: 'pages#raw', as: :raw_page,
|
13
13
|
constraints: {book: book_regex, id: /.*/}, defaults: {raw: true}
|
14
|
-
get ':book/*id', to: 'pages#show', constraints: {book: book_regex, id: /.*/}
|
14
|
+
get ':book/*id', to: 'pages#show', constraints: {book: book_regex, id: /.*/}, as: :book_page
|
15
15
|
get '*id', to: 'pages#show', constraints: {id: /.*/}, as: :short_page
|
16
16
|
end
|
@@ -11,6 +11,16 @@ module Scrapbook
|
|
11
11
|
def install
|
12
12
|
generate 'scrapbook:routes', options.fetch('url-path')
|
13
13
|
generate 'scrapbook:new', options.fetch('path-with-name')
|
14
|
+
sprockets_support
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def sprockets_support
|
20
|
+
relative_path = 'app/assets/config/manifest.js'
|
21
|
+
return unless FileTest.exist?(File.expand_path(relative_path, destination_root))
|
22
|
+
|
23
|
+
insert_into_file(relative_path, '//= link scrapbook/application.css')
|
14
24
|
end
|
15
25
|
end
|
16
26
|
end
|
data/lib/scrapbook/engine.rb
CHANGED
data/lib/scrapbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrapbook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Lindsay
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -41,9 +41,8 @@ files:
|
|
41
41
|
- LICENSE.txt
|
42
42
|
- README.md
|
43
43
|
- Rakefile
|
44
|
-
- app/assets/builds/scrapbook/
|
44
|
+
- app/assets/builds/scrapbook/application.css
|
45
45
|
- app/assets/config/scrapbook_manifest.js
|
46
|
-
- app/assets/stylesheets/scrapbook/application.css
|
47
46
|
- app/assets/stylesheets/scrapbook/application.tailwind.css
|
48
47
|
- app/controllers/scrapbook/application_controller.rb
|
49
48
|
- app/controllers/scrapbook/empty_controller.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
-
* It is generally better to create a new file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|