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

Added description about Sablon #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

bshourse
Copy link

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

Copy link
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 on lines 5 to 10
def ruby_example_code(text)
(+'```ruby') << "\n#{text}\n```"
end
Copy link
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?

"\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
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
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