How to use asciidoc - 3 common examples

To help you get started, we’ve selected a few asciidoc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FooBarWidget / mizuho / asciidoc / a2x.py View on Github external
parser.add_option('-v', '--verbose',
        action='count', dest='verbose', default=0,
        help='increase verbosity')
    if len(sys.argv) == 1:
        parser.parse_args(['--help'])
    source_options = get_source_options(sys.argv[-1])
    argv = source_options + sys.argv[1:] 
    opts, args = parser.parse_args(argv)
    if len(args) != 1:
        parser.error('incorrect number of arguments')
    opts.asciidoc_opts = ' '.join(opts.asciidoc_opts)
    opts.dblatex_opts = ' '.join(opts.dblatex_opts)
    opts.fop_opts = ' '.join(opts.fop_opts)
    opts.xsltproc_opts = ' '.join(opts.xsltproc_opts)
    opts = eval(str(opts))  # Convert optparse.Values to dict.
    a2x = A2X(opts)
    OPTIONS = a2x           # verbose and dry_run used by utility functions.
    verbose('args: %r' % argv)
    a2x.asciidoc_file = args[0]
    try:
        a2x.load_conf()
        a2x.execute()
    except KeyboardInterrupt:
        exit(1)
github FooBarWidget / mizuho / asciidoc / a2x.py View on Github external
result = []
    if os.path.isfile(asciidoc_file):
        options = ''
        for line in open(asciidoc_file):
            mo = re.search(r'^//\s*a2x:', line)
            if mo:
                options += ' ' + line[mo.end():].strip()
        parse_options()
    return result


#####################################################################
# Application class
#####################################################################

class A2X(AttrDict):
    '''
    a2x options and conversion functions.
    '''

    def execute(self):
        '''
        Process a2x command.
        '''
        self.process_options()
        # Append configuration file options.
        self.asciidoc_opts += ' ' + ASCIIDOC_OPTS
        self.dblatex_opts  += ' ' + DBLATEX_OPTS
        self.fop_opts      += ' ' + FOP_OPTS
        self.xsltproc_opts += ' ' + XSLTPROC_OPTS
        # Execute to_* functions.
        self.__getattribute__('to_'+self.format)()
github ianmiell / shutit-distro / asciidoc / asciidoc.py View on Github external
def module():
	return asciidoc(
		'shutit.tk.sd.asciidoc.asciidoc', 158844782.006,
		description='',
		maintainer='ian.miell@gmail.com',
		depends=['shutit.tk.setup']
	)

asciidoc

AsciiDoc is a text document format for writing things.

GPL-2.0
Latest version published 2 years ago

Package Health Score

58 / 100
Full package analysis