include warning and some other stuff
This commit is contained in:
parent
7d534804e7
commit
b5de2ff8b1
8 changed files with 206 additions and 10 deletions
8
.obsidian/plugins/markdown-tags/main.js
vendored
Normal file
8
.obsidian/plugins/markdown-tags/main.js
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||
if you want to view the source, please visit the github repository of this plugin
|
||||
*/
|
||||
|
||||
var C=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var B=(t,e,o)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var F=(t,e)=>{for(var o in e)C(t,o,{get:e[o],enumerable:!0})},O=(t,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!A.call(t,s)&&s!==o&&C(t,s,{get:()=>e[s],enumerable:!(c=V(e,s))||c.enumerable});return t};var R=t=>O(C({},"__esModule",{value:!0}),t);var k=(t,e,o)=>(B(t,typeof e!="symbol"?e+"":e,o),o);var q={};F(q,{default:()=>w});module.exports=R(q);var S=require("obsidian"),f=require("@codemirror/view"),v=require("@codemirror/state");var W=["todo","planned","in-progress","doing","done","tip","on-hold","tbd","proposed","draft","wip","mvp","blocked","canceled","error","warning","warn"],P=["grey","green","yellow","orange","blue","purple","red"],H=/\(\(<?tag\|(?<label>[^)|]+)(?:\|(?<bgcolor>[^)|]*))?(?:\|(?<fgcolor>[^)|]*))?\)\)/g,$=t=>/^#([0-9A-Fa-f]{3}){1,2}$/.test(t),m=t=>$(t)||P.includes(t.toLowerCase()),D=t=>t.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]||e);function T(t,e,o,c=!1){let s=W.includes(t.toLowerCase())?t.toLowerCase():"",u=e&&P.includes(e.toLowerCase())?e.toLowerCase():"grey",a=e&&$(e)?e:null,d=o&&$(o)?o:null,p=`bn-tags ${s} ${u} ${c?"bn-arrow-tags":""}`.trim(),n=`${a?`background-color: ${a};`:""}${d?` color: ${d};`:""}`;return f.Decoration.mark({class:p,attributes:{style:n}})}var w=class extends S.Plugin{async onload(){this.registerEditorExtension(this.editModeTagsHighlighter()),this.registerMarkdownPostProcessor(this.viewModeTagsHighlighter())}editModeTagsHighlighter(){return f.ViewPlugin.fromClass(class{constructor(e){k(this,"decorations");this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged||e.selectionSet)&&(this.decorations=this.buildDecorations(e.view))}buildDecorations(e){var s,u;let o=new v.RangeSetBuilder,c=e.state.selection.main.head;for(let{from:a,to:d}of e.visibleRanges){let p=e.state.doc.sliceString(a,d),n,x=r=>{let g=e.state.doc.lineAt(r),i=!1;for(let l=1;l<=e.state.doc.lines;l++)if(e.state.doc.line(l).text.trim().startsWith("```")&&(i=!i),l===g.number)return i;return!1};for(;(n=H.exec(p))!==null;){let r=a+((s=n.index)!=null?s:0),g=r+n[0].length;if(c>=r&&c<=g||x(r))continue;let{label:i="",bgcolor:l="",fgcolor:h=""}=(u=n.groups)!=null?u:{},M=D(i),b=l&&m(l)?l:"",L=h&&m(h)?h:"",y=n[0].startsWith("((<");o.add(r,r+n[0].indexOf(i),f.Decoration.mark({class:"bn-hidden"})),o.add(r+n[0].indexOf(i),r+n[0].indexOf(i)+i.length,T(M,b,L,y)),o.add(r+n[0].indexOf(i)+i.length,g,f.Decoration.mark({class:"bn-hidden"}))}}return o.finish()}},{decorations:e=>e.decorations})}viewModeTagsHighlighter(){return(e,o)=>{Array.from(e.querySelectorAll("p, li, span, div")).forEach(s=>{var n;let u=s.textContent;if(!u)return;let a,d=s.innerHTML,p=!1;for(;(a=H.exec(u))!==null;){p=!0;let{label:x="",bgcolor:r="",fgcolor:g=""}=(n=a.groups)!=null?n:{},i=D(x),l=r&&m(r)?r:"",h=g&&m(g)?g:"",M=a[0].startsWith("((<"),b=T(i,l,h,M),L=`<span class="${b.spec.class}" style="${b.spec.attributes.style}">${i}</span>`,y=D(a[0]);d=d.replace(y,L)}p&&(s.innerHTML=d)})}}};
|
||||
|
||||
/* nosourcemap */
|
13
.obsidian/plugins/markdown-tags/manifest.json
vendored
Normal file
13
.obsidian/plugins/markdown-tags/manifest.json
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"id": "markdown-tags",
|
||||
"name": "Tags for Markdown",
|
||||
"version": "1.2.3",
|
||||
"minAppVersion": "0.12.0",
|
||||
"description": "Enhance your documents with custom tags. Use predefined or custom labels, customizable colors, and arrow indicators to visually track tasks and statuses.",
|
||||
"author": "John Smith III",
|
||||
"authorUrl": "https://binarynoir.tech",
|
||||
"fundingUrl": {
|
||||
"Buy Me a Coffee": "https://buymeacoffee.com/binarynoir"
|
||||
},
|
||||
"isDesktopOnly": false
|
||||
}
|
149
.obsidian/plugins/markdown-tags/styles.css
vendored
Normal file
149
.obsidian/plugins/markdown-tags/styles.css
vendored
Normal file
|
@ -0,0 +1,149 @@
|
|||
.bn-tags {
|
||||
display: inline-block;
|
||||
vertical-align: middle !important;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
border-radius: 15px;
|
||||
padding: 0 10px;
|
||||
color: white;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
||||
|
||||
&.bn-arrow-tags {
|
||||
all: unset;
|
||||
all: inherit;
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
/* left: 10px; */
|
||||
right: -6px;
|
||||
position: relative;
|
||||
margin: 0 8px 0 10px;
|
||||
padding: 0 10px 0 12px;
|
||||
border-bottom-left-radius: 2px;
|
||||
border-top-left-radius: 2px;
|
||||
border-bottom-right-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
||||
color: white !important;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
text-decoration: none;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
||||
-webkit-text-fill-color: #ffffff !important;
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -11px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: transparent;
|
||||
border-radius: 15%;
|
||||
border-style: solid;
|
||||
border-width: 10px 12px 10px 0;
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 7.5px;
|
||||
left: .5px;
|
||||
float: left;
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 50%;
|
||||
background: white;
|
||||
box-shadow: -1px -1px 2px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
&.todo,
|
||||
&.planned,
|
||||
&.grey {
|
||||
background-color: #6e6e6e;
|
||||
|
||||
&:before {
|
||||
border-right-color: #6e6e6e;
|
||||
}
|
||||
}
|
||||
|
||||
&.doing,
|
||||
&.in-progress,
|
||||
&.orange {
|
||||
background-color: #ff7f00;
|
||||
|
||||
&:before {
|
||||
border-right-color: #ff7f00;
|
||||
}
|
||||
}
|
||||
|
||||
&.done,
|
||||
&.tip,
|
||||
&.green {
|
||||
background-color: #42b983;
|
||||
|
||||
&:before {
|
||||
border-right-color: #42b983;
|
||||
}
|
||||
}
|
||||
|
||||
&.on-hold,
|
||||
&.tbd,
|
||||
&.wip,
|
||||
&.proposed,
|
||||
&.draft,
|
||||
&.blue {
|
||||
background-color: #7aa0dd;
|
||||
|
||||
&:before {
|
||||
border-right-color: #7aa0dd;
|
||||
}
|
||||
}
|
||||
|
||||
&.mvp,
|
||||
&.purple {
|
||||
background-color: #7a5add;
|
||||
|
||||
&:before {
|
||||
border-right-color: #7a5add;
|
||||
}
|
||||
}
|
||||
|
||||
&.warn,
|
||||
&.warning,
|
||||
&.yellow {
|
||||
background-color: #e7c000;
|
||||
|
||||
&:before {
|
||||
border-right-color: #e7c000;
|
||||
}
|
||||
}
|
||||
|
||||
&.tbd,
|
||||
&.mvp,
|
||||
&.wip,
|
||||
&.draft {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
&.blocked,
|
||||
&.canceled,
|
||||
&.error,
|
||||
&.red {
|
||||
background-color: #da5961;
|
||||
|
||||
&:before {
|
||||
border-right-color: #da5961;
|
||||
}
|
||||
}
|
||||
|
||||
& + & {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
.bn-hidden {
|
||||
display: none;
|
||||
}
|
23
.obsidian/workspace.json
vendored
23
.obsidian/workspace.json
vendored
|
@ -48,9 +48,23 @@
|
|||
"icon": "lucide-file",
|
||||
"title": "README"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "61305ec449b9cef0",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "split-diff-view",
|
||||
"state": {
|
||||
"aFile": ".obsidian/plugins/markdown-tags/main.js",
|
||||
"bFile": ".obsidian/plugins/markdown-tags/main.js",
|
||||
"aRef": ""
|
||||
},
|
||||
"icon": "diff",
|
||||
"title": "Diff: main.js"
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 2
|
||||
"currentTab": 3
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
|
@ -208,12 +222,13 @@
|
|||
"obsidian-git:Open Git source control": false
|
||||
}
|
||||
},
|
||||
"active": "19771929f635aa5d",
|
||||
"active": "61305ec449b9cef0",
|
||||
"lastOpenFiles": [
|
||||
"Existing Projects.md",
|
||||
"Common Keywords & Other.md",
|
||||
"README.md",
|
||||
"mitm/Instructions.md",
|
||||
"Sources.md",
|
||||
"Common Keywords.md",
|
||||
"README.md",
|
||||
"mitm"
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue