예제 #1
0
def run(argv):
    bauerGlobals = BauerGlobals()

    setupLogging(argv)

    generatorInfo = GeneratorInfo()

    argParser = BauerArgParser(bauerGlobals, generatorInfo)
    argParser.buildBauerArguments(argv)

    args = argParser.parse_args()

    if args == None:
        return

    if args.command == 'new':
        templateCreator = TemplateCreator()
        templateCreator.generate(args)
        return
    if args.command == 'doc':
        doccer = Documentation()
        doccer.run(args)
        return

    rootPath = os.path.abspath(
        os.path.join(os.path.realpath(__file__), "..", ".."))
    source_folder = os.getcwd()

    buildFolder = BuildFolder(bauerGlobals, generatorInfo, source_folder, args)

    commandProcessor = CommandProcessor(bauerGlobals, generatorInfo, args,
                                        rootPath, source_folder, buildFolder)
    commandProcessor.process()
예제 #2
0
class Client(TwistedClient):

    documentation = Documentation()

    THEMES = {
        # Matching theme names with Theme instances.
        TwistedClient.DEFAULTTHEME: documentation,
        'documentation': documentation,
        'doc': documentation,
    }
예제 #3
0
파일: bauer.py 프로젝트: wilsonsouza/boden
def run(argv):
    bauerGlobals = BauerGlobals()

    setupLogging(argv)

    generatorInfo = GeneratorInfo()

    argParser = BauerArgParser(bauerGlobals, generatorInfo)
    argParser.buildBauerArguments(argv)

    args = argParser.parse_args()

    if args == None:
        return

    if args.command == 'new':
        templateCreator = TemplateCreator()
        templateCreator.generate(args)
        return
    if args.command == 'doc':
        doccer = Documentation()
        doccer.run(args)
        return

    rootPath = os.path.abspath(
        os.path.join(os.path.realpath(__file__), "..", ".."))
    source_folder = os.getcwd()

    # Python will switch to the real path when the working dir has a symlink in it.
    # We'll update the current dir and the environment variable to reflect this.
    os.chdir(source_folder)
    os.environ["PWD"] = source_folder

    buildFolder = BuildFolder(bauerGlobals, generatorInfo, source_folder, args)

    commandProcessor = CommandProcessor(bauerGlobals, generatorInfo, args,
                                        rootPath, source_folder, buildFolder)
    commandProcessor.process()
예제 #4
0
파일: fladoc.py 프로젝트: cuonggt/fladoc
from flask import Flask, render_template, redirect, abort
from documentation import Documentation
from lxml import html
from werkzeug.contrib.cache import SimpleCache

DEFAULT_VERSION = '0.12'

app = Flask(__name__, static_url_path='')

docs = Documentation(SimpleCache())


@app.route('/')
def welcome():
    return render_template('welcome.html', current_version=DEFAULT_VERSION)


@app.route('/docs/')
def show_root_page():
    return redirect('/docs/' + DEFAULT_VERSION)


@app.route('/docs/<version>/')
@app.route('/docs/<version>/<page>')
def show(version, page=None):
    if not is_version(version):
        return redirect('/docs/' + DEFAULT_VERSION + '/' + version, 301)

    if not page:
        page = ''
 def __init__(self, soup):
     self._soup = soup
     self._documentation = Documentation()