alchemy_cms

https://github.com/magiclabs/alchemy_cms

Ruby

AlchemyCMS is a powerful, flexible and user centric Rails 5 CMS. 🧙🏻‍♂️

Banzai::Renderer.cache_collection_render

Perform multiple render from an Array of Markdown String into an
Array of HTML-safe String of HTML.

As the rendered Markdown String can be already cached read all the data
from the cache using Rails.cache.read_multi operation. If the Markdown String
is not in the cache or it's not cacheable (no cache_key entry is provided in
the context) the Markdown String is rendered and stored in the cache so the
next render call gets the rendered HTML-safe String from the cache.

For further explanation see #render method comments.

texts_and_contexts - An Array of Hashes that contains the Markdown String (:text)
                     an options passed to our HTML Pipeline (:context)

If on the :context you specify a :cache_key entry will be used to retrieve it
and cache the result of rendering the Markdown String.

Returns an Array containing HTML-safe String instances.

Example:
   texts_and_contexts
   => [{ text: '### Hello',
         context: { cache_key: [note, :note] } }]

Source | Google | Stack overflow

Edit

git clone [email protected]:magiclabs/alchemy_cms.git

cd alchemy_cms

open

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Banzai--Renderer-cache_collection_render-for-pr


# Commit to git

git add git commit -m "better docs for Banzai::Renderer.cache_collection_render"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Banzai--Renderer-cache_collection_render-for-pr

hub pull-request


# Celebrate!