-
Notifications
You must be signed in to change notification settings - Fork 0
Added description about Sablon #5
base: main
Are you sure you want to change the base?
Conversation
bshourse
commented
Feb 11, 2023
- Added a description of the gem Sablon.
- Also created a module in which you can add your methods for Markdown formatting(for example displaying ruby code formatting)
aa9fd09
to
9edb6ec
Compare
9edb6ec
to
498e1c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bshourse Dima, thanks for your PR, please take a look at my comments.
lib/curated/utils/md_formating.rb
Outdated
def ruby_example_code(text) | ||
(+'```ruby') << "\n#{text}\n```" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about renaming this to code_block(language, text=nil, &block)
or something?
lib/ruby/sablon.rb
Outdated
"\n\ntemplate.render_to_file File.expand_path('~/Users/bs/Documents/output.docx'), context" | ||
|
||
pros "We've been usi Sablon in some projects for inserting content in docx templates." | ||
pros "It is easy to use this gem:\n #{Utils.ruby_example_code(text)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid using Utils directly in Markdown. Better create anonymous class that encapsulates all necessary helpers in Curated
class. You can take a look at similar definition here: https://github.com/jetrockets/curated/blob/main/lib/curated/renderer.rb#L15.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the new thoughts. May you please see the new implementation?
… helpers in anonymous class.
498e1c9
to
5a2aab2
Compare