Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Added description about Sablon#5

Open
bshourse wants to merge 3 commits into
mainfrom
description/sablon
Open

Added description about Sablon#5
bshourse wants to merge 3 commits into
mainfrom
description/sablon

Conversation

@bshourse
Copy link
Copy Markdown

  • 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)

@bshourse bshourse added the ruby label Feb 11, 2023
@bshourse bshourse force-pushed the description/sablon branch 2 times, most recently from aa9fd09 to 9edb6ec Compare February 12, 2023 05:51
Copy link
Copy Markdown
Member

@igor-alexandrov igor-alexandrov left a 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.

Comment thread lib/curated/utils/md_formating.rb Outdated
Comment on lines +5 to +10
def ruby_example_code(text)
(+'```ruby') << "\n#{text}\n```"
end
Copy link
Copy Markdown
Member

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?

Comment thread 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)}"
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Author

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants