-
Notifications
You must be signed in to change notification settings - Fork 16
Reworked directories structure and added dark mode #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
933c36e
Reworked the directory structure and added dark mode
ericbsd 5da244d
Fixed .readthedocs.yaml
ericbsd e9d9cc8
Fixed updated pr_opened
ericbsd 4df1c02
Updated README.md Local development server
ericbsd a585650
Adding Edit on GitHub
ericbsd 3a87ef9
fixed github_version
ericbsd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,10 @@ Use a local development server that regenerates the output whenever the input ch | |
|
||
``` | ||
git clone [email protected]:ghostbsd/documentation.git | ||
sudo pkg install -y py311-pip py311-sphinx py311-myst-parser py311-sphinx_rtd_theme gmake | ||
pip install docutils==0.16 | ||
sudo pip install sphinx-autobuild | ||
sudo pkg install -y py311-pip | ||
sudo pip install sphinx sphinx-rtd-theme myst-parser sphinx-autobuild | ||
cd documentation | ||
sphinx-autobuild source build/html | ||
sphinx-autobuild . build/html | ||
``` | ||
|
||
Then, open http://127.0.0.1:8000/index.html in a web browser. It will be regenerated and refreshed whenever a changed file is saved. | ||
|
@@ -30,5 +29,4 @@ One can also generate documentation, in various output formats, locally: | |
``` | ||
gmake html | ||
gmake epub | ||
|
||
``` |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
/* Dark mode styles, applied only when body has the dark-mode class */ | ||
body.dark-mode { | ||
background-color: #252525; /* Slightly lighter dark gray */ | ||
color: #e0e0e0; /* Light gray text */ | ||
} | ||
|
||
body.dark-mode .wy-nav-top { | ||
background-color: #2b2b2b; /* Darker header */ | ||
} | ||
|
||
body.dark-mode .wy-nav-side { | ||
background-color: #2b2b2b; /* Dark sidebar */ | ||
} | ||
|
||
body.dark-mode .wy-menu-vertical a { | ||
color: #e0e0e0; /* Light sidebar links */ | ||
} | ||
|
||
body.dark-mode .wy-menu-vertical a:hover { | ||
background-color: #3c3c3c; /* Hover effect for general links */ | ||
} | ||
|
||
body.dark-mode .wy-nav-content { | ||
background-color: #252525; /* Match the body background */ | ||
} | ||
|
||
body.dark-mode h1, | ||
body.dark-mode h2, | ||
body.dark-mode h3, | ||
body.dark-mode h4, | ||
body.dark-mode h5, | ||
body.dark-mode h6 { | ||
color: #ffffff; /* White headings */ | ||
} | ||
|
||
body.dark-mode a { | ||
color: #4da8da; /* Light blue links */ | ||
} | ||
|
||
body.dark-mode a:hover { | ||
color: #66b3ff; /* Lighter blue on hover */ | ||
} | ||
|
||
body.dark-mode pre { | ||
background-color: #2b2b2b; /* Dark code background */ | ||
color: #e0e0e0; /* Light code text */ | ||
border: 1px solid #3c3c3c; | ||
} | ||
|
||
/* Optional: Style the toggle button */ | ||
button { | ||
padding: 8px 16px; | ||
background-color: #4da8da; | ||
color: white; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
} | ||
|
||
button:hover { | ||
background-color: #66b3ff; | ||
} | ||
|
||
body.dark-mode button { | ||
background-color: #2b2b2b; | ||
color: #e0e0e0; | ||
} | ||
|
||
body.dark-mode button:hover { | ||
background-color: #3c3c3c; | ||
} | ||
|
||
/* Ensure proper layout in wy-breadcrumbs */ | ||
.wy-breadcrumbs { | ||
position: relative; | ||
padding: 0 10px; | ||
overflow: hidden; /* Contain floated elements */ | ||
white-space: nowrap; /* Prevent wrapping */ | ||
} | ||
|
||
/* Style <li> elements to stay inline */ | ||
.wy-breadcrumbs li { | ||
display: inline-block; | ||
margin-right: 5px; | ||
vertical-align: middle; /* Align breadcrumb items */ | ||
} | ||
|
||
/* Style wy-breadcrumbs-aside to keep "View page source" on the right */ | ||
.wy-breadcrumbs-aside { | ||
float: right; /* Matches theme's default behavior */ | ||
display: inline-block; | ||
margin-left: 10px; /* Space from button */ | ||
} | ||
|
||
/* Ensure "View page source" aligns properly */ | ||
.wy-breadcrumbs-aside a { | ||
display: inline-block; | ||
vertical-align: middle; | ||
} | ||
|
||
/* Style the button directly in wy-breadcrumbs to stay on the right */ | ||
.wy-breadcrumbs button { | ||
float: right; /* Pin to the right */ | ||
margin-left: 10px; /* Space from breadcrumb text */ | ||
margin-right: 10px; /* Space before "View page source" */ | ||
vertical-align: middle; /* Align with other items */ | ||
} | ||
|
||
/* Keep <a class="icon icon-home">GhostBSD</a> white in both modes */ | ||
.wy-side-nav-search .icon.icon-home:not([aria-label="Home"]) { | ||
color: #ffffff; /* White in light mode */ | ||
} | ||
|
||
body.dark-mode .wy-side-nav-search .icon.icon-home:not([aria-label="Home"]) { | ||
color: #ffffff; /* White in dark mode */ | ||
} | ||
|
||
/* Fix white background of .toctree-l1.current in dark mode */ | ||
body.dark-mode .wy-menu-vertical .toctree-l1.current { | ||
background-color: #3c3c3c; /* Slightly lighter than sidebar */ | ||
} | ||
|
||
/* Darken background of <a class="reference internal current"> in dark mode */ | ||
body.dark-mode .wy-menu-vertical a.reference.internal.current { | ||
background-color: #333333; /* Darker than #3c3c3c */ | ||
} | ||
|
||
/* Ensure .toctree-l2 <a> fills the li and darkens on hover */ | ||
.wy-menu-vertical .toctree-l2 a { | ||
display: block; /* Ensure it fills the li */ | ||
} | ||
|
||
body.dark-mode .wy-menu-vertical .toctree-l2 a:hover { | ||
background-color: #2a2a2a !important; /* Darker than #3c3c3c, override all */ | ||
} | ||
|
||
/* Ensure <a> in sidebar fills its parent <li> */ | ||
.wy-menu-vertical .toctree-l1 a { | ||
display: block; /* Ensure it fills the li */ | ||
} | ||
|
||
/* Ensure <a> in toctree-l3 fills its parent <li> */ | ||
.wy-menu-vertical .toctree-l3 a { | ||
display: block; /* Ensure it fills the li */ | ||
} | ||
|
||
/* Darken <a href="#"> inside .toctree-l1.current[aria-expanded="true"] at all times */ | ||
body.dark-mode .wy-menu-vertical .toctree-l1.current[aria-expanded="true"] a[href="#"] { | ||
background-color: #2b2b2b; /* Darker than #3c3c3c, constant background */ | ||
} | ||
|
||
/* Highly specific override for .toctree-l2.current in dark mode */ | ||
body.dark-mode .wy-nav-side .wy-menu.wy-menu-vertical ul li.current.toctree-l2 { | ||
background-color: #3c3c3c !important; /* Reordered classes for specificity */ | ||
} | ||
|
||
/* Ensure li.toctree-l2.current has the correct background in dark mode */ | ||
body.dark-mode .wy-menu-vertical li.toctree-l2.current { | ||
background-color: #3c3c3c !important; | ||
} | ||
|
||
/* Ensure the <a> inside li.toctree-l2.current does not override the background */ | ||
body.dark-mode .wy-menu-vertical li.toctree-l2.current a { | ||
background-color: transparent !important; | ||
} | ||
|
||
/* Ensure nested <ul> inside li.toctree-l2.current does not override the background */ | ||
body.dark-mode .wy-menu-vertical li.toctree-l2.current ul { | ||
background-color: transparent !important; | ||
} | ||
|
||
/* Ensure hover effect for toctree-l3 links in dark mode */ | ||
body.dark-mode .wy-nav-side .wy-menu.wy-menu-vertical li.toctree-l3 a:hover { | ||
background-color: #2a2a2a !important; /* Darker than #3c3c3c, override all */ | ||
} | ||
|
||
/* Prevent parent li.toctree-l3 from interfering with hover effect */ | ||
body.dark-mode .wy-menu-vertical li.toctree-l3:hover { | ||
background-color: transparent !important; | ||
} | ||
|
||
/* Ensure li.toctree-l3.current has the correct background in dark mode */ | ||
body.dark-mode .wy-menu-vertical li.toctree-l3.current { | ||
background-color: #3c3c3c !important; /* Matches toctree-l2.current */ | ||
} | ||
|
||
/* Ensure the <a> inside li.toctree-l3.current does not override the background */ | ||
body.dark-mode .wy-menu-vertical li.toctree-l3.current a { | ||
background-color: transparent !important; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
document.addEventListener('DOMContentLoaded', function () { | ||
const breadcrumbs = document.querySelector('.wy-breadcrumbs'); | ||
if (!breadcrumbs) { | ||
console.error('Breadcrumbs element (.wy-breadcrumbs) not found!'); | ||
return; | ||
} | ||
|
||
const toggleButton = document.createElement('button'); | ||
toggleButton.style.marginLeft = '20px'; | ||
|
||
function updateButtonText() { | ||
toggleButton.textContent = document.body.classList.contains('dark-mode') ? 'Light Mode' : 'Dark Mode'; | ||
} | ||
ericbsd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
breadcrumbs.appendChild(toggleButton); | ||
|
||
const prefersDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches; | ||
const savedPreference = localStorage.getItem('darkMode'); | ||
|
||
if (savedPreference !== null) { | ||
if (savedPreference === 'true') { | ||
document.body.classList.add('dark-mode'); | ||
} else { | ||
document.body.classList.remove('dark-mode'); | ||
} | ||
} else if (prefersDarkMode) { | ||
document.body.classList.add('dark-mode'); | ||
} | ||
|
||
updateButtonText(); | ||
|
||
toggleButton.addEventListener('click', function () { | ||
document.body.classList.toggle('dark-mode'); | ||
localStorage.setItem('darkMode', document.body.classList.contains('dark-mode')); | ||
updateButtonText(); | ||
}); | ||
|
||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => { | ||
if (localStorage.getItem('darkMode') === null) { | ||
document.body.classList.toggle('dark-mode', e.matches); | ||
updateButtonText(); | ||
} | ||
}); | ||
}); |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.