Notion.so
- Kenshin Wang
- 联络方式
- 2021/10/04 15:56:43
- 其它
- 适配代码
{
"name": "notion.so",
"title": "<title>",
"desc": "[[{$('meta[name=Description]').attr('content')||$('meta[name=description]').attr('content')}]]",
"include": "[[{(()=>{let html=\"\",$target;const header=()=>{let tmpl='';const $header=$target.find('[placeholder]'),level=$header.attr(\"placeholder\"),text=$header.text();if(/Heading 1/.test(level)){tmpl=`<h1>${text}</h1>`}else if(/Heading 2/.test(level)){tmpl=`<h2>${text}</h2>`}else{tmpl=`<h3>${text}</h3>`}return tmpl},quote=()=>{let tmpl='';const $bulleted=$target.find('[placeholder]');tmpl=$bulleted.html();return tmpl?`<blockquote>${tmpl}</blockquote>`:''},bulleted=()=>{let tmpl='';const $bulleted=$target.find('[placeholder=\"List\"]');tmpl=$bulleted.html();return tmpl?`<ul><li>${tmpl}</li></ul>`:''},numbered=()=>{let tmpl='';const $header=$target.find('[placeholder]');tmpl=$header.html();return`<ul><li>${tmpl}</li></ul>`},image=()=>{let tmpl='';const $img=$target.find('img'),caption=$target.find('div.notranslate').text();if($img.length>0){tmpl=$img[0].outerHTML;return`<figure>${tmpl}<figcaption>${caption}</figcaption></figure>`}else return\"\"},bookmark=()=>{const $bookmark=$target.find('a'),src=$bookmark.attr('href'),text=$bookmark.find('.notion-focusable div div:first').text();return src?`<sr-notion-bookmark><a href=\"${ src }\"target=\"_blank\">${text||src}</a></sr-notion-bookmark>`:''},alias=()=>{const $alias=$target.find('a'),src=$alias.attr('href'),text=$alias.find('.notranslate').text();return src?`<sr-notion-bookmark><a href=\"${ src }\"target=\"_blank\">${text||src}</a></sr-notion-bookmark>`:''},page=()=>{let tmpl='';if($target.attr('class')!='notion-selectable notion-page-block')return'';if(!$target.parent().parent().parent().hasClass('.notion-breadcrumb-block')){const $a=$target.find('a'),src=$a.find('href'),text=$a.find('.notranslate').text();tmpl=`<sr-notion-bookmark><a href=\"${ src }\"target=\"_blank\">${text||src}</a></sr-notion-bookmark>`;return tmpl}return``},code=()=>{let tmpl='';const $code=$target;tmpl=$code.text();return`<pre>${tmpl}</pre>`},video=()=>{let tmpl='';const $video=$target;if($video.length>0){tmpl=$video[0].outerHTML;if($video.find('video').length>0){const src=$video.find('video').attr('src');tmpl=`<video controls=\"\"autoplay=\"\"name=\"media\"><source src=\"${ src }\"type=\"video/mp4\">video</video>`}else if($video.find('iframe').length>0){tmpl=$video.find('iframe')[0].outerHTML;tmpl=tmpl.replace(/<\\/iframe>$/,'iframe</iframe>')}return`<sr-notion-video>${tmpl}</sr-notion-video>`}else return\"\"},collectionitem=()=>{let tmpl='';const $collection=$target;tmpl=$collection.html();return`<div class=\"notion-collection-block\">${tmpl}</div>`},collection=()=>{let tmpl='';const $collection=$target;if($collection.length>0){const $head=$collection.find('.notion-collection_view-block:first'),src=$head.find('a').attr('href'),h1=$head.find('a').text()||$head.text().replace(/Search/ig,''),text=$head.find('.notion-collection-view-select').text();tmpl+=src?`<h1>${h1}</h1><sr-notion-bookmark><a href=\"${ src }\">${text||'打开新的一页查看详细说明'}</a></sr-notion-bookmark>`:'';if($collection.find('.notion-gallery-view').length>0){const $gallery=$collection.find('.notion-gallery-view');$gallery.find('.notion-collection-item').map((idx,item)=>{const $target=$(item),$a=$target.find('a'),src=$a.attr('href'),text=$a.find('[placeholder]').text();tmpl+=`<sr-notion-bookmark><a href=\"${ src }\"target=\"_blank\">${text||src}</a></sr-notion-bookmark>`})}else if($collection.find('.notion-table-view').length>0){}return tmpl}else return\"\"};$(\".notion-page-content .notion-selectable\").map((idx,item)=>{$target=$(item);const cls=$target.attr(\"class\").replace(\"notion-selectable \",\"\");if(/notion-header-block/.test(cls)){html+=header()}else if(/notion-sub_header-block/.test(cls)){html+=header()}else if(/notion-quote-block/.test(cls)){html+=quote()}else if(/notion-text-block/.test(cls)){html+=`<div class=\"notion-text-block\">${$target.html()}</div>`}else if(/notion-bulleted_list-block/.test(cls)){html+=bulleted()}else if(/notion-numbered_list-block/.test(cls)){html+=bulleted()}else if(/notion-image-block/.test(cls)){html+=image()}else if(/notion-code-block/.test(cls)){html+=code()}else if(/notion-bookmark-block/.test(cls)){html+=bookmark()}else if(/notion-page-block/.test(cls)){html+=page()}else if(/notion-alias-block/.test(cls)){html+=alias()}else if(/notion-collection_view-block/.test(cls)){html+=collection()}else if(/notion-video-block/.test(cls)){html+=video()}});return html})()}]]",
"exclude": [
"<svg>"
],
"url": "https://www.notion.so/*",
"avatar": [
{
"name": ""
},
{
"url": ""
}
],
"paging": [
{
"prev": ""
},
{
"next": ""
}
],
"css": "html {\n overflow: initial!important;\n}\nsr-rd-content div {\n margin-bottom: 5px!important;\n}\nsr-rd-content .notion-bookmark-block div[role=\"button\"] > div:nth-child(1) img {\n width: 16px;\n height: 16px;\n min-width: 16px;\n margin-right: 6px;\n}\nsr-rd-content .notion-collection-block .notion-page-block a {\n display: block;\n color: inherit;\n text-decoration: none;\n box-shadow: rgb(15 15 15 / 10%) 0px 0px 0px 1px, rgb(15 15 15 / 10%) 0px 2px 4px;\n border-radius: 3px;\n background: white;\n overflow: hidden;\n transition: background 100ms ease-out 0s;\n position: static;\n height: 100%;\n text-decoration: none!important;\n font-weight: 400!important;\n padding: 0;\n}\nsr-rd-content .notion-collection-block img {\n display: block;\n object-fit: cover;\n border-radius: 1px 1px 0px 0px;\n width: 100%;\n height: 113.625px;\n object-position: center 21.61%;\n}\nsr-rd-content .notion-record-icon {\n margin-right: 10px!important;\n}\nsr-rd-content .notion-record-icon img {\n display: block;\n margin-top: 12px;\n margin-right: 0;\n object-fit: cover;\n border-radius: 3px;\n width: 15.984px;\n height: 15.984px;\n transition: opacity 100ms ease-out 0s;\n}\nsr-rd-content .notion-text-block img {\n width: 1em;\n height: 1em;\n vertical-align: -0.15em;\n margin-right: 0.2em;\n border-radius: 1px;\n} \nsr-rd-content svg { display: none; }\nsr-notion-video {\n display: flex;\n justify-content: center;\n align-items: center;\n}\nsr-rd-content .notion-selectable.notion-video-block {\n display: flex;\n justify-content: center;\n align-items: center;\n}\nsr-notion-video iframe {\n position: initial!important;\n width: 100%!important;\n height: 400px!important;\n}\nsr-notion-video .sr-rd-content-center {\n width: 100%;\n}\nsr-notion-bookmark {\n display: flex;\n justify-content: center;\n margin: 16px auto;\n padding: 12px 12px 9px 12px;\n border: 3px solid #F6F6F6;\n}"
}
安装当前站点