Skip to content

Commit

Permalink
add customized tab titles to cookbook and move cpp down the list
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnapf authored and vigsterkr committed Mar 10, 2016
1 parent 3396d7f commit c810da4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions doc/cookbook/source/conf.py
Expand Up @@ -186,20 +186,32 @@
#html_file_suffix = None

target_languages = (
('cpp', 'cpp'),
('python', 'py'),
('octave', 'm'),
('r', 'R'),
('java', 'java'),
('cpp', 'cpp'),
('csharp', 'cs'),
('ruby', 'rb'),
)

target_languages_tab_titles = {
'python': 'Python',
'octave': 'Octave',
'r': 'R',
'java': 'Java',
'cpp': 'C++',
'csharp': 'C#',
'ruby': 'Ruby',
}

generated_examples_path = None

html_context = {
'target_languages':
[x[0] for x in target_languages]
[x[0] for x in target_languages],

'target_languages_tab_titles': target_languages_tab_titles
}

# Output file base name for HTML help builder.
Expand Down
2 changes: 1 addition & 1 deletion doc/cookbook/source/templates/page.html
Expand Up @@ -8,7 +8,7 @@
<ul class="nav nav-tabs" role="tablist">
{% for lang in target_languages %}
<li role="presentation" {% if loop.index==1 %}class="active"{% endif %}>
<a id="{{lang}}-tab" href="#{{lang}}-tab" role="tab" data-toggle="tab" {% if loop.index==1 %}class="active" aria-expanded="true"{% endif %} >{{lang|title}}</a>
<a id="{{lang}}-tab" href="#{{lang}}-tab" role="tab" data-toggle="tab" {% if loop.index==1 %}class="active" aria-expanded="true"{% endif %} >{{target_languages_tab_titles[lang]|title}}</a>
</li>
{% endfor %}
</ul>
Expand Down

0 comments on commit c810da4

Please sign in to comment.