コード例 #1
0
def setup(app):
    rev = get_github_rev()

    # links to files or folders on the GitHub
    baseurl = 'https://github.com/espressif/esp-idf'
    app.add_role('idf', autolink('{}/tree/{}/%s'.format(baseurl, rev)))
    app.add_role('idf_file', autolink('{}/blob/{}/%s'.format(baseurl, rev)))
    app.add_role('idf_raw', autolink('{}/raw/{}/%s'.format(baseurl, rev)))
    app.add_role('component', autolink('{}/tree/{}/components/%s'.format(baseurl, rev)))
    app.add_role('component_file', autolink('{}/blob/{}/components/%s'.format(baseurl, rev)))
    app.add_role('component_raw', autolink('{}/raw/{}/components/%s'.format(baseurl, rev)))
    app.add_role('example', autolink('{}/tree/{}/examples/%s'.format(baseurl, rev)))
    app.add_role('example_file', autolink('{}/blob/{}/examples/%s'.format(baseurl, rev)))
    app.add_role('example_raw', autolink('{}/raw/{}/examples/%s'.format(baseurl, rev)))

    # link to the current documentation file in specific language version
    on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
    if on_rtd:
        # provide RTD specific commit identification to be included in the link
        tag_rev = 'latest'
        if (run_cmd_get_output('git rev-parse --short HEAD') != rev):
            tag_rev = rev
    else:
        # if not on the RTD then provide generic identification
        tag_rev = run_cmd_get_output('git describe --always')

    app.add_role('link_to_translation', crosslink('%s../../%s/{}/%s.html'.format(tag_rev)))
コード例 #2
0
ファイル: link-roles.py プロジェクト: 331233580/ESP8266
def setup(app):
    rev = get_github_rev()

    # links to files or folders on the GitHub
    baseurl = 'https://github.com/espressif/ESP8266_RTOS_SDK'
    app.add_role('idf', autolink('{}/tree/{}/%s'.format(baseurl, rev)))
    app.add_role('idf_file', autolink('{}/blob/{}/%s'.format(baseurl, rev)))
    app.add_role('idf_raw', autolink('{}/raw/{}/%s'.format(baseurl, rev)))
    app.add_role('component',
                 autolink('{}/tree/{}/components/%s'.format(baseurl, rev)))
    app.add_role('component_file',
                 autolink('{}/blob/{}/components/%s'.format(baseurl, rev)))
    app.add_role('component_raw',
                 autolink('{}/raw/{}/components/%s'.format(baseurl, rev)))
    app.add_role('example',
                 autolink('{}/tree/{}/examples/%s'.format(baseurl, rev)))
    app.add_role('example_file',
                 autolink('{}/blob/{}/examples/%s'.format(baseurl, rev)))
    app.add_role('example_raw',
                 autolink('{}/raw/{}/examples/%s'.format(baseurl, rev)))

    # link to the current documentation file in specific language version
    on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
    if on_rtd:
        # provide RTD specific commit identification to be included in the link
        tag_rev = 'latest'
        if (run_cmd_get_output('git rev-parse --short HEAD') != rev):
            tag_rev = rev
    else:
        # if not on the RTD then provide generic identification
        tag_rev = run_cmd_get_output('git describe --always')

    app.add_role('link_to_translation',
                 crosslink('%s../../%s/{}/%s.html'.format(tag_rev)))
コード例 #3
0
ファイル: link-roles.py プロジェクト: 331233580/ESP8266
def get_github_rev():
    path = run_cmd_get_output('git rev-parse --short HEAD')
    tag = run_cmd_get_output('git describe --exact-match')
    print('Git commit ID: ', path)
    if len(tag):
        print('Git tag: ', tag)
        path = tag
    return path
コード例 #4
0
def get_github_rev():
    path = run_cmd_get_output('git rev-parse --short HEAD')
    tag = run_cmd_get_output('git describe --exact-match')
    print('Git commit ID: ', path)
    if len(tag):
        print('Git tag: ', tag)
        path = tag
    return path
コード例 #5
0
ファイル: link-roles.py プロジェクト: xuhongv/esp-faq
def setup(app):
    rev = get_github_rev()

    # link to the current documentation file in specific language version
    on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
    if on_rtd:
        # provide RTD specific commit identification to be included in the link
        tag_rev = 'latest'
        if (run_cmd_get_output('git rev-parse --short HEAD') != rev):
            tag_rev = rev
    else:
        # if not on the RTD then provide generic identification
        tag_rev = run_cmd_get_output('git describe --always')

    app.add_role('link_to_translation',
                 crosslink('%s../../%s/{}/%s.html'.format(tag_rev)))
コード例 #6
0
ファイル: conf_common.py プロジェクト: zhiqiang-hu/esp-idf
# The master toctree document.
master_doc = 'index'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#

# Readthedocs largely ignores 'version' and 'release', and displays one of
# 'latest', tag name, or branch name, depending on the build type.
# Still, this is useful for non-RTD builds.
# This is supposed to be "the short X.Y version", but it's the only version
# visible when you open index.html.
# Display full version to make things less confusing.
version = run_cmd_get_output('git describe')
# The full version, including alpha/beta/rc tags.
# If needed, nearest tag is returned by 'git describe --abbrev=0'.
release = version
print('Version: {0}  Release: {1}'.format(version, release))

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build', 'README.md']
コード例 #7
0
def get_github_rev():
    tag = run_cmd_get_output('git describe --exact-match')
    if tag:
        return tag.decode("utf-8")
    else:
        return 'master'
コード例 #8
0
def get_github_rev():
    tag = run_cmd_get_output('git describe --exact-match')
    if len(tag):
        return (tag)
    else:
        return 'master'
コード例 #9
0
ファイル: conf.py プロジェクト: xieweimin/esp-adf
# General information about the project.
project = u'Audio Development Framework'
copyright = u'2017 - 2018, Espressif'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#

# Readthedocs largely ignores 'version' and 'release', and displays one of
# 'latest', tag name, or branch name, depending on the build type.
# Still, this is useful for non-RTD builds.
# This is supposed to be "the short X.Y version", but it's the only version
# visible when you open index.html.
# Display full version to make things less confusing.
version = run_cmd_get_output('git describe')
# The full version, including alpha/beta/rc tags.
# If needed, nearest tag is returned by 'git describe --abbrev=0'.
release = version
print 'Version: {0}  Release: {1}'.format(version, release)

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
コード例 #10
0
ファイル: link-roles.py プロジェクト: loicpoulain/zephyr
def get_github_rev():
    tag = run_cmd_get_output('git describe --exact-match')
    if tag:
        return tag
    else:
        return 'master'