marksmith 0.0.16 → 0.1.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 +7 -2
- 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 +1 -1
- data/app/assets/javascripts/marksmith_controller-no-stimulus.esm.js +1 -1
- data/app/assets/stylesheets/marksmith.css +6 -6
- data/app/frontend/entrypoints/application.css +5 -0
- data/app/frontend/entrypoints/javascript/controllers/index.js +2 -0
- data/app/views/marksmith/markdown_previews/create.turbo_stream.erb +1 -3
- data/app/views/marksmith/shared/_editor.html.erb +6 -6
- data/app/views/marksmith/shared/_rendered_body.html.erb +1 -1
- data/lib/marksmith/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62a833a3db7da2729cbe8743021710f452973784d3ce79d6612dc37201df3532
|
4
|
+
data.tar.gz: 192191de6e129b9ee26ef2fe7866efdf9d3e2cecd3d6448b8f3255847d1054e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 872a14aa320e5411628800c95c1ee9a2cb10a1e323af2d893c815fc075b3760f7d302c1410c47c09610828d444a6fde62129b2c8ab9d79127781cca77ea5a602
|
7
|
+
data.tar.gz: cc6358f58b2136dd31e1742bd92d210142eb44e93eaa65376541ed04d6beba08c7b963156de0092777613ec6c2892d90315d3e424b84f01ca45732d4182ce798
|
data/README.md
CHANGED
@@ -4,7 +4,9 @@ Marksmith is a GitHub-style markdown editor for Rails apps.
|
|
4
4
|
|
5
5
|
It supports Active Storage attachments and comes with a built-in mardown preview renderer.
|
6
6
|
|
7
|
-
|
7
|
+

|
8
|
+
|
9
|
+

|
8
10
|
|
9
11
|
## Usage
|
10
12
|
|
@@ -107,7 +109,10 @@ bin/importmap pin @avo-hq/marksmith
|
|
107
109
|
|
108
110
|
## Active Storage
|
109
111
|
|
110
|
-
The
|
112
|
+
The editor supports [ActiveStorage](https://guides.rubyonrails.org/active_storage_overview.html) uploads using drag and drop and pasting files into the field.
|
113
|
+
|
114
|
+
Whe used in Avo it supports injecting assets using the [Media Library feature](http://docs.avohq.io/3.0/media-library.html).
|
115
|
+
|
111
116
|
|
112
117
|
## List Continuation
|
113
118
|
|
@@ -854,6 +854,9 @@
|
|
854
854
|
margin-inline-end: calc(calc(var(--ms-spacing) * 2) * calc(1 - var(--tw-space-x-reverse)));
|
855
855
|
}
|
856
856
|
}
|
857
|
+
.ms\:overflow-auto {
|
858
|
+
overflow: auto;
|
859
|
+
}
|
857
860
|
.ms\:rounded {
|
858
861
|
border-radius: 0.25rem;
|
859
862
|
}
|
@@ -900,15 +903,9 @@
|
|
900
903
|
.ms\:px-2 {
|
901
904
|
padding-inline: calc(var(--ms-spacing) * 2);
|
902
905
|
}
|
903
|
-
.ms\:px-3 {
|
904
|
-
padding-inline: calc(var(--ms-spacing) * 3);
|
905
|
-
}
|
906
906
|
.ms\:py-1 {
|
907
907
|
padding-block: calc(var(--ms-spacing) * 1);
|
908
908
|
}
|
909
|
-
.ms\:py-2 {
|
910
|
-
padding-block: calc(var(--ms-spacing) * 2);
|
911
|
-
}
|
912
909
|
.ms\:py-px {
|
913
910
|
padding-block: 1px;
|
914
911
|
}
|
@@ -1027,6 +1024,9 @@
|
|
1027
1024
|
flex-direction: row;
|
1028
1025
|
}
|
1029
1026
|
}
|
1027
|
+
.marksmith, .marksmith * {
|
1028
|
+
box-sizing: border-box;
|
1029
|
+
}
|
1030
1030
|
.ms\:button-spinner {
|
1031
1031
|
width: 24px;
|
1032
1032
|
height: 24px;
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { application } from "./application"
|
2
2
|
|
3
3
|
import MarksmithController from "./marksmith_controller"
|
4
|
+
import ListContinuationController from "./list_continuation_controller"
|
4
5
|
// import MarksmithController from "./../../../../../app/assets/builds/marksmith.esm.js"
|
5
6
|
// console.log(MarksmithController)
|
6
7
|
|
7
8
|
application.register("marksmith", MarksmithController)
|
9
|
+
application.register("list-continuation", ListContinuationController)
|
@@ -1,6 +1,4 @@
|
|
1
1
|
<%= turbo_stream.update params[:element_id] do %>
|
2
|
-
|
3
|
-
<%= render partial: "marksmith/shared/rendered_body", locals: { body: @body } %>
|
4
|
-
</div>
|
2
|
+
<%= render partial: "marksmith/shared/rendered_body", locals: { body: @body } %>
|
5
3
|
<% end %>
|
6
4
|
|
@@ -26,7 +26,7 @@
|
|
26
26
|
gallery_turbo_frame = local_assigns.dig(:gallery, :turbo_frame) || nil
|
27
27
|
%>
|
28
28
|
<%= content_tag :div,
|
29
|
-
class: "ms:block ms:flex-col ms:w-full ms:border ms:border-neutral-300 ms:rounded ms:@container ms:focus-within:border-neutral-400",
|
29
|
+
class: "marksmith ms:block ms:flex-col ms:w-full ms:border ms:border-neutral-300 ms:rounded ms:@container ms:focus-within:border-neutral-400",
|
30
30
|
data: {
|
31
31
|
controller: "marksmith list-continuation",
|
32
32
|
action: "
|
@@ -65,11 +65,11 @@
|
|
65
65
|
</markdown-toolbar>
|
66
66
|
</div>
|
67
67
|
<% toolbar_button_classes = "ms:cursor-pointer ms:hover:bg-neutral-100 ms:px-1 ms:py-px ms:rounded ms:text-sm" %>
|
68
|
-
<div class="ms:border-t ms:w-full ms:border-neutral-300 ms:flex">
|
69
|
-
<%= content_tag :div, class: "ms:flex ms:flex-col ms:size-full", data: { marksmith_target: "fieldContainer" } do %>
|
68
|
+
<div class="ms:border-t ms:w-full ms:border-neutral-300 ms:flex ms:flex-1">
|
69
|
+
<%= content_tag :div, class: "ms:flex ms:flex-1 ms:flex-col ms:size-full", data: { marksmith_target: "fieldContainer" } do %>
|
70
70
|
<%= text_area_tag field_name, value,
|
71
71
|
id: name,
|
72
|
-
class: class_names("ms:flex ms:flex-1 ms:rounded ms:border-none ms:
|
72
|
+
class: class_names("ms:flex ms:flex-1 ms:rounded ms:border-none ms:resize-y ms:focus:outline-none ms:font-mono ms:focus:ring-0 ms:leading-normal ms:p-2 ms:text-sm", classes),
|
73
73
|
rows: rows,
|
74
74
|
data: {
|
75
75
|
action: "drop->marksmith#dropUpload paste->marksmith#pasteUpload",
|
@@ -81,7 +81,7 @@
|
|
81
81
|
autofocus:,
|
82
82
|
style:
|
83
83
|
%>
|
84
|
-
<div class="ms:flex ms:flex-1 ms:flex-grow ms:space-x-2 ms:py-1 ms:border-t ms:border-neutral-300 ms:px-2 ms:font-sans ms:text-sm">
|
84
|
+
<div class="ms:flex ms:flex-1 ms:flex-grow ms:space-x-2 ms:py-1 ms:border-t ms:border-neutral-300 ms:px-2 ms:font-sans ms:text-sm ms:p-2">
|
85
85
|
<%= 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
86
|
<%= image_tag asset_path("marksmith/svgs/markdown.svg"), class: "ms:inline ms:size-4 ms:mr-1" %> <%= t("marksmith.markdown_is_supported").humanize %>
|
87
87
|
<% end %>
|
@@ -96,7 +96,7 @@
|
|
96
96
|
</div>
|
97
97
|
<% end %>
|
98
98
|
<%= content_tag :div,
|
99
|
-
class: "ms:hidden ms:markdown-preview ms:size-full ms:flex-1 ms:flex ms:size-full",
|
99
|
+
class: "ms:hidden ms:markdown-preview ms:size-full ms:flex-1 ms:flex ms:size-full ms:p-2 ms:overflow-auto",
|
100
100
|
id: "markdown-preview-#{name}",
|
101
101
|
data: {
|
102
102
|
marksmith_target: "previewElement",
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= content_tag :div, class: "ms:
|
1
|
+
<%= content_tag :div, class: "ms:block ms:w-full ms:prose ms:max-w-none ms:prose-neutral" do %>
|
2
2
|
<%= sanitize(body, tags: %w(table th tr td span) + ActionView::Helpers::SanitizeHelper.sanitizer_vendor.safe_list_sanitizer.allowed_tags.to_a) %>
|
3
3
|
<% end %>
|
data/lib/marksmith/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marksmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
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-
|
11
|
+
date: 2025-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|