Skip to content

Conversation

@pdmosses
Copy link
Contributor

@pdmosses pdmosses commented Oct 24, 2020

This PR implements support for common callouts, which is suggested as an enhancement in #171.

To use a callout, you need to configure its name, title (optional), and color, e.g.:

callouts:
  highlight:
    color: yellow
    opacity: 0.5
  important:
    title: Important
    color: green
  note:
    title: Note
    color: blue

You can then use a kramdown block IAL to apply it to a single paragraph:

{: .highlight }
A paragraph

Screenshot of highlight

With the dark color scheme it looks like this:

Screenshot 2020-10-24 at 13 36 10

{: .note }
A paragraph

Screenshot of note

You need to use a block quote to group larger content in a single callout:

{: .important }
> A paragraph
>
> Another paragraph
>
> The last paragraph

Screenshot of important

The styling of the callouts uses code provided by @bradleybensmith

Suggestions for improvement are welcome!

- Add various examples of callout configurations
- Add Liquid code for generating SCSS for each callout
- Add a test file for callouts
- Restrict callouts to paragraphs and blockquotes.
- Add `div.opaque` style.
- Revert default opacity to 0.2.
- Add a highlight callout.
- Update configuration and customization docs.
- Update styling tests..
- Remove outdated comments.
@pdmosses pdmosses linked an issue Oct 24, 2020 that may be closed by this pull request
- Add a `custom` callout using a new color `pink`.
- Update the docs for configuration and customization.
- Deliberately not abbreviating hex values `#ff99cc` and `#ff3399` here, so not identical to corresponding callout in `_config.yml`.
Implement enhancement suggested by @mattjlewis in just-the-docs#171
- Generate CSS for `.*-title` callouts
- Add examples of markup for title customisation
@inferno-chromium
Copy link

This will be great, look forward to this!

evelyne24 added a commit to evelyne24/system-design-checklist that referenced this pull request Jan 7, 2021
evelyne24 added a commit to evelyne24/system-design-checklist that referenced this pull request Jan 7, 2021
evelyne24 added a commit to evelyne24/system-design-checklist that referenced this pull request Jan 7, 2021
evelyne24 added a commit to evelyne24/system-design-checklist that referenced this pull request Jan 7, 2021
evelyne24 added a commit to evelyne24/system-design-checklist that referenced this pull request Jan 7, 2021
evelyne24 added a commit to evelyne24/system-design-checklist that referenced this pull request Jan 7, 2021
evelyne24 added a commit to evelyne24/system-design-checklist that referenced this pull request Jan 7, 2021
evelyne24 added a commit to evelyne24/system-design-checklist that referenced this pull request Jan 7, 2021
@jthrilly
Copy link

I'd also love to see this merged.

@pdmosses
Copy link
Contributor Author

pdmosses commented Feb 18, 2021

This PR currently adjusts the level of the callout colors for the dark color scheme, but not for other color schemes. To support callout level adjustment when using custom color schemes, a configuration variable callouts_level (values quiet or loud) will now be added.

The addition of the callouts_level option to this PR should not affect sites that are currently using the branch as a remote theme, since leaving it unset will produce the same results as before, for all color schemes.

- Add `callouts_opacity` configuration variable.
- Add `callouts_level` configuration variable.
- Allow `callouts_level: loud` for `light` and custom color schemes.
- Reorganise and update docs for callouts.
- Update `_config.yml` .
- Add `_config_dev.yml` for local serving with jekyll 4.2.
- Add `_config_tests.yml` for local testing.
- Improve the levels of pink.
@pdmosses
Copy link
Contributor Author

The configuration files for local testing have been updated, to avoid the need to edit _config.yml. For local development including the test pages, use:

bundle exec jekyll serve --config _config.yml,_config_dev.yml,_config_tests.yml

@stain
Copy link

stain commented Oct 7, 2021

Hi, we are also using this PR and worried about having to maintain our own fork (ResearchObject/ro-crate#141).

I see tests, documentations, configurations, examples, great job @pdmosses!

Would @pmarsceill detail what remains to fix to get it merged, and we can try to help out.

@p-bakker
Copy link

p-bakker commented Dec 9, 2021

@pdmosses what about a (configurable) icon on callouts?

Like a lightbulb icon on an Idea callout

Or should I handle that through css?

@ygo74
Copy link

ygo74 commented Feb 20, 2022

👍

mattxwang added a commit that referenced this pull request Jul 4, 2022
This PR combines (and resolves conflicts between) #448, #463, #466, #494, #495, #496, #498, and #572. 

The main aim is to facilitate use of several of the implemented features _together_, when using the fork as a remote theme. It should also simplify merging the included PRs into a future release.

The branch [combination-rec-nav](https://github.com/pdmosses/just-the-docs/tree/combination-rec-nav) adds [multi-level navigation](#462) and (NEW:) [sibling links](#394) to the branch used for this PR. It includes updated [documentation for the navigation structure](https://pdmosses.github.io/just-the-docs/docs/navigation-structure/), and reorganised and extended [navigation tests](https://pdmosses.github.io/just-the-docs/tests/navigation/). The documentation and the tests can be browsed at the (temporary) [website published from the combination-rec-nav branch](https://pdmosses.github.io/just-the-docs/).

_Caveat:_ The changes to v0.3.3 in this PR and #462 have not yet been reviewed or approved, and may need updating before merging into a release of the theme. If you use a branch from a PR as a remote theme, there is a risk of such updates affecting your website. Moreover, these branches are likely to be deleted after they have been merged. To avoid  such problems, you could copy the branch that you want to use to your own fork of the theme.

Co-authored-by: Matt Wang <[email protected]>
@mattxwang
Copy link
Member

Going to close as we've merged in #578; @pdmosses feel free to reopen if necessary!

@pdmosses
Copy link
Contributor Author

pdmosses commented Nov 3, 2022

As this PR was merged in pre-release v0.4.0.rc1, I'm deleting the PR branch. Let me know if you're still using it, and none of the pre-releases of v0.4.0 works for you.

@pdmosses pdmosses deleted the callouts branch November 3, 2022 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for common markdown callouts like NOTE, TIP, HINT

7 participants