-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Change mdbook setup #8816
Merged
Merged
Change mdbook setup #8816
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
df7098e
Move draw.io folder to assets and remove readme
wmontwe bcf3846
Change mdbook config to use a theme directory and move theme assets t…
wmontwe 06c67d9
Add last-changed and pagetoc preprocessors and add the editing link
wmontwe a6b9562
Add install script
wmontwe 4025eec
Fix markdown issues
wmontwe 1ab8188
Change the navigation to sort ADRs by state and add sections
wmontwe 8c23817
Add workflow to deploy the documentation
wmontwe 0336beb
Update how to document
wmontwe 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 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,66 @@ | ||
name: Deploy docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'docs/**' | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
||
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | ||
with: | ||
path: | | ||
~/.cargo/.crates.toml | ||
~/.cargo/.crates2.toml | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Install mdbook and extensions | ||
run: ./docs/install.sh | ||
|
||
- name: Setup Pages | ||
id: pages | ||
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | ||
|
||
- name: Build docs | ||
run: mdbook build docs --dest-dir=book/docs/latest | ||
|
||
- name: Test docs | ||
run: mdbook test docs | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 | ||
with: | ||
path: ./book/docs | ||
|
||
deploy-docs: | ||
environment: | ||
name: pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build-docs | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |
This file contains 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 |
---|---|---|
|
@@ -5,6 +5,9 @@ local.properties | |
# Kotlin | ||
.kotlin/ | ||
|
||
# mdBook | ||
book/ | ||
|
||
# Generated folders | ||
bin/ | ||
build/ | ||
|
This file contains 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,3 @@ | ||
# About Thunderbird for Android | ||
|
||
This document provides an overview of the Thunderbird for Android project. | ||
This file contains 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 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 |
---|---|---|
@@ -1,16 +1,26 @@ | ||
# Summary | ||
|
||
[Thunderbird for Android](README.md) | ||
|
||
--- | ||
|
||
- [Contributing](CONTRIBUTING.md) | ||
- [Design](DESIGN.md) | ||
- [Releasing](RELEASING.md) | ||
- [Translations](translations.md) | ||
- [Java to Kotlin Conversion Guide](contributing/java-to-kotlin-conversion-guide.md) | ||
- [Architecture Decision Records](architecture/adr/README.md) | ||
- [0001 - Switch From Java to Kotlin](architecture/adr/0001-switch-from-java-to-kotlin.md) | ||
- [0002 - UI - Wrap Material Components in Atomic Design System](architecture/adr/0002-ui-wrap-material-components-in-atomic-design-system.md) | ||
- [0003 - Test - Switch Test Assertions From Truth to Assertk](architecture/adr/0003-switch-test-assertions-from-truth-to-assertk.md) | ||
- [0004 - Naming Conventions for Interfaces and Their Implementations](architecture/adr/0004-naming-conventions-for-interfaces-and-their-implementations.md) | ||
- [0005 - Central Project Configuration](architecture/adr/0005-central-project-configuration.md) | ||
- [0006 - White Label Architecture](architecture/adr/0006-white-label-architecture.md) | ||
- [0007 - Project Structure](architecture/adr/0007-project-structure.md) | ||
- [Add Documentation](add-documentation.md) | ||
- [Accepted]() | ||
- [0001 - Switch From Java to Kotlin](architecture/adr/0001-switch-from-java-to-kotlin.md) | ||
- [0002 - UI - Wrap Material Components in Atomic Design System](architecture/adr/0002-ui-wrap-material-components-in-atomic-design-system.md) | ||
- [0003 - Test - Switch Test Assertions From Truth to Assertk](architecture/adr/0003-switch-test-assertions-from-truth-to-assertk.md) | ||
- [0004 - Naming Conventions for Interfaces and Their Implementations](architecture/adr/0004-naming-conventions-for-interfaces-and-their-implementations.md) | ||
- [0005 - Central Project Configuration](architecture/adr/0005-central-project-configuration.md) | ||
- [0006 - White Label Architecture](architecture/adr/0006-white-label-architecture.md) | ||
- [0007 - Project Structure](architecture/adr/0007-project-structure.md) | ||
- [Proposed]() | ||
- [Rejected]() | ||
|
||
--- | ||
|
||
[How to Document](how-to-document.md) |
This file was deleted.
Oops, something went wrong.
This file contains 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.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,6 @@ | ||
footer { | ||
font-size: 0.8em; | ||
text-align: center; | ||
border-top: 1px solid var(--fg); | ||
padding: 5px 0; | ||
} |
This file contains 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,35 @@ | ||
(() => { | ||
const darkThemes = ['ayu', 'navy', 'coal']; | ||
const lightThemes = ['light', 'rust']; | ||
|
||
const classList = document.getElementsByTagName('html')[0].classList; | ||
|
||
let lastThemeWasLight = true; | ||
for (const cssClass of classList) { | ||
if (darkThemes.includes(cssClass)) { | ||
lastThemeWasLight = false; | ||
break; | ||
} | ||
} | ||
|
||
const theme = lastThemeWasLight ? 'default' : 'dark'; | ||
mermaid.initialize({ startOnLoad: true, theme }); | ||
|
||
// Simplest way to make mermaid re-render the diagrams in the new theme is via refreshing the page | ||
|
||
for (const darkTheme of darkThemes) { | ||
document.getElementById(darkTheme).addEventListener('click', () => { | ||
if (lastThemeWasLight) { | ||
window.location.reload(); | ||
} | ||
}); | ||
} | ||
|
||
for (const lightTheme of lightThemes) { | ||
document.getElementById(lightTheme).addEventListener('click', () => { | ||
if (!lastThemeWasLight) { | ||
window.location.reload(); | ||
} | ||
}); | ||
} | ||
})(); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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,14 @@ | ||
.sidebar-scrollbox .section a[href*="adr"] strong { | ||
display: none; | ||
} | ||
|
||
.sidebar-scrollbox .section a[href*="adr"] .number { | ||
font-weight: 550; | ||
} | ||
|
||
.chapter li .chapter-item div { | ||
display: block; | ||
padding: 0; | ||
text-decoration: none; | ||
color: var(--sidebar-fg); | ||
} |
This file contains 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,18 @@ | ||
document.querySelectorAll('.sidebar-scrollbox .section a[href*="adr"]').forEach(el => { | ||
let textNodes = [...el.childNodes].filter(node => node.nodeType === Node.TEXT_NODE && node.nodeValue.trim().length > 0); | ||
|
||
if (textNodes.length > 0) { | ||
let textNode = textNodes[0]; // First text node (ignoring elements like <strong>) | ||
let text = textNode.nodeValue.trim(); | ||
|
||
if (text.length >= 4) { | ||
let span = document.createElement("span"); | ||
span.classList.add("number"); | ||
span.textContent = text.substring(0, 4); | ||
|
||
textNode.nodeValue = text.substring(4); // Remove first 4 chars from original text node | ||
|
||
el.insertBefore(span, textNode); // Insert the styled first 4 characters before the rest | ||
} | ||
} | ||
}); |
This file contains 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,61 @@ | ||
a[class^='pagetoc-H']:only-child { | ||
display: none; | ||
} | ||
|
||
@media only screen and (max-width:1439px) { | ||
.sidetoc { | ||
display: none; | ||
} | ||
} | ||
|
||
@media only screen and (min-width:1440px) { | ||
main { | ||
position: relative; | ||
} | ||
.sidetoc { | ||
margin-left: auto; | ||
margin-right: auto; | ||
left: calc(100% + (var(--content-max-width))/4 - 140px); | ||
position: absolute; | ||
} | ||
.pagetoc { | ||
position: fixed; | ||
width: 200px; | ||
height: calc(100vh - var(--menu-bar-height) - 0.67em * 4); | ||
overflow: auto; | ||
} | ||
.pagetoc a { | ||
border-left: 1px solid var(--sidebar-bg); | ||
color: var(--fg) !important; | ||
display: block; | ||
padding-bottom: 5px; | ||
padding-top: 5px; | ||
padding-left: 10px; | ||
text-align: left; | ||
text-decoration: none; | ||
} | ||
.pagetoc a:hover, | ||
.pagetoc a.active { | ||
background: var(--sidebar-bg); | ||
color: var(--sidebar-fg) !important; | ||
} | ||
.pagetoc .active { | ||
background: var(--sidebar-bg); | ||
color: var(--sidebar-fg); | ||
} | ||
.pagetoc .pagetoc-H2 { | ||
padding-left: 20px; | ||
} | ||
.pagetoc .pagetoc-H3 { | ||
padding-left: 40px; | ||
} | ||
.pagetoc .pagetoc-H4 { | ||
padding-left: 60px; | ||
} | ||
.pagetoc .pagetoc-H5 { | ||
display: none; | ||
} | ||
.pagetoc .pagetoc-H6 { | ||
display: none; | ||
} | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might make sense to add link to the generated docs here, for people browsing the folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this file relate to SUMMARY.md. Do we need both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SUMMARY.md is used to define the navigation within the docs.
The README.md is empty at the moment, but it should be extended to give developers and contributors a quick overview of the docs content. I thought about the same approach as: https://developer.thunderbird.net/