Skip to content

Commit bb04038

Browse files
committed
Added an 'edit this page' button
1 parent e596f43 commit bb04038

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

pages/advanced-opt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222

23-
- [![](https://images.plot.ly/plotly-documentation/thumbnail/venn.jpg)](examples/LaTeX.md)
23+
- [![](https://images.plot.ly/plotly-documentation/thumbnail/venn.jpg)](LaTeX.md)
2424

2525
**LaTeX**
2626

pages/css/extra_css.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,15 @@ fieldset.signatures legend {
399399
[data-md-color-scheme="slate"] .subscribe-text {
400400
color: #a0aaba;
401401
}
402+
403+
404+
/* Edit button styling */
405+
406+
.edit-btn a{
407+
display: flex;
408+
justify-content: right;
409+
}
410+
411+
.edit-btn a span {
412+
margin-left: 10px;
413+
}

pages/overrides/main.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,36 @@
4848
{% endblock %}
4949

5050
{% block content %}
51+
52+
{% if page.file.src_path != "index.md" and not page.url.startswith('reference/') and
53+
not page.url.endswith(('plotly-fundamentals/', 'basic-charts/',
54+
'statistical-charts/', 'scientific-charts/', 'financial-charts/',
55+
'maps/', '3d-charts/', 'multiple-axes/', 'chart-events/', 'plotly-animations/',
56+
'advanced-opt/', 'controls/')) %}
57+
{% set filename = page.file.src_path.split('/')[-1] %}
58+
<div class="edit-btn">
59+
<a href="https://github.com/daexs/plotly.js/edit/mkdocs-conversion/pages/{{ filename }}" id="edit-link">
60+
<div class="icon">
61+
<svg style="width:20px;height:20px" viewBox="0 0 24 24">
62+
<path fill="#000000"
63+
d="M2.6,10.59L8.38,4.8L10.07,6.5C9.83,
64+
7.35 10.22,8.28 11,8.73V14.27C10.4,14.61 10,
65+
15.26 10,16A2,2 0 0,0 12,18A2,2 0 0,0 14,16C14,
66+
15.26 13.6,14.61 13,14.27V9.41L15.07,11.5C15,11.65 15,
67+
11.82 15,12A2,2 0 0,0 17,14A2,2 0 0,0 19,12A2,2 0 0,0 17,
68+
10C16.82,10 16.65,10 16.5,10.07L13.93,7.5C14.19,6.57 13.71,
69+
5.55 12.78,5.16C12.35,5 11.9,4.96 11.5,5.07L9.8,3.38L10.59,
70+
2.6C11.37,1.81 12.63,1.81 13.41,2.6L21.4,10.59C22.19,
71+
11.37 22.19,12.63 21.4,13.41L13.41,21.4C12.63,22.19 11.37,
72+
22.19 10.59,21.4L2.6,13.41C1.81,12.63 1.81,11.37 2.6,10.59Z">
73+
</path>
74+
</svg>
75+
</div>
76+
<span>Suggest an edit to this page</span>
77+
</a>
78+
</div>
79+
{% endif %}
80+
5181
<blockquote>
5282
<p><strong>Plotly Studio:</strong> Transform any dataset into an interactive data application in minutes with AI. <a
5383
href="https://plotly.com/studio/">Try

0 commit comments

Comments
 (0)