Skip to content

Commit 6e1cb88

Browse files
committed
Add GitHub issue templates and improve documentation layout
- Add concise GitHub issue templates for bug reports and feature requests - Implement edit source functionality that links to .md files instead of .ipynb files - Improve sidebar layout with wider navigation and proper responsive behavior - Add JavaScript fix for edit button URLs to point to markdown source files
1 parent ea1824e commit 6e1cb88

File tree

8 files changed

+204
-4
lines changed

8 files changed

+204
-4
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Bug Report
2+
description: Report a bug in pymoo
3+
title: "[BUG] "
4+
labels: ["bug"]
5+
6+
body:
7+
- type: checkboxes
8+
id: checklist
9+
attributes:
10+
label: Checklist
11+
options:
12+
- label: I searched existing issues
13+
required: true
14+
- label: I'm using the latest pymoo version
15+
required: false
16+
17+
- type: textarea
18+
id: description
19+
attributes:
20+
label: Bug Description
21+
description: What's wrong?
22+
validations:
23+
required: true
24+
25+
- type: textarea
26+
id: reproduction
27+
attributes:
28+
label: Minimal Code to Reproduce
29+
render: python
30+
validations:
31+
required: true
32+
33+
- type: textarea
34+
id: error
35+
attributes:
36+
label: Error Message
37+
render: shell
38+
39+
- type: input
40+
id: version
41+
attributes:
42+
label: PyMoo & Python Version
43+
placeholder: "pymoo 0.6.1.5, Python 3.9"
44+
validations:
45+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 📚 Documentation
4+
url: https://pymoo.org
5+
about: Check the documentation first
6+
- name: 💬 Discussions
7+
url: https://github.com/anyoptimization/pymoo/discussions
8+
about: Ask questions and discuss ideas
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Feature Request
2+
description: Suggest a new feature for pymoo
3+
title: "[FEATURE] "
4+
labels: ["enhancement"]
5+
6+
body:
7+
- type: textarea
8+
id: problem
9+
attributes:
10+
label: Problem
11+
description: What problem does this solve?
12+
validations:
13+
required: true
14+
15+
- type: textarea
16+
id: solution
17+
attributes:
18+
label: Proposed Solution
19+
description: What would you like to see?
20+
validations:
21+
required: true
22+
23+
- type: textarea
24+
id: alternatives
25+
attributes:
26+
label: Alternatives
27+
description: Any alternative solutions you've considered?
28+
29+
- type: textarea
30+
id: context
31+
attributes:
32+
label: Additional Context
33+
description: Examples, references, etc.

docs/source/_static/css/custom.css

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,48 @@ button[title*="theme"],
2020

2121
/* Keep original layout spacing since sidebar is still there as white space */
2222

23+
/* Make left sidebar wider (about 50% increase) without creating gaps */
24+
.bd-sidebar-primary {
25+
width: 375px !important;
26+
min-width: 375px !important;
27+
flex: 0 0 375px !important;
28+
}
29+
30+
/* Ensure main content flows right next to sidebar without gap */
31+
.bd-main {
32+
margin-left: 0 !important;
33+
}
34+
35+
/* When sidebar is hidden, expand main content to full width */
36+
.bd-container.hide-primary .bd-main {
37+
margin-left: 0 !important;
38+
max-width: 100% !important;
39+
width: 100% !important;
40+
}
41+
42+
.bd-container.hide-primary .bd-article-container {
43+
max-width: none !important;
44+
width: 100% !important;
45+
}
46+
47+
/* Responsive adjustments */
48+
@media (max-width: 1200px) {
49+
.bd-sidebar-primary {
50+
width: 320px !important;
51+
min-width: 320px !important;
52+
flex: 0 0 320px !important;
53+
}
54+
}
55+
56+
@media (max-width: 768px) {
57+
.bd-sidebar-primary {
58+
width: 280px !important;
59+
min-width: 280px !important;
60+
flex: 0 0 280px !important;
61+
}
62+
}
63+
64+
2365
/* Force light theme */
2466
html[data-theme="dark"],
2567
html[data-theme="auto"] {
@@ -176,4 +218,5 @@ strong, b {
176218

177219
.section-nav {
178220
border-left: 0 !important;
179-
}
221+
}
222+

docs/source/_templates/layout.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends "sphinx_book_theme/layout.html" %}
2+
3+
{# Inject JavaScript to fix edit button URLs #}
4+
{% block footer %}
5+
{{ super() }}
6+
{% if fix_edit_urls_js %}
7+
{{ fix_edit_urls_js | safe }}
8+
{% endif %}
9+
{% endblock %}

docs/source/conf.py

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,14 @@
7575

7676
# Sphinx Book Theme configuration
7777
html_theme_options = {
78-
"use_repository_button": False,
79-
"use_issues_button": False,
78+
"repository_url": "https://github.com/anyoptimization/pymoo",
79+
"repository_branch": "main",
80+
"path_to_docs": "docs/source",
81+
"use_repository_button": True,
82+
"use_issues_button": True,
8083
"use_download_button": False,
81-
"use_edit_page_button": False,
84+
"use_edit_page_button": True,
85+
"use_source_button": True,
8286
"show_navbar_depth": 1,
8387
"collapse_navigation": True,
8488
"navigation_depth": 1,
@@ -232,4 +236,44 @@
232236
# Disable RequireJS to avoid conflicts with clipboard.min.js
233237
nbsphinx_requirejs_path = ""
234238

239+
# ===========================================================================
240+
# Custom Source File Mapping for Edit Button
241+
# ===========================================================================
242+
243+
def setup(app):
244+
"""
245+
Custom setup function to modify the source file mapping.
246+
This ensures that the "Edit Source" button links to .md files instead of .ipynb files.
247+
"""
248+
def html_page_context(app, pagename, templatename, context, doctree):
249+
"""
250+
Add JavaScript to fix edit button URLs to point to .md files.
251+
"""
252+
# Add JavaScript that will fix the edit button URLs after page load
253+
fix_edit_urls_js = """
254+
<script>
255+
document.addEventListener('DOMContentLoaded', function() {
256+
// Find all edit and source buttons and fix their URLs
257+
const editButtons = document.querySelectorAll('a[href*="/edit/"], a[href*="/blob/"]');
258+
editButtons.forEach(button => {
259+
if (button.href.includes('.ipynb')) {
260+
button.href = button.href.replace('.ipynb', '.md');
261+
}
262+
});
263+
});
264+
</script>
265+
"""
266+
267+
# Add the JavaScript to the page context
268+
context['fix_edit_urls_js'] = fix_edit_urls_js
269+
270+
# Connect the function to the html-page-context event
271+
app.connect('html-page-context', html_page_context)
272+
273+
return {
274+
'version': '1.0',
275+
'parallel_read_safe': True,
276+
'parallel_write_safe': True,
277+
}
278+
235279

docs/source/news.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ News
55
==============================================================================
66

77

8+
**May 26, 2025:** A new pymoo version **0.6.1.5** has been released with further refinements and bug fixes to ensure stability and performance across different environments.
9+
10+
**July 28, 2024:** We are excited to announce pymoo version **0.6.1.3** with significant improvements! This release brings **NumPy 2.0 compatibility**, ensuring pymoo works seamlessly with the latest scientific computing ecosystem. We've also made **Autograd optional** for automatic differentiation, incorporated numerous bug fixes from community pull requests, and improved overall stability. (:ref:`Release Notes<version_0_6_1_3>`)
11+
12+
**December 11, 2022:** Following the major 0.6.0 release, we've published pymoo **0.6.0.1** with important bug fixes and stability improvements to address issues discovered by the community.
13+
814
**July 11, 2022:** It just happened. The new pymoo (version **0.6.0**) version has been released. Many things happened under the hood; however, the code base has changed quite a bit. The individual class has been reimplemented, and the meta algorithms can now be constructed much simpler. New algorithms have been added (G3PXC, RVEA, SMS-EMOA), and dynamic optimization problems and a simple implementation of D-NSGA-II are available. For more details, please have a look at the changelogs. (:ref:`Release Notes<version_0_6_0>`)
915

1016

docs/source/versions.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ kernelspec:
3434
```{raw-cell}
3535
:raw_mimetype: text/restructuredtext
3636
37+
.. _version_0_6_1_5:
38+
```
39+
40+
#### 0.6.1.5 [[Documentation](http://archive.pymoo.org/0.6.1.5/)]
41+
42+
- Additional bug fixes and stability improvements
43+
- Enhanced compatibility across different environments
44+
- Performance optimizations
45+
46+
```{raw-cell}
47+
:raw_mimetype: text/restructuredtext
48+
3749
.. _version_0_6_1_3:
3850
```
3951

0 commit comments

Comments
 (0)