Пример #1
0
 def _sanitize(self, project):
     conf_template =  render_to_string('sphinx/conf.py',
                                       {'project': project,
                                        'template_dir': TEMPLATE_DIR,
                                         'badge': project.sponsored
                                         })
     safe_write(project.conf_filename, conf_template)
Пример #2
0
 def _write_config(self):
     """
     Create ``conf.py`` if it doesn't exist.
     """
     docs_dir = self.docs_dir()
     conf_template = render_to_string('sphinx/conf.py.conf',
                                      {'project': self.version.project,
                                       'version': self.version,
                                       'template_dir': TEMPLATE_DIR,
                                       })
     conf_file = os.path.join(docs_dir, 'conf.py')
     safe_write(conf_file, conf_template)
Пример #3
0
 def _sanitize(self, project):
     conf_template =  render_to_string('sphinx/conf.py',
                                       {'project': project,
                                        'template_dir': TEMPLATE_DIR,
                                         'badge': project.sponsored
                                         })
     rtd_ctx = Context({
         'verisons': project.active_versions(),
         'project': project,
         'static_path': STATIC_DIR,
         'template_path': TEMPLATE_DIR,
     })
     rtd_string = Template(RTD_CONF_ADDITIONS).render(rtd_ctx)
     conf_template = conf_template + "\n" + rtd_string
     safe_write(project.conf_filename, conf_template)
Пример #4
0
def update_created_docs(project):
    # grab the root path for the generated docs to live at
    path = project.doc_path

    doc_root = os.path.join(path, 'checkouts', 'latest', 'docs')

    if not os.path.exists(doc_root):
        os.makedirs(doc_root)

    project.path = doc_root
    project.save()
    #Touch a conf.py
    safe_write(os.path.join(project.path, 'conf.py'), '')

    project.write_index()

    for file in project.files.all():
        file.write_to_disk()
Пример #5
0
 def _sanitize(self, version):
     project = version.project
     conf_template =  render_to_string('sphinx/conf.py.conf',
                                       {'project': project,
                                        'template_dir': TEMPLATE_DIR,
                                         'badge': project.sponsored
                                         })
     rtd_ctx = Context({
         'verisons': project.active_versions(),
         'current_version': version,
         'project': project,
         'settings': settings,
         'static_path': STATIC_DIR,
         'template_path': TEMPLATE_DIR,
     })
     rtd_string = Template(RTD_CONF_ADDITIONS).render(rtd_ctx)
     conf_template = conf_template + "\n" + rtd_string
     safe_write(project.conf_file(version.slug), conf_template)
Пример #6
0
 def _sanitize(self, version):
     project = version.project
     conf_template = render_to_string(
         "sphinx/conf.py.conf", {"project": project, "template_dir": TEMPLATE_DIR, "badge": project.sponsored}
     )
     rtd_ctx = Context(
         {
             "verisons": project.active_versions(),
             "current_version": version,
             "project": project,
             "settings": settings,
             "static_path": STATIC_DIR,
             "template_path": TEMPLATE_DIR,
         }
     )
     rtd_string = Template(RTD_CONF_ADDITIONS).render(rtd_ctx)
     conf_template = conf_template + "\n" + rtd_string
     safe_write(project.conf_file(version.slug), conf_template)
Пример #7
0
 def _sanitize(self):
     project = self.version.project
     conf_template = render_to_string(
         'sphinx/conf.py.conf', {
             'project': project,
             'template_dir': TEMPLATE_DIR,
             'badge': project.sponsored
         })
     rtd_ctx = Context({
         'verisons': project.active_versions(),
         'current_version': self.version,
         'project': project,
         'settings': settings,
         'static_path': STATIC_DIR,
         'template_path': TEMPLATE_DIR,
     })
     rtd_string = Template(RTD_CONF_ADDITIONS).render(rtd_ctx)
     conf_template = conf_template + "\n" + rtd_string
     safe_write(project.conf_file(self.version.slug), conf_template)
Пример #8
0
def update_created_docs(project):
    """
    Handle generating the docs for projects hosted on RTD.
    """
    # grab the root path for the generated docs to live at
    path = project.doc_path

    doc_root = os.path.join(path, 'checkouts', 'latest', 'docs')

    if not os.path.exists(doc_root):
        os.makedirs(doc_root)

    project.path = doc_root
    #project.save()
    #Touch a conf.py
    safe_write(os.path.join(project.path, 'conf.py'), '')

    project.write_index()

    for file in project.files.all():
        file.write_to_disk()
Пример #9
0
def update_created_docs(project):
    """
    Handle generating the docs for projects hosted on RTD.
    """
    # grab the root path for the generated docs to live at
    path = project.doc_path

    doc_root = os.path.join(path, "checkouts", "latest", "docs")

    if not os.path.exists(doc_root):
        os.makedirs(doc_root)

    project.path = doc_root
    # project.save()
    # Touch a conf.py
    safe_write(os.path.join(project.path, "conf.py"), "")

    project.write_index()

    for file in project.files.all():
        file.write_to_disk()
Пример #10
0
 def write_to_disk(self):
     safe_write(self.filename, self.get_rendered())
Пример #11
0
 def write_index(self):
     if not self.is_imported:
         safe_write(self.get_index_filename(), self.get_rendered_index())
Пример #12
0
 def write_to_disk(self):
     safe_write(self.filename, self.get_rendered())
Пример #13
0
 def write_index(self):
     if not self.is_imported:
         safe_write(self.get_index_filename(), self.get_rendered_index())
Пример #14
0
 def write_to_disk(self):
     safe_write(self.conf_filename, self.get_rendered_conf())