marksmith 0.1.1 → 0.1.3
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 +116 -15
- data/app/assets/javascripts/list_continuation_controller-full.esm.js +1 -1
- data/app/assets/javascripts/list_continuation_controller-no-stimulus.esm.js +1 -1
- data/app/assets/javascripts/marksmith_controller-full.esm.js +10 -1
- data/app/assets/javascripts/marksmith_controller-no-stimulus.esm.js +10 -1
- data/app/assets/stylesheets/marksmith.css +2 -2
- data/app/components/marksmith/markdown_field/edit_component.rb +5 -4
- data/app/components/marksmith/markdown_field/show_component.rb +3 -2
- data/app/frontend/entrypoints/javascript/controllers/marksmith_controller.js +9 -0
- data/app/views/marksmith/shared/_editor.html.erb +21 -4
- data/lib/generators/marksmith/install_generator.rb +15 -0
- data/lib/generators/marksmith/templates/initializer/marksmith.tt +4 -0
- data/lib/marksmith/configuration.rb +16 -0
- data/lib/marksmith/engine.rb +17 -4
- data/lib/marksmith/version.rb +1 -1
- data/lib/marksmith.rb +1 -0
- metadata +8 -8
- data/app/helpers/marksmith/application_helper.rb +0 -4
- data/app/jobs/marksmith/application_job.rb +0 -4
- data/app/mailers/marksmith/application_mailer.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 138a40e01855d847e9b295185fcf85edc6801e80c9bd94b1d8a55de7efb0b0f7
|
4
|
+
data.tar.gz: d29d99ff35c10fbc9e7deaadc84d7b27fdadb494732364cfda3003c69d397b81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5be1932c6cc7b5054cab6875a38c615977682b4e50f048c1f04ec29df9c46cec911c846e4eb7f2f9413702841b1a801145ea0a91431efd9c7b11c511725c4b09
|
7
|
+
data.tar.gz: 1dd261670a842ca375bc584cf1028b078e4c93d147ee8f0893952704993a741efea93341ea89a6b6b1106e742b1724056684b45a0c0fdd4cf42a9b8ddd1b2eaf
|
data/README.md
CHANGED
@@ -1,13 +1,20 @@
|
|
1
1
|
# Marksmith
|
2
2
|
|
3
|
+
[](https://github.com/avo-hq/marksmith/actions/workflows/ci.yml)
|
4
|
+
|
3
5
|
Marksmith is a GitHub-style markdown editor for Rails apps.
|
4
6
|
|
5
|
-
It supports Active Storage attachments and comes with a built-in
|
7
|
+
It supports Active Storage attachments and comes with a built-in markdown preview renderer.
|
6
8
|
|
7
9
|

|
8
10
|
|
9
11
|

|
10
12
|
|
13
|
+
> [!WARNING]
|
14
|
+
> Marksmith is at the initial stage of development. It's nearing a beta release, but the API might change and bugs are expected. Please continue to use the library and report any issues in the GitHub repo.
|
15
|
+
|
16
|
+
Temporary live demo here, under the description field: [https://main.avodemo.com/avo/resources/projects/new](https://main.avodemo.com/avo/resources/projects/new)
|
17
|
+
|
11
18
|
## Usage
|
12
19
|
|
13
20
|
```erb
|
@@ -16,7 +23,7 @@ It supports Active Storage attachments and comes with a built-in mardown preview
|
|
16
23
|
|
17
24
|
## Installation
|
18
25
|
|
19
|
-
|
26
|
+
#### 1. Add `marksmith` to your `Gemfile`
|
20
27
|
|
21
28
|
Have Bundler add it by running this command:
|
22
29
|
|
@@ -33,20 +40,27 @@ Add this line to your application's Gemfile:
|
|
33
40
|
gem "marksmith"
|
34
41
|
```
|
35
42
|
|
36
|
-
|
43
|
+
#### 2. Install the NPM package to import the StimulusJS controller.
|
37
44
|
|
38
|
-
Install the package.
|
45
|
+
Install the package from npmjs.org.
|
39
46
|
|
40
47
|
```bash
|
41
48
|
$ yarn add @avo-hq/marksmith
|
42
49
|
```
|
43
50
|
|
44
|
-
|
51
|
+
Or pin it using importmap.
|
52
|
+
|
53
|
+
```bash
|
54
|
+
bin/importmap pin @avo-hq/marksmith
|
55
|
+
```
|
56
|
+
|
57
|
+
Import and register the controllers in your application. The `ListContinuationController` is optional and only needed if you want to have continued lists in your markdown.
|
45
58
|
|
46
59
|
```js
|
47
|
-
import { MarksmithController } from '@avo-hq/marksmith'
|
60
|
+
import { MarksmithController, ListContinuationController } from '@avo-hq/marksmith'
|
48
61
|
|
49
62
|
application.register('marksmith', MarksmithController)
|
63
|
+
application.register('list-continuation', ListContinuationController)
|
50
64
|
```
|
51
65
|
|
52
66
|
> [!NOTE]
|
@@ -66,28 +80,78 @@ import { MarksmithController } from '@avo-hq/marksmith/core'
|
|
66
80
|
application.register('marksmith', MarksmithController)
|
67
81
|
```
|
68
82
|
|
69
|
-
|
83
|
+
#### 3. Add the style tag to your `application.html` layout
|
70
84
|
|
71
85
|
```erb
|
72
86
|
<%= stylesheet_link_tag "marksmith" %>
|
73
87
|
```
|
74
88
|
|
75
|
-
|
89
|
+
#### 4. Use it
|
76
90
|
|
77
91
|
Use a form helper tag or attach it to your form builder.
|
78
92
|
|
79
93
|
```erb
|
80
94
|
<%= marksmith_tag :body, value: "### This is important" %>
|
81
95
|
or
|
82
|
-
<%=
|
96
|
+
<%= form.marksmith :body %>
|
83
97
|
```
|
84
98
|
|
85
|
-
##
|
99
|
+
## Configuration
|
100
|
+
|
101
|
+
Marksmith accepts a few configuration options.
|
102
|
+
|
103
|
+
### Field options
|
86
104
|
|
87
105
|
The field supports a few of the regular options like `disabled`, `placeholder`, `autofocus`, `style`, `class`, `rows`, `data`, and `value`, but also a custom one.
|
88
106
|
|
89
107
|
`extra_preview_params` - Sends extra params to the preview renderer.
|
90
108
|
|
109
|
+
`enable_file_uploads` - Whether to enable file uploads.
|
110
|
+
|
111
|
+
`upload_url` - The URL to use for file uploads. If not provided, the editor will use the `rails_direct_uploads_url` helper.
|
112
|
+
|
113
|
+
```erb
|
114
|
+
<%= marksmith_tag :body,
|
115
|
+
disabled: true,
|
116
|
+
placeholder: "Write your best markdown here.",
|
117
|
+
extra_preview_params: { foo: "bar" },
|
118
|
+
enable_file_uploads: true,
|
119
|
+
upload_url: nil
|
120
|
+
%>
|
121
|
+
```
|
122
|
+
|
123
|
+
### Eject configuration file
|
124
|
+
|
125
|
+
Marksmith comes with a default configuration file that you can eject to your app.
|
126
|
+
|
127
|
+
```bash
|
128
|
+
bin/rails generate marksmith:install
|
129
|
+
```
|
130
|
+
|
131
|
+
This will create a `config/initializers/marksmith.rb` file in your app.
|
132
|
+
|
133
|
+
### Mount path
|
134
|
+
|
135
|
+
The engine is mounted by default at `/marksmith`. You can change it by setting `Marksmith.configuration.mount_path` to a different path.
|
136
|
+
|
137
|
+
```ruby
|
138
|
+
# config/initializers/marksmith.rb
|
139
|
+
Marksmith.configure do |config|
|
140
|
+
config.mount_path = "/markdown"
|
141
|
+
end
|
142
|
+
```
|
143
|
+
|
144
|
+
### Mounting the engine
|
145
|
+
|
146
|
+
The engine is mounted by default, but you can disable it by setting `Marksmith.configuration.automatically_mount_engine` to `false` and then manually mount the engine in your `routes.rb` file.
|
147
|
+
|
148
|
+
```ruby
|
149
|
+
# config/routes.rb
|
150
|
+
Rails.application.routes.draw do
|
151
|
+
mount Marksmith::Engine => Marksmith.configuration.mount_path
|
152
|
+
end
|
153
|
+
```
|
154
|
+
|
91
155
|
## Built-in preview renderer
|
92
156
|
|
93
157
|
The renderer is powered by [`Redcarpet`](https://github.com/vmg/redcarpet).
|
@@ -96,15 +160,46 @@ It supports basic styles for headings, `strong`, `italic` and others.
|
|
96
160
|
In your `show.html.erb` view or the place where you want to render the compiled markup use the `marksmithed` helper and it will run the content through the renderer.
|
97
161
|
|
98
162
|
```erb
|
99
|
-
|
163
|
+
<%== marksmithed post.body %>
|
100
164
|
```
|
101
165
|
|
102
|
-
|
166
|
+
> [!WARNING]
|
167
|
+
> Using the `<%==` tag will output the raw HTML, so ensure you sanitize the content to avoid XSS attacks.
|
168
|
+
>
|
169
|
+
> See how we do it [here](https://github.com/avo-hq/avo/blob/main/app/views/marksmith/shared/_rendered_body.html.erb#L2).
|
170
|
+
> ```ruby
|
171
|
+
> # sample sanitization
|
172
|
+
> sanitize(body, tags: %w(table th tr td span) + ActionView::Helpers::SanitizeHelper.sanitizer_vendor.safe_list_sanitizer.allowed_tags.to_a)
|
173
|
+
> ```
|
103
174
|
|
104
|
-
|
175
|
+
### Customize the renderer
|
105
176
|
|
106
|
-
|
107
|
-
|
177
|
+
You can customize the renderer by overriding the `Marksmith::Renderer` model.
|
178
|
+
|
179
|
+
```ruby
|
180
|
+
# app/models/marksmith/renderer.rb
|
181
|
+
require "redcarpet"
|
182
|
+
|
183
|
+
module Marksmith
|
184
|
+
class Renderer
|
185
|
+
def renderer
|
186
|
+
::Redcarpet::Markdown.new(
|
187
|
+
::Redcarpet::Render::HTML,
|
188
|
+
tables: true,
|
189
|
+
lax_spacing: true,
|
190
|
+
fenced_code_blocks: true,
|
191
|
+
space_after_headers: true,
|
192
|
+
hard_wrap: true,
|
193
|
+
autolink: true,
|
194
|
+
strikethrough: true,
|
195
|
+
underline: true,
|
196
|
+
highlight: true,
|
197
|
+
quote: true,
|
198
|
+
with_toc_data: true
|
199
|
+
)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
108
203
|
```
|
109
204
|
|
110
205
|
## Active Storage
|
@@ -128,6 +223,12 @@ application.register('marksmith', MarksmithController)
|
|
128
223
|
application.register('list-continuation', ListContinuationController)
|
129
224
|
```
|
130
225
|
|
226
|
+
## Who uses Marksmith?
|
227
|
+
|
228
|
+
- [Avo](https://avohq.io) - Ruby on Rails Code-Based App Builder Framework
|
229
|
+
|
230
|
+
*Open a PR and add your project here*
|
231
|
+
|
131
232
|
## Contributing
|
132
233
|
|
133
234
|
Contribution directions go here.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
Marksmith 0.1.
|
2
|
+
Marksmith 0.1.3
|
3
3
|
*/
|
4
4
|
var MarksmithController = (function () {
|
5
5
|
'use strict';
|
@@ -2827,10 +2827,15 @@ var MarksmithController = (function () {
|
|
2827
2827
|
fieldId: String,
|
2828
2828
|
galleryEnabled: { type: Boolean, default: false },
|
2829
2829
|
galleryOpenPath: String,
|
2830
|
+
fileUploadsEnabled: { type: Boolean, default: true },
|
2830
2831
|
}
|
2831
2832
|
|
2832
2833
|
static targets = ['fieldContainer', 'fieldElement', 'previewElement', 'writeTabButton', 'previewTabButton', 'toolbar']
|
2833
2834
|
|
2835
|
+
get #fileUploadsDisabled() {
|
2836
|
+
return !this.fileUploadsEnabledValue
|
2837
|
+
}
|
2838
|
+
|
2834
2839
|
connect() {
|
2835
2840
|
subscribe(this.fieldContainerTarget, { defaultPlainTextPaste: { urlLinks: true } });
|
2836
2841
|
}
|
@@ -2878,11 +2883,15 @@ var MarksmithController = (function () {
|
|
2878
2883
|
}
|
2879
2884
|
|
2880
2885
|
dropUpload(event) {
|
2886
|
+
if (this.#fileUploadsDisabled) return
|
2887
|
+
|
2881
2888
|
event.preventDefault();
|
2882
2889
|
this.#uploadFiles(event.dataTransfer.files);
|
2883
2890
|
}
|
2884
2891
|
|
2885
2892
|
pasteUpload(event) {
|
2893
|
+
if (this.#fileUploadsDisabled) return
|
2894
|
+
|
2886
2895
|
if (!event.clipboardData.files.length) return
|
2887
2896
|
|
2888
2897
|
event.preventDefault();
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
Marksmith 0.1.
|
2
|
+
Marksmith 0.1.3
|
3
3
|
*/
|
4
4
|
var MarksmithController = (function (stimulus) {
|
5
5
|
'use strict';
|
@@ -2337,10 +2337,15 @@ var MarksmithController = (function (stimulus) {
|
|
2337
2337
|
fieldId: String,
|
2338
2338
|
galleryEnabled: { type: Boolean, default: false },
|
2339
2339
|
galleryOpenPath: String,
|
2340
|
+
fileUploadsEnabled: { type: Boolean, default: true },
|
2340
2341
|
}
|
2341
2342
|
|
2342
2343
|
static targets = ['fieldContainer', 'fieldElement', 'previewElement', 'writeTabButton', 'previewTabButton', 'toolbar']
|
2343
2344
|
|
2345
|
+
get #fileUploadsDisabled() {
|
2346
|
+
return !this.fileUploadsEnabledValue
|
2347
|
+
}
|
2348
|
+
|
2344
2349
|
connect() {
|
2345
2350
|
subscribe(this.fieldContainerTarget, { defaultPlainTextPaste: { urlLinks: true } });
|
2346
2351
|
}
|
@@ -2388,11 +2393,15 @@ var MarksmithController = (function (stimulus) {
|
|
2388
2393
|
}
|
2389
2394
|
|
2390
2395
|
dropUpload(event) {
|
2396
|
+
if (this.#fileUploadsDisabled) return
|
2397
|
+
|
2391
2398
|
event.preventDefault();
|
2392
2399
|
this.#uploadFiles(event.dataTransfer.files);
|
2393
2400
|
}
|
2394
2401
|
|
2395
2402
|
pasteUpload(event) {
|
2403
|
+
if (this.#fileUploadsDisabled) return
|
2404
|
+
|
2396
2405
|
if (!event.clipboardData.files.length) return
|
2397
2406
|
|
2398
2407
|
event.preventDefault();
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Marksmith::MarkdownField::EditComponent < Avo::Fields::EditComponent
|
4
|
-
|
5
|
-
|
2
|
+
if defined?(Avo)
|
3
|
+
class Marksmith::MarkdownField::EditComponent < Avo::Fields::EditComponent
|
4
|
+
def unique_id
|
5
|
+
[@field.type, @resource&.singular_route_key, @field.id].compact.join("_")
|
6
|
+
end
|
6
7
|
end
|
7
8
|
end
|
@@ -17,10 +17,15 @@ export default class extends Controller {
|
|
17
17
|
fieldId: String,
|
18
18
|
galleryEnabled: { type: Boolean, default: false },
|
19
19
|
galleryOpenPath: String,
|
20
|
+
fileUploadsEnabled: { type: Boolean, default: true },
|
20
21
|
}
|
21
22
|
|
22
23
|
static targets = ['fieldContainer', 'fieldElement', 'previewElement', 'writeTabButton', 'previewTabButton', 'toolbar']
|
23
24
|
|
25
|
+
get #fileUploadsDisabled() {
|
26
|
+
return !this.fileUploadsEnabledValue
|
27
|
+
}
|
28
|
+
|
24
29
|
connect() {
|
25
30
|
subscribe(this.fieldContainerTarget, { defaultPlainTextPaste: { urlLinks: true } })
|
26
31
|
}
|
@@ -68,11 +73,15 @@ export default class extends Controller {
|
|
68
73
|
}
|
69
74
|
|
70
75
|
dropUpload(event) {
|
76
|
+
if (this.#fileUploadsDisabled) return
|
77
|
+
|
71
78
|
event.preventDefault()
|
72
79
|
this.#uploadFiles(event.dataTransfer.files)
|
73
80
|
}
|
74
81
|
|
75
82
|
pasteUpload(event) {
|
83
|
+
if (this.#fileUploadsDisabled) return
|
84
|
+
|
76
85
|
if (!event.clipboardData.files.length) return
|
77
86
|
|
78
87
|
event.preventDefault()
|
@@ -13,6 +13,20 @@
|
|
13
13
|
local_assigns[:value] || nil
|
14
14
|
end
|
15
15
|
extra_preview_params = local_assigns[:extra_preview_params] || {}
|
16
|
+
upload_url = if local_assigns[:upload_url].present?
|
17
|
+
local_assigns[:upload_url]
|
18
|
+
elsif defined?(ActiveStorage)
|
19
|
+
main_app.rails_direct_uploads_url
|
20
|
+
end
|
21
|
+
|
22
|
+
enable_file_uploads = if upload_url.blank?
|
23
|
+
false
|
24
|
+
elsif local_assigns[:enable_file_uploads].nil?
|
25
|
+
true
|
26
|
+
else
|
27
|
+
local_assigns[:enable_file_uploads]
|
28
|
+
end
|
29
|
+
|
16
30
|
|
17
31
|
# Used by Avo and other adapters to enable the gallery link.
|
18
32
|
gallery_enabled = local_assigns.dig(:gallery, :enabled) || false
|
@@ -35,8 +49,9 @@
|
|
35
49
|
",
|
36
50
|
unique_selector: ".#{@input_id}", # used to pinpoint the exact element in which to insert the attachment
|
37
51
|
marksmith_preview_url_value: marksmith.markdown_previews_path,
|
52
|
+
marksmith_file_uploads_enabled_value: enable_file_uploads,
|
38
53
|
marksmith_active_tab_class: "bg-white",
|
39
|
-
marksmith_attach_url_value:
|
54
|
+
marksmith_attach_url_value: upload_url,
|
40
55
|
marksmith_extra_preview_params_value: extra_preview_params.as_json,
|
41
56
|
**local_assigns.fetch(:controller_data_attributes, {})
|
42
57
|
} do %>
|
@@ -69,7 +84,7 @@
|
|
69
84
|
<%= content_tag :div, class: "ms:flex ms:flex-1 ms:flex-col ms:size-full", data: { marksmith_target: "fieldContainer" } do %>
|
70
85
|
<%= text_area_tag field_name, value,
|
71
86
|
id: name,
|
72
|
-
class: class_names("ms:flex ms:flex-1 ms:rounded ms:border-none ms:resize-
|
87
|
+
class: class_names("ms:flex ms:flex-1 ms:rounded ms:border-none ms:resize-none ms:focus:outline-none ms:font-mono ms:focus:ring-0 ms:leading-normal ms:p-2 ms:text-sm", classes),
|
73
88
|
rows: rows,
|
74
89
|
data: {
|
75
90
|
action: "drop->marksmith#dropUpload paste->marksmith#pasteUpload",
|
@@ -85,8 +100,10 @@
|
|
85
100
|
<%= link_to "https://docs.github.com/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax", target: "_blank", class: class_names("ms:flex ms:items-center ms:text-neutral-800 ms:no-underline", toolbar_button_classes) do %>
|
86
101
|
<%= image_tag asset_path("marksmith/svgs/markdown.svg"), class: "ms:inline ms:size-4 ms:mr-1" %> <%= t("marksmith.markdown_is_supported").humanize %>
|
87
102
|
<% end %>
|
88
|
-
|
89
|
-
<%=
|
103
|
+
<% if enable_file_uploads %>
|
104
|
+
<%= button_tag data: { action: "click->marksmith#buttonUpload" }, class: class_names("ms:bg-none ms:border-none ms:bg-transparent ms:text-neutral-600 ms:items-center ms:flex", toolbar_button_classes) do %>
|
105
|
+
<%= image_tag asset_path("marksmith/svgs/paperclip.svg"), class: "ms:inline ms:size-4 ms:mr-1" %> <%= t("marksmith.upload_files").humanize %>
|
106
|
+
<% end %>
|
90
107
|
<% end %>
|
91
108
|
<% if gallery_enabled %>
|
92
109
|
<%= link_to gallery_full_path, data: { turbo_frame: gallery_turbo_frame }, class: class_names("ms:flex ms:items-center ms:text-neutral-800 ms:no-underline", toolbar_button_classes) do %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "rails/generators"
|
2
|
+
|
3
|
+
module Marksmith
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
source_root File.expand_path("templates", __dir__)
|
7
|
+
|
8
|
+
desc "Creates a Marksmith initializer."
|
9
|
+
|
10
|
+
def create_initializer_file
|
11
|
+
template "initializer/marksmith.tt", "config/initializers/marksmith.rb"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Marksmith
|
2
|
+
class Configuration
|
3
|
+
include ActiveSupport::Configurable
|
4
|
+
|
5
|
+
config_accessor(:automatically_mount_engine) { true }
|
6
|
+
config_accessor(:mount_path) { "/marksmith" }
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.configuration
|
10
|
+
@configuration ||= Configuration.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.configure
|
14
|
+
yield configuration
|
15
|
+
end
|
16
|
+
end
|
data/lib/marksmith/engine.rb
CHANGED
@@ -17,6 +17,14 @@ module Marksmith
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
initializer "marksmith.routes" do |app|
|
21
|
+
if Marksmith.configuration.automatically_mount_engine
|
22
|
+
app.routes.append do
|
23
|
+
mount Marksmith::Engine => Marksmith.configuration.mount_path
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
20
28
|
initializer "marksmith.assets.precompile" do |app|
|
21
29
|
if Rails.application.config.respond_to?(:assets)
|
22
30
|
# The manifest will expose the asset files to the main app.
|
@@ -24,14 +32,14 @@ module Marksmith
|
|
24
32
|
end
|
25
33
|
end
|
26
34
|
|
35
|
+
generators do |app|
|
36
|
+
Rails::Generators.configure! app.config.generators
|
37
|
+
end
|
38
|
+
|
27
39
|
initializer "avo-markdown_field.init" do |app|
|
28
40
|
if defined?(Avo)
|
29
41
|
require "marksmith/fields/markdown_field"
|
30
42
|
|
31
|
-
app.routes.append do
|
32
|
-
mount Marksmith::Engine => "/marksmith"
|
33
|
-
end
|
34
|
-
|
35
43
|
ActiveSupport.on_load(:avo_boot) do
|
36
44
|
Avo.plugin_manager.register :marksmith_field
|
37
45
|
|
@@ -45,6 +53,11 @@ module Marksmith
|
|
45
53
|
Avo.asset_manager.register_stimulus_controller "marksmith", "MarksmithController"
|
46
54
|
Avo.asset_manager.register_stimulus_controller "list-continuation", "ListContinuationController"
|
47
55
|
end
|
56
|
+
else
|
57
|
+
# Ignore the markdown_field components if Avo is not defined
|
58
|
+
app.autoloaders.main.ignore(
|
59
|
+
root.join("app", "components", "marksmith", "markdown_field"),
|
60
|
+
)
|
48
61
|
end
|
49
62
|
end
|
50
63
|
end
|
data/lib/marksmith/version.rb
CHANGED
data/lib/marksmith.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marksmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: redcarpet
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,9 +84,6 @@ files:
|
|
84
84
|
- app/frontend/entrypoints/javascript/controllers/index.js
|
85
85
|
- app/frontend/entrypoints/javascript/controllers/list_continuation_controller.js
|
86
86
|
- app/frontend/entrypoints/javascript/controllers/marksmith_controller.js
|
87
|
-
- app/helpers/marksmith/application_helper.rb
|
88
|
-
- app/jobs/marksmith/application_job.rb
|
89
|
-
- app/mailers/marksmith/application_mailer.rb
|
90
87
|
- app/models/marksmith/application_record.rb
|
91
88
|
- app/models/marksmith/renderer.rb
|
92
89
|
- app/views/layouts/marksmith/application.html.erb
|
@@ -96,7 +93,10 @@ files:
|
|
96
93
|
- config/locales/marksmith.en.yml
|
97
94
|
- config/routes.rb
|
98
95
|
- config/vite.json
|
96
|
+
- lib/generators/marksmith/install_generator.rb
|
97
|
+
- lib/generators/marksmith/templates/initializer/marksmith.tt
|
99
98
|
- lib/marksmith.rb
|
99
|
+
- lib/marksmith/configuration.rb
|
100
100
|
- lib/marksmith/engine.rb
|
101
101
|
- lib/marksmith/fields/markdown_field.rb
|
102
102
|
- lib/marksmith/helper.rb
|