[ADD] extension: allow to build graphs using graphviz
X-original-commit: e00b5e35c7
Part-of: odoo/documentation#1969
This commit is contained in:
committed by
Antoine Vandevenne (anv)
parent
026d6a76be
commit
28fe18157e
@@ -0,0 +1,25 @@
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
from docutils import nodes
|
||||
|
||||
|
||||
class PlaceHolder(Directive):
|
||||
""" Placeholder class for directives that must be skipped. """
|
||||
|
||||
has_content = True
|
||||
|
||||
def run(self):
|
||||
node = nodes.literal_block('graphviz', '')
|
||||
node += nodes.Text(
|
||||
f'{self.content[0]}\n'
|
||||
'> Graph not rendered because `dot` is not installed'
|
||||
)
|
||||
return [node]
|
||||
|
||||
|
||||
def setup(app):
|
||||
directives.register_directive('graphviz', PlaceHolder)
|
||||
|
||||
return {
|
||||
'parallel_read_safe': True,
|
||||
'parallel_write_safe': True
|
||||
}
|
||||
@@ -971,6 +971,13 @@ header.o_main_header {
|
||||
}
|
||||
}
|
||||
}
|
||||
.graphviz {
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
img {
|
||||
max-width: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user