1# -*- coding: utf-8 -*-2# Copyright 2011 Takeshi KOMIYA3#4# Licensed under the Apache License, Version 2.0 (the "License");5# you may not use this file except in compliance with the License.6# You may obtain a copy of the License at7#8# http://www.apache.org/licenses/LICENSE-2.09#10# Unless required by applicable law or agreed to in writing, software11# distributed under the License is distributed on an "AS IS" BASIS,12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13# See the License for the specific language governing permissions and14# limitations under the License.1516from blockdiag.utils.rst import directives17from docutils.parsers import rst1819from actdiag.utils.rst.nodes import actdiag as actdiag_node2021directive_options_default = dict(format='PNG',22 antialias=False,23 fontpath=None,24 outputdir=None,25 nodoctype=False,26 noviewbox=False,27 inline_svg=False)28directive_options = {}293031class ActdiagDirective(directives.BlockdiagDirective):32 name = "actdiag"33 node_class = actdiag_node343536 def global_options(self):37 return directive_options383940def setup(**kwargs):41 for key, value in directive_options_default.items():42 directive_options[key] = kwargs.get(key, value)4344 rst.directives.register_directive("actdiag", ActdiagDirective)