-
Notifications
You must be signed in to change notification settings - Fork 129
Fixes #701 - Unify and fix code blocks and add copy button #703
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
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
76da03b
WIP; initial changes to create PR
ralf401 7e4f892
feat: Add copy button extension and adjust a couple of code block exa…
dvuckovic d787596
Revert "WIP; initial changes to create PR"
ralf401 a2c1724
First rails console changes
ralf401 2c2f241
revert: Switch back to sudo form.
dvuckovic 2598695
Edited Appendix and API
ralf401 f6facc3
Edited 'Getting Started
ralf401 394267d
Edited getting started
ralf401 0e8f692
Install Elasticsearch
ralf401 1ee88f3
Manage services; firewall
ralf401 9952cda
Updating Zammad
ralf401 50c368d
Migration: Freshdesk & Kayako
ralf401 6f914f4
Migrate: OTRS
ralf401 1a70378
Migrate: Zendesk
ralf401 69d1e27
Prerequisites
ralf401 2c6d219
Separated remaining multi-command code-blocks
ralf401 7759f01
fix: Reconcile overflow and copy button.
dvuckovic 6c7f769
Added missing prefix, separated code block
ralf401 bcd4773
Removed confusing/broken hint box about Docker on Mac and Windows
ralf401 5b3b38a
Separated code blocks, tweaks
ralf401 b12b744
Fixes/tweaks
ralf401 c70e29a
Fixes/tweaks
ralf401 aaf7074
Changes based on review
ralf401 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,30 @@ | ||
| /* Custom overrides */ | ||
| // No oversized <pre>, please - Thanks to @TJemxx | ||
| function collapseLongCodeBlocks() { | ||
| const maxHeight = 250; | ||
|
|
||
| document.querySelectorAll('pre').forEach((el, i) => { | ||
| if (el.clientHeight <= maxHeight) return; | ||
|
|
||
| el.classList.add('collapsing-code-block'); | ||
| if (el.querySelector(`.collapsing-code-block__toggle`)) return; | ||
|
|
||
| const button = document.createElement('button'); | ||
| button.classList.add('collapsing-code-block__toggle'); | ||
| button.onclick = (event) => { | ||
| event.target.parentElement.classList.toggle('collapsing-code-block--open') | ||
| }; | ||
| el.appendChild(button); | ||
| }); | ||
| } | ||
|
|
||
| window.addEventListener('load', () => { | ||
| collapseLongCodeBlocks(); | ||
|
|
||
| // click any <a data-tab="..."></a> link | ||
| // to manually re-compute if any code blocks need to be collapsed | ||
| document.querySelectorAll('a').forEach((el) => { | ||
| if ('tab' in el.dataset) el.onclick = collapseLongCodeBlocks; | ||
| }); | ||
| }, false); | ||
| /* Custom overrides */ | ||
| // No oversized <pre>, please - Thanks to @TJemxx | ||
| function collapseLongCodeBlocks() { | ||
| const maxHeight = 250; | ||
|
|
||
| document.querySelectorAll('pre').forEach((el, i) => { | ||
| if (el.clientHeight <= maxHeight) return; | ||
|
|
||
| el.classList.add('collapsing-code-block'); | ||
| if (el.querySelector(`.collapsing-code-toggle`)) return; | ||
|
|
||
| const button = document.createElement('button'); | ||
| button.classList.add('collapsing-code-toggle'); | ||
| button.onclick = (event) => { | ||
| console.debug('onclick', event.target) | ||
| event.target.parentElement.querySelector('.collapsing-code-block').classList.toggle('collapsing-code-block--open') | ||
| }; | ||
| el.parentElement.appendChild(button); | ||
| }); | ||
| } | ||
|
|
||
| window.addEventListener('load', () => { | ||
| collapseLongCodeBlocks(); | ||
|
|
||
| // click any <a data-tab="..."></a> link | ||
| // to manually re-compute if any code blocks need to be collapsed | ||
| document.querySelectorAll('a').forEach((el) => { | ||
| if ('tab' in el.dataset) el.onclick = collapseLongCodeBlocks; | ||
| }); | ||
| }, false); |
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 |
|---|---|---|
| @@ -1,7 +1,11 @@ | ||
| .. code-block:: sh | ||
| Package installation: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| # package installation | ||
| $ zammad run rails c | ||
|
|
||
| # source installation | ||
| Source installation: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ rails c |
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
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.
Uh oh!
There was an error while loading. Please reload this page.