Skip to content

Commit

Permalink
Use sphinx.ext.linkcode
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Mar 13, 2024
1 parent 448452d commit 46f9078
Show file tree
Hide file tree
Showing 27 changed files with 130 additions and 133 deletions.
14 changes: 14 additions & 0 deletions src/doc/common/static/custom-furo.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,17 @@ a.pdf:hover {
text-decoration: none;
}

/* Style for announcement banner */

.announcement {
background: orange;
}

.announcement-content {
color: black;
}

.announcement-content a {
color: white;
text-decoration: none;
}
2 changes: 1 addition & 1 deletion src/doc/en/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/en/a_tour_of_sage",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/en/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/constructions/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/en/constructions",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/en/constructions', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/developer/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/en/developer",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/en/developer', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/faq/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/en/faq",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/en/faq', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/installation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/en/installation",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/en/installation', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/prep/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/en/prep",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/en/prep', '{filename}'),
})

# General information about the project.
Expand Down
5 changes: 5 additions & 0 deletions src/doc/en/reference/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
ref_src = os.path.join(SAGE_DOC_SRC, 'en', 'reference')
ref_out = os.path.join(SAGE_DOC, 'html', 'en', 'reference')

# Add a small edit button.
html_theme_options.update({
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/en/reference/index.rst'),
})

# General information about the project.
project = "Reference Manual"

Expand Down
5 changes: 5 additions & 0 deletions src/doc/en/reference/conf_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
title = name.capitalize()
title = title.replace('`', '$')

# We use the directory's name to add a small edit button.
html_theme_options.update({
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/en/reference/{name}/index.rst'),
})

# General information about the project.
project = title

Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/thematic_tutorials/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/en/thematic_tutorials",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/en/thematic_tutorials', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/en/tutorial",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/en/tutorial', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/es/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/es/a_tour_of_sage",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/es/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/es/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/es/tutorial",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/es/tutorial', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/fr/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/fr/a_tour_of_sage",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/fr/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/fr/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/fr/tutorial",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/fr/tutorial', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/hu/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/hu/a_tour_of_sage",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/hu/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/it/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/it/a_tour_of_sage",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/it/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/it/faq/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/it/faq",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/it/faq', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/it/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/it/tutorial",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/it/tutorial', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ja/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/ja/a_tour_of_sage",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/ja/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ja/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/ja/tutorial",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/ja/tutorial', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/pt/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/pt/a_tour_of_sage",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/pt/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/pt/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/pt/tutorial",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/pt/tutorial', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ru/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/ru/tutorial",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/ru/tutorial', '{filename}'),
})

# General information about the project.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/tr/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Add a small edit button.
html_theme_options.update({
"source_directory": "src/doc/tr/a_tour_of_sage",
'source_edit_link': os.path.join(source_repository, f'blob/{version}/src/doc/tr/a_tour_of_sage', '{filename}'),
})

# General information about the project.
Expand Down
Loading

0 comments on commit 46f9078

Please sign in to comment.