Skip to content

Commit

Permalink
better option validators
Browse files Browse the repository at this point in the history
  • Loading branch information
janbrohl committed Jan 14, 2020
1 parent f049762 commit b9e63e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sphinxcontrib/datatemplates/directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class DataTemplateBase(rst.Directive):
optional_arguments = 1
final_argument_whitespace = True
option_spec = {
'source': rst.directives.unchanged,
'template': rst.directives.unchanged,
'source': rst.directives.path,
'template': rst.directives.path,
}
has_content = True

Expand Down Expand Up @@ -105,7 +105,7 @@ def run(self):

class DataTemplateWithEncoding(DataTemplateBase):
option_spec = dict(DataTemplateBase.option_spec, **{
'encoding': rst.directives.unchanged,
'encoding': rst.directives.encoding,
})


Expand Down Expand Up @@ -193,11 +193,11 @@ def _handle_dialect_option(argument):
class DataTemplateLegacy(rst.Directive):

option_spec = {
'source': rst.directives.unchanged,
'template': rst.directives.unchanged,
'source': rst.directives.path,
'template': rst.directives.path,
'csvheaders': rst.directives.flag,
'csvdialect': _handle_dialect_option,
'encoding': rst.directives.unchanged,
'encoding': rst.directives.encoding,
}
has_content = False

Expand Down

0 comments on commit b9e63e3

Please sign in to comment.