gitlab-org--gitlab-foss/lib/banzai
Yorick Peterse daad7144ec
Support Markdown rendering using multiple projects
This refactors the Markdown pipeline so it supports the rendering of
multiple documents that may belong to different projects. An example of
where this happens is when displaying the event feed of a group. In this
case we retrieve events for all projects in the group. Previously we
would group events per project and render these chunks separately, but
this would result in many SQL queries being executed. By extending the
Markdown pipeline to support this out of the box we can drastically
reduce the number of SQL queries.

To achieve this we introduce a new object to the pipeline:
Banzai::RenderContext. This object simply wraps two other objects: an
optional Project instance, and an optional User instance. On its own
this wouldn't be very helpful, but a RenderContext can also be used to
associate HTML documents with specific Project instances. This work is
done in Banzai::ObjectRenderer and allows us to reuse as many queries
(and results) as possible.
2018-04-11 14:10:19 +02:00
..
filter Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
pipeline Add banzai filter to detect commit message trailers and properly link the users 2018-04-04 15:04:03 +00:00
reference_parser Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
renderer Add CommonMark markdown engine 2018-03-07 23:14:41 +11:00
color_parser.rb Use %r around multi-line regular expressions 2018-02-02 15:13:32 -06:00
commit_renderer.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
cross_project_reference.rb Better group support notes-related code 2018-04-05 13:29:57 +02:00
filter.rb Remove redundant requires from Banzai files 2016-03-24 13:23:47 -04:00
filter_array.rb Add FilterArray class to Banzai 2016-03-01 15:54:35 -05:00
issuable_extractor.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
object_renderer.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
pipeline.rb
querying.rb Adds Rubocop rule for line break after guard clause 2017-11-16 17:58:29 +01:00
redactor.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
reference_extractor.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
reference_parser.rb Split Markdown rendering & reference gathering 2016-05-26 17:14:00 +02:00
render_context.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
renderer.rb Adds Rubocop rule for line break after guard clause 2017-11-16 17:58:29 +01:00
request_store_reference_cache.rb Resolve "DashboardController#activity.json is slow due to SQL" 2017-11-06 16:52:56 +00:00