Class: BlobViewer::Graph
Constant Summary
collapse
- INTERNAL_EXTENSIONS =
%w[mermaid].freeze
- PLANTUML_EXTENSIONS =
%w[plantuml pu puml iuml].freeze
- KROKI_EXTENSIONS =
%w[d2 dot gv noml plantuml pu puml iuml vg vl].freeze
Constants inherited
from Base
Base::PARTIAL_PATH_PREFIX
Instance Attribute Summary
Attributes inherited from Base
#blob
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from ServerSide
#prepare!, #render_error
Methods inherited from Base
auxiliary?, binary?, #binary_detected_after_load?, #collapsed?, #initialize, load_async?, loading_partial_path, partial_path, #prepare!, #render_error, rich?, simple?, text?, #too_large?
Class Method Details
.can_render?(blob, verify_binary: true) ⇒ Boolean
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'app/models/blob_viewer/graph.rb', line 32
def self.graph_format(blob)
case blob.extension
when *%w[mermaid]
'mermaid'
when *%w[d2]
'd2'
when *%w[dot gv]
'graphviz'
when *%w[noml]
'nomnoml'
when *%w[vg]
'vega'
when *%w[vl]
'vegalite'
when *%w[plantuml pu puml iuml]
'plantuml'
end
end
|
Instance Method Details
#banzai_render_context ⇒ Object
54
55
56
57
58
|
# File 'app/models/blob_viewer/graph.rb', line 54
def banzai_render_context
{}.tap do |h|
h[:cache_key] = ['blob', blob.id, 'commit', blob.commit_id]
end
end
|