Add admonition boxes for tips, notes, warnings.#29
Merged
Conversation
This is an optional way to develop. Nix is not required to work on this. However, it adds a nice peace of mind if using nix that the version of mdbook is always the same across development environments, pinned to an exact commit of the nix pkg repository.
This was made by initiating a fresh theme using mdbook 0.5.0 (mdbook init --theme) and then porting our major theme changes (notably colour scheme and some head tags) from our original theme over to this one.
This makes a few changes so that we can have the newest sidebar, with its folded sections, but also include our logo in the top left. Used this issue as a guide: rust-lang/mdBook#2490 I also added a custom.css so that we could keep the html succinct, moving the styling to our own CSS file.
The way the TOC is generated, if you just adjust the innerhtml, it upsets the procedure for the TOC stack and ends up lacing the active section above the logo, making it look bad. This new method, supplied by maintainer of mdbook, properly prepends the logo above the TOC after it has already been generated.
I am using the variable pattern of the other themes in mdbook, and used two colours present in the loomio app itself, to best match the current theme. Note is the same colour as the "new" indicator in loomio and "tip" is the brass orange of the notification badge and various buttons across the app.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
NOTE! This pr builds off #27 . #27 should be reviewed first. If it is not merged, then this pr can be closed.
This adds a consistent way to indicate tips and notes throughout the docs, using the admonition syntax available in mdbook v0.5+.
Currently, notes and tips are indicated in a few different ways...sometimes as bullet points, sometimes as bolded text,a nd sometimes within quotes. I streamlined them to all use the admonition syntax.
I also added colours for the admonitions, using colours present in the Loomio app. I am not attached to my choices here and happy to use different ones. Is there a theme palette I should be checking for any stuff like this?
The admonition syntax also has notice boxes for "Important" and "Caution". We haven't used either term really in the docs, and so I didn't add theme colours for these. I figured we could decide a colour if and when we decide to use either of them.