'Generate template properties and render readthedocs-data.js.'

def generate_rtd_data(self, docs_dir):

    readthedocs_data = {'project': self.version.project.slug, 'version': self.version.slug, 'language': self.version.project.language, 'page': None, 'theme': 'readthedocs', 'builder': 'mkdocs', 'docroot': docs_dir, 'source_suffix': '.md', 'api_host': getattr(settings, 'PUBLIC_API_URL', 'https://readthedocs.org'), 'commit': self.version.project.vcs_repo(self.version.slug).commit}
    data_json = json.dumps(readthedocs_data, indent=4)
    data_ctx = {'data_json': data_json, 'current_version': readthedocs_data['version'], 'slug': readthedocs_data['project'], 'html_theme': readthedocs_data['theme'], 'pagename': None}
    tmpl = template_loader.get_template('doc_builder/data.js.tmpl')
    return tmpl.render(data_ctx)
