mirror of https://github.com/tLDP/python-tldp
adding support for format asciidoc
simply using DocBook4XML to provide most of the effort
This commit is contained in:
parent
0117209034
commit
885d6a12f3
|
@ -8,16 +8,18 @@ import logging
|
||||||
from tldp.utils import which
|
from tldp.utils import which
|
||||||
from tldp.utils import arg_isexecutable, isexecutable
|
from tldp.utils import arg_isexecutable, isexecutable
|
||||||
from tldp.doctypes.common import BaseDoctype, depends
|
from tldp.doctypes.common import BaseDoctype, depends
|
||||||
|
from tldp.doctypes.docbook4xml import Docbook4XML
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Asciidoc(BaseDoctype):
|
class Asciidoc(Docbook4XML):
|
||||||
formatname = 'AsciiDoc'
|
formatname = 'AsciiDoc'
|
||||||
extensions = ['.txt']
|
extensions = ['.txt']
|
||||||
signatures = []
|
signatures = []
|
||||||
|
|
||||||
required = {'asciidoc_a2x': isexecutable,
|
required = {'asciidoc_asciidoc': isexecutable,
|
||||||
|
'asciidoc_xmllint': isexecutable,
|
||||||
}
|
}
|
||||||
|
|
||||||
def make_docbook45(self):
|
def make_docbook45(self):
|
||||||
|
@ -28,11 +30,9 @@ class Asciidoc(BaseDoctype):
|
||||||
return self.shellscript(s)
|
return self.shellscript(s)
|
||||||
|
|
||||||
@depends(make_docbook45)
|
@depends(make_docbook45)
|
||||||
def docbook_subbuild(self):
|
def make_validated_source(self):
|
||||||
config = self.config
|
s = '"{config.asciidoc_xmllint}" --noout --valid "{output.validsource}"'
|
||||||
source = self.output.validsource
|
return self.shellscript(s)
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def argparse(cls, p):
|
def argparse(cls, p):
|
||||||
|
@ -41,6 +41,9 @@ class Asciidoc(BaseDoctype):
|
||||||
g.add_argument('--asciidoc-asciidoc', type=arg_isexecutable,
|
g.add_argument('--asciidoc-asciidoc', type=arg_isexecutable,
|
||||||
default=which('asciidoc'),
|
default=which('asciidoc'),
|
||||||
help='full path to asciidoc [%(default)s]')
|
help='full path to asciidoc [%(default)s]')
|
||||||
|
g.add_argument('--asciidoc-xmllint', type=arg_isexecutable,
|
||||||
|
default=which('xmllint'),
|
||||||
|
help='full path to xmllint [%(default)s]')
|
||||||
|
|
||||||
#
|
#
|
||||||
# -- end of file
|
# -- end of file
|
||||||
|
|
Loading…
Reference in New Issue