Skip to content

Instantly share code, notes, and snippets.

@ciceronianus
Created March 4, 2021 16:20
Show Gist options
  • Save ciceronianus/57214d3b5a0401d92f4f82b29947ae9e to your computer and use it in GitHub Desktop.
Save ciceronianus/57214d3b5a0401d92f4f82b29947ae9e to your computer and use it in GitHub Desktop.
Roam-count-mentions (alpha)
/* Just a simple experiment :) */
/* Counts mentions of a page */
/* Syntax: Count:: {{[[mentions]]: [[Tweet]]}} */
[data-page-links*='\"Count\"'] > .rm-block-main
> .roam-block > span > .rm-reference-main {
display:inline-block;
}
[data-page-links*='\"Count\"'] > .rm-block-main
> .roam-block > span > .rm-reference-main .rm-reference-container
> .flex-h-box {
display: inline-block;
}
/*removes the main block */
[data-page-links*='\"Count\"'] > .rm-block-main
> .roam-block > span > .rm-reference-main > div
> .rm-reference-container > .rm-mentions {
display:none;
}
/* Removes unlinked references */
[data-page-links*='\"Count\"'] > .rm-block-main
> .roam-block > span > .rm-reference-main > div
> div:nth-child(2) {
display:none;
}
[data-page-links*='\"Count\"'] > .rm-block-main
> .roam-block > span > .rm-reference-main .rm-reference-container
> .flex-h-box
> :is(span, div){
display:none;
}
/* Linked references */
[data-page-links*='\"Count\"'] > .rm-block-main
> .roam-block > span > .rm-reference-main .rm-reference-container
> .flex-h-box
> div:nth-child(3) {
display: inline-block;
position: relative;
background-color: #f5d9d9;
border: #c47f7f solid 1px;
color: black !important;
border-radius: 4px;
padding-left: 5px;
padding-right: 5px;
left: 15px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment