OcttKB Cross-Repo Sync (HTML to Raw)

This commit is contained in:
2023-06-11 19:17:13 +00:00
parent 5a5714ff49
commit 3f7aec7f5b
1575 changed files with 4 additions and 28509 deletions

View File

@ -1,22 +0,0 @@
MIT License
Copyright (c) 2023 Gk0Wk(nmg_wk@yeah.net)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,2 +0,0 @@
title: $:/plugins/Gk0Wk/echarts/LICENSE
type: text/plain

View File

@ -1,6 +0,0 @@
caption: Add a new Graph Chart, "levels" (default to 1) controls how many levels will it reach from "focussedTiddler" (default to $:/temp/focussedTiddler); "graphTitle" decided the title of the chart
tags: $:/tags/TextEditor/Snippet
title: $:/plugins/Gk0Wk/echarts/Snippets/TheBrain
type: text/vnd.tiddlywiki
<$echarts $tiddler="$:/plugins/Gk0Wk/echarts/addons/TheBrain.js" aliasField="caption" levels=2 focussedTiddler="Index" graphTitle="Graph" />

View File

@ -1,10 +0,0 @@
[
{
"title": "$:/plugins/Gk0Wk/echarts/addons/GitHubHeatMap.js",
"text": "\"use strict\";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__copyProps=(t,r,a,o)=>{if(r&&\"object\"==typeof r||\"function\"==typeof r)for(let e of __getOwnPropNames(r))__hasOwnProp.call(t,e)||e===a||__defProp(t,e,{get:()=>r[e],enumerable:!(o=__getOwnPropDesc(r,e))||o.enumerable});return t},__toESM=(e,t,r)=>(r=null!=e?__create(__getProtoOf(e)):{},__copyProps(!t&&e&&e.__esModule?r:__defProp(r,\"default\",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(__defProp({},\"__esModule\",{value:!0}),e),GitHubHeatMap_exports={},ECharts=(__export(GitHubHeatMap_exports,{\"default\":()=>GitHubHeatMap_default}),module.exports=__toCommonJS(GitHubHeatMap_exports),__toESM(require(\"$:/plugins/Gk0Wk/echarts/echarts.min.js\"))),getFilterByDate=(e,t)=>`[all[tiddlers]sameday:created[${e}]][all[tiddlers]sameday:modified[${e}]] +${t} +[sort[]]`,yearDates=new Map,dayTime=864e5,getData=(t,a)=>{if(!yearDates.has(t)){var r=ECharts.number.parseDate(t+\"-01-01\").getTime(),o=ECharts.number.parseDate(t+1+\"-01-01\").getTime(),l=[];for(let e=r;e<o;e+=dayTime){var i=ECharts.format.formatTime(\"yyyy-MM-dd\",e),d=i.replace(/-/g,\"\");l.push([i,d])}yearDates.set(t,l)}let n=0;return[yearDates.get(t).map(([e,t])=>{var r=$tw.wiki.filterTiddlers(getFilterByDate(t,a)).length;return n+=r,[e,r]}),n]},getPlatteColor=e=>$tw.wiki.renderText(\"text/plain\",\"text/vnd.tiddlywiki\",`<$transclude tiddler={{$:/palette}} index=\"${e}\"><$transclude tiddler=\"$:/palettes/Vanilla\" index=\"${e}\"><$transclude tiddler=\"$:/config/DefaultColourMappings/${e}\"/></$transclude></$transclude>`,{}),checkIfChinese=()=>{var e;return!0===(null==(e=$tw.wiki.getTiddlerText(\"$:/language\"))?void 0:e.includes(\"zh\"))},checkIfDarkMode=()=>{var e;return\"dark\"===(null==(e=null==(e=$tw.wiki.getTiddler($tw.wiki.getTiddlerText(\"$:/palette\")))?void 0:e.fields)?void 0:e[\"color-scheme\"])},GitHubHeatMapAddon={shouldUpdate:(e,t)=>0<$tw.utils.count(t),onUpdate:(e,t,r)=>{var a=parseInt(r.year,10)||(new Date).getFullYear();const p=r.subfilter||\"[!is[shadow]!prefix[$:/]]\";var[o,l]=getData(a,p);let i=\"\",d=0,n;e.setOption({title:{top:0,left:\"center\",text:checkIfChinese()?`今年产出 ${l} 篇文章`:`Produced ${l} tiddlers this year`},tooltip:{position:\"top\",formatter:({value:[e,t]})=>(e===i&&t===d&&n||(n=((e,t)=>{if(0===t)return checkIfChinese()?ECharts.format.formatTime(\"yyyy年M月d日\",e)+\" 无条目。\":$tw.utils.formatDateString($tw.utils.parseDate(e.replace(/-/g,\"\")),\"MMM DDD, YYYY\")+\" no tiddler.\";var r=$tw.utils.domMaker(\"p\",{text:checkIfChinese()?ECharts.format.formatTime(\"yyyy年M月d日\",e)+` 共有 ${t} 篇:`:$tw.utils.formatDateString($tw.utils.parseDate(e.replace(/-/g,\"\")),\"MMM DDD, YYYY\")+` ${t} tiddler${1<t?\"s\":\"\"}.`}),a=$tw.utils.domMaker(\"ul\",{}),o=$tw.wiki.filterTiddlers(getFilterByDate(e.replace(/-/g,\"\"),p)),l=o.length;for(let n=0;n<l;n++){const s=o[n];var i=$tw.utils.domMaker(\"li\",{}),d=$tw.utils.domMaker(\"a\",{text:s,\"class\":\"tc-tiddlylink tc-tiddlylink-resolves tc-popup-handle tc-popup-absolute\",style:{cursor:\"pointer\"}});d.addEventListener(\"click\",()=>(new $tw.Story).navigateTiddler(s)),i.appendChild(d),a.appendChild(i)}return[r,a]})(e,t),i=e,d=t),n),triggerOn:\"mousemove|click\",enterable:!0,hideDelay:800,backgroundColor:getPlatteColor(\"page-background\"),borderColor:getPlatteColor(\"very-muted-foreground\")},visualMap:{type:\"piecewise\",orient:\"horizontal\",calculable:!0,showLabel:!1,right:0,top:175,pieces:[{lte:0,color:checkIfDarkMode()?\"#161B22\":\"#EBEDF0\"},{gt:0,lte:3,color:\"#0E4429\"},{gt:3,lte:7,color:\"#006D32\"},{gt:7,lte:15,color:\"#26A641\"},{gt:15,color:\"#39D353\"}]},calendar:{top:60,left:0,right:0,cellSize:15,orient:\"horizontal\",range:a,itemStyle:{borderWidth:3,borderCap:\"round\",borderJoin:\"round\",borderColor:getPlatteColor(\"background\")},splitLine:{show:!1},dayLabel:{show:!0,nameMap:checkIfChinese()?\"ZH\":\"EN\"},monthLabel:{show:!0,nameMap:checkIfChinese()?\"ZH\":\"EN\"},yearLabel:{show:!0,position:\"bottom\",margin:12,verticalAlign:\"top\"}},series:{type:\"heatmap\",coordinateSystem:\"calendar\",calendarIndex:0,data:o}})}},GitHubHeatMap_default=GitHubHeatMapAddon;",
"Modern.TiddlyDev#IncludeSource": "true",
"Modern.TiddlyDev#Origin": "addons/Gk0Wk/GitHubHeatMap.ts",
"module-type": "echarts-component",
"type": "application/javascript"
}
]

File diff suppressed because one or more lines are too long

View File

@ -1,58 +0,0 @@
title: $:/plugins/Gk0Wk/echarts/addons/PluginsSize
type: text/vnd.tiddlywiki
`{
"tooltip": {
"trigger": "item"
},
"series": [
{
"type": "treemap",
"visibleMin": 300,
"name": "Plugin Size",
"leafDepth": 1,
"data": [
`
<$list filter="[!plugin-type[]!title[$:/core]!title[$:/temp/info-plugin]]" variable="pluginName" counter="counter1">
` {
"name": "`<$list filter="[<pluginName>has[name]]"><$text text={{{ [<pluginName>get[name]] }}}/></$list><$list filter="[<pluginName>!has[name]]"><$text text={{{ [<pluginName>has[name]else<pluginName>split[/]nth[4]] }}}/></$list>`",
"value": `<$text text={{{ [<pluginName>get[text]length[]else[0]] }}}/>`,
"children": [
`
<$list filter="[<pluginName>plugintiddlers[]]" variable="pluginShadow" counter="counter2">
` {
"name": "`<$text text={{{ [<pluginShadow>removeprefix<pluginName>removeprefix[/]else<pluginShadow>] }}}/>`",
"value": `<$text text={{{ [<pluginShadow>get[text]length[]else[0]] }}}/>`
}`<$list filter="[<counter2-last>match[no]]">`,`</$list>`
`
</$list>
` ]
}`<$list filter="[<counter1-last>match[no]]">`,`</$list>`
`
</$list>
`
],
"levels": [
{
"itemStyle": {
"borderColor": "#555",
"borderWidth": 4,
"gapWidth": 4
}
},
{
"colorSaturation": [0.3, 0.6],
"itemStyle": {
"borderColorSaturation": 0.7,
"gapWidth": 2,
"borderWidth": 2
}
}
],
"upperLabel": {
"show": true,
"height": 30
}
}
]
}`

View File

@ -1,19 +0,0 @@
{
"xAxis": {
"type": "category",
"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
},
"yAxis": {
"type": "value"
},
"series": [
{
"data": [120, 200, 150, 80, 70, 110, 130],
"type": "bar",
"showBackground": true,
"backgroundStyle": {
"color": "rgba(180, 180, 180, 0.2)"
}
}
]
}

View File

@ -1,2 +0,0 @@
title: $:/plugins/Gk0Wk/echarts/addons/SimpleExample.json
type: application/json

View File

@ -1,10 +0,0 @@
[
{
"title": "$:/plugins/Gk0Wk/echarts/addons/TagCloud.js",
"text": "\"use strict\";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(t,e)=>{for(var o in e)__defProp(t,o,{get:e[o],enumerable:!0})},__copyProps=(e,o,r,a)=>{if(o&&\"object\"==typeof o||\"function\"==typeof o)for(let t of __getOwnPropNames(o))__hasOwnProp.call(e,t)||t===r||__defProp(e,t,{get:()=>o[t],enumerable:!(a=__getOwnPropDesc(o,t))||a.enumerable});return e},__toCommonJS=t=>__copyProps(__defProp({},\"__esModule\",{value:!0}),t),TagCloud_exports={},getPlatteColor=(__export(TagCloud_exports,{\"default\":()=>TagCloud_default}),module.exports=__toCommonJS(TagCloud_exports),t=>$tw.wiki.renderText(\"text/plain\",\"text/vnd.tiddlywiki\",`<$transclude tiddler={{$:/palette}} index=\"${t}\"><$transclude tiddler=\"$:/palettes/Vanilla\" index=\"${t}\"><$transclude tiddler=\"$:/config/DefaultColourMappings/${t}\"/></$transclude></$transclude>`,{})),addon={shouldUpdate:(t,e)=>0<$tw.utils.count(e),onUpdate:t=>{const r=new Map;let e=\"\",o;var a=t.getOption();const l=!0===a.darkMode;a=a.filter||\"[tags[]!is[system]sort[title]]\",l,l,r.clear(),a=$tw.wiki.filterTiddlers(a).map(t=>({name:t,value:Math.sqrt($tw.wiki.getTiddlersWithTag(t).length),textStyle:{color:(e=>{if(!r.get(e)){var o=[];for(let t=0;t<3;t++)o.push(l?255-Math.round(160*Math.random()):Math.round(160*Math.random()));r.set(e,`rgb(${o.join(\",\")})`)}return r.get(e)})(t)}}));t.setOption({series:[{type:\"wordCloud\",gridSize:4,shape:\"pentagon\",data:a,layoutAnimation:!0,textStyle:{fontFamily:\"sans-serif\",fontWeight:\"bold\"},emphasis:{focus:\"self\",textStyle:{textShadowBlur:10,textShadowColor:\"#333\"}}}],tooltip:{position:\"top\",formatter:({data:{name:t}})=>(t===e&&o||(o=(t=>{var e=$tw.utils.domMaker(\"ul\",{}),o=$tw.wiki.getTiddlersWithTag(t),r=o.length;for(let d=0;d<r;d++){const n=o[d];var a=$tw.utils.domMaker(\"li\",{}),l=$tw.utils.domMaker(\"a\",{text:n,\"class\":\"tc-tiddlylink tc-tiddlylink-resolves tc-popup-handle tc-popup-absolute\",style:{cursor:\"pointer\"}});l.addEventListener(\"click\",()=>(new $tw.Story).navigateTiddler(n)),a.appendChild(l),e.appendChild(a)}return[e]})(t),e=t),o),triggerOn:\"mousemove|click\",enterable:!0,hideDelay:800,textStyle:{color:\"inherit\",fontFamily:\"inherit\",fontSize:\"inherit\"},backgroundColor:getPlatteColor(\"page-background\"),borderColor:getPlatteColor(\"very-muted-foreground\")}})}},TagCloud_default=addon;",
"Modern.TiddlyDev#IncludeSource": "true",
"Modern.TiddlyDev#Origin": "addons/Gk0Wk/TagCloud.ts",
"module-type": "echarts-component",
"type": "application/javascript"
}
]

View File

@ -1,8 +0,0 @@
[
{
"title": "$:/plugins/Gk0Wk/echarts/addons/TagCloud.ts",
"text": "import type { IScriptAddon } from '../../scriptAddon';\n\nconst getPlatteColor = (name: string) =>\n $tw.wiki.renderText(\n 'text/plain',\n 'text/vnd.tiddlywiki',\n `<$transclude tiddler={{$:/palette}} index=\"${name}\"><$transclude tiddler=\"$:/palettes/Vanilla\" index=\"${name}\"><$transclude tiddler=\"$:/config/DefaultColourMappings/${name}\"/></$transclude></$transclude>`,\n {},\n );\nconst addon: IScriptAddon<any> = {\n shouldUpdate: (_state, changedTiddlers) => {\n return $tw.utils.count(changedTiddlers) > 0;\n },\n // See https://github.com/ecomfe/echarts-wordcloud\n onUpdate: myChart => {\n let previousDarkMode;\n const colorCache = new Map();\n const getColor = (tag: string) => {\n if (!colorCache.get(tag)) {\n const rgb = [];\n for (let i = 0; i < 3; i++) {\n rgb.push(\n isDarkMode\n ? 255 - Math.round(Math.random() * 160)\n : Math.round(Math.random() * 160),\n );\n }\n colorCache.set(tag, `rgb(${rgb.join(',')})`);\n }\n return colorCache.get(tag);\n };\n const tooltipFormatter = (tag: string) => {\n const ul = $tw.utils.domMaker('ul', {});\n const tiddlers = $tw.wiki.getTiddlersWithTag(tag);\n const len = tiddlers.length;\n for (let i = 0; i < len; i++) {\n const tiddler = tiddlers[i];\n const li = $tw.utils.domMaker('li', {});\n const a = $tw.utils.domMaker('a', {\n text: tiddler,\n class:\n 'tc-tiddlylink tc-tiddlylink-resolves tc-popup-handle tc-popup-absolute',\n style: {\n cursor: 'pointer',\n },\n });\n // eslint-disable-next-line @typescript-eslint/no-loop-func\n a.addEventListener('click', () =>\n new $tw.Story().navigateTiddler(tiddler),\n );\n li.appendChild(a);\n ul.appendChild(li);\n }\n return [ul];\n };\n let lastTag = '';\n let cache: Element[] | string | undefined;\n const cachedTooltipFormatter = ({\n data: { name },\n }: {\n data: { name: string };\n }) => {\n if (name !== lastTag || !cache) {\n cache = tooltipFormatter(name);\n lastTag = name;\n }\n return cache;\n };\n const chartOptions = myChart.getOption();\n const isDarkMode = (chartOptions as any).darkMode === true;\n const filter =\n (chartOptions as any).filter || '[tags[]!is[system]sort[title]]';\n if (previousDarkMode !== isDarkMode) {\n previousDarkMode = isDarkMode;\n colorCache.clear();\n }\n const data = $tw.wiki.filterTiddlers(filter).map(tag => ({\n name: tag,\n value: Math.sqrt($tw.wiki.getTiddlersWithTag(tag).length),\n textStyle: {\n color: getColor(tag),\n },\n }));\n myChart.setOption({\n series: [\n {\n type: 'wordCloud',\n gridSize: 4,\n shape: 'pentagon',\n data,\n layoutAnimation: true,\n textStyle: {\n fontFamily: 'sans-serif',\n fontWeight: 'bold',\n },\n emphasis: {\n focus: 'self',\n textStyle: {\n textShadowBlur: 10,\n textShadowColor: '#333',\n },\n },\n },\n ],\n tooltip: {\n position: 'top',\n formatter: cachedTooltipFormatter,\n triggerOn: 'mousemove|click',\n enterable: true,\n hideDelay: 800,\n textStyle: {\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n },\n backgroundColor: getPlatteColor('page-background'),\n borderColor: getPlatteColor('very-muted-foreground'),\n },\n } as any);\n },\n};\n\nexport default addon;\n",
"Modern.TiddlyDev#IncludeSource": "true",
"type": "application/javascript"
}
]

View File

@ -1,23 +0,0 @@
title: $:/plugins/Gk0Wk/echarts/addons/TagCloudTagView
<$set name="tagName" value={{$:/temp/Gk0Wk/echarts/addons/TagCloud/currentTag}}>
<$list filter="[[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]]" variable="lang">
<$list filter="[<lang>search[zh]]">
!! 包含 <$link to=<<tagName>>/> 标签的条目
</$list>
<$list filter="[<lang>!search[zh]]">
!! Tiddlers tagged with <$link to=<<tagName>>/>
</$list>
</$list>
<div class="tc-table-of-contents">
<$macrocall $name="toc" tag=<<tagName>> sort="sort[title]"/>
</div>
</$set>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +0,0 @@
title: $:/plugins/Gk0Wk/echarts/addons/TheBrainPopup
<h1><$text text=<<currentTiddler>> /></h1><$list filter="[<currentTiddler>tags[]count[]match[0]]"><$transclude tiddler="$:/core/ui/ViewTemplate/tags" /></$list><$transclude tiddler="$:/core/ui/ViewTemplate/body" mode="inline" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@ -1,2 +0,0 @@
title: $:/plugins/Gk0Wk/echarts/banner
type: image/jpeg

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,14 +0,0 @@
tags: $:/tags/Macro
title: $:/plugins/Gk0Wk/echarts/macro
type: text/vnd.tiddlywiki
\define echarts(textortiddler,height:"300px",width:"100%",class:"gk0wk-echarts-body",theme:"auto",renderer:"canvas",fillSidebar:"true")
<$set name="textortiddler" value="""$textortiddler$""">
<$list filter="[<textortiddler>is[tiddler]] [<textortiddler>is[shadow]]">
<$echarts $tiddler=<<textortiddler>> $height="$height$" $width="$width$" $class="$class$" $theme="$theme$" $renderer="$renderer$" $fillSidebar="$fillSidebar$"/>
</$list>
<$list filter="[<textortiddler>!is[tiddler]!is[shadow]]">
<$echarts $text=<<textortiddler>> $height="$height$" $width="$width$" $class="$class$" $theme="$theme$" $renderer="$renderer$" $fillSidebar="$fillSidebar$"/>
</$list>
</$set>
\end

View File

@ -1,25 +0,0 @@
title: $:/plugins/Gk0Wk/echarts/readme
<$list filter="[[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]]" variable="lang">
<$list filter="[<lang>search[zh]]">
将强大的可视化工具 [[ECharts|https://echarts.apache.org/zh/index.html]] 以优雅的方式与 TiddlyWiki 相结合。
插件说明与使用教程较长,请参考 https://tiddly-gittly.github.io/tw-echarts/
> 本插件使用灵活而强大的 <$text text="TiddlyWiki" /> 开发框架 [[Tiddly.ModernDev|https://github.com/tiddly-gittly/Modern.TiddlyDev]]
</$list>
<$list filter="[<lang>!search[zh]]">
Combines the powerful visualization tool [[ECharts|https://echarts.apache.org/en/index.html]] with TiddlyWiki in an elegant way.
The plugin description and tutorial is long, please refer to https://tiddly-gittly.github.io/tw-echarts/
> This plugin uses the flexible and powerful <$text text="TiddlyWiki" /> development framework [[Tiddly.ModernDev|https://github.com/tiddly-gittly/Modern.TiddlyDev]]
</$list>
</$list>
[img[$:/plugins/Gk0Wk/echarts/banner]]

File diff suppressed because one or more lines are too long

View File

@ -1,13 +0,0 @@
{
"version": "0.1.4",
"title": "$:/plugins/Gk0Wk/echarts",
"plugin-type": "plugin",
"name": "ECharts",
"list": "readme LICENSE",
"description": "ECharts for TiddlyWiki5",
"author": "Gk0Wk",
"source": "https://github.com/tiddly-gittly/tw-echarts/tree/master/plugins/Gk0Wk/echarts",
"dependents": "$:/plugins/Gk0Wk/focused-tiddler",
"Modern.TiddlyDev#SHA256-Hashed": "f5cbae57e5d060bfca14eaa6b8a5669a56e0139b0250e5c65d215cdcafb5a07e",
"core-version": ">=5.2.0"
}