导出 CSDN 的收藏夹内容到本地
1
直接点击网站右上角的头像
之后点击收藏
展开你想保存的收藏夹,比如我选择LaTeX
收藏夹
2
按键盘 F12 或者右键网页空白处选择检查
在控制台(Console)中输入以下代码后回车会让你选择文件的保存位置
/**
* @brief - 将文本内容保存到文件
* @param {string} text - 要保存的文本内容
* @param {string} file_name - 要保存的文件名
*/
function saveTextToFile(text, file_name) {
var blob = new Blob([text], { type: 'text/plain' });
var a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = file_name;
a.click();
}
var output = ''; // 用于保存最终的输出文本内容
$('.collect-second-li a').each(function (index) {
var href = $(this).attr('href'); // 获取链接地址
var title = $(this).text(); // 获取链接标题
output += (index + 1) + '. ' + title + '\n' + href + '\n\n';
});
saveTextToFile(output, 'output.txt');
3
查看保存的文件:
大功告成~
以下为测试内容:
MDX components
Code Group
export const repoName = 'm0rtzz.blog'
export const repoOwner = 'M0rtzz'
export const site = 'https://m0rtzz.com'
Details
Details
Details Block
schema:
- https://api.github.com/graphql:
headers:
Authorization: Bearer ${GITHUB_TOKEN}
documents: '**/*.ts'
Details block is a collapsible component.
Github Alerts
note
Useful information that users should know, even when skimming content.
tip
Helpful advice for doing things better or more easily.
important
Key information users need to know to achieve their goal.
warning
Urgent info that needs immediate user attention to avoid problems.
caution
Advises about risks or negative outcomes of certain actions.
Shiki
Twoslash
interface Todo {
: string
}
const : <Todo> = {
: 'Delete inactive users'.(),
}
.title = 'Hello'
.p('123', 10)
Custom log messageconst = 1
Custom error messageconst = 1
Custom warning messageconst = 1
Custom annotation message
Shiki Transformers
transformerNotationDiff
console.log('hewwo')
console.log('hello')
console.log('goodbye')
transformerNotationHighlight
console.log('Not highlighted')
console.log('Highlighted')
console.log('Not highlighted')
console.log('Highlighted')
console.log('Highlighted')
console.log('Not highlighted')
transformerNotationWordHighlight
const message = 'Hello World'
console.log(message) // prints Hello World
const message = 'Hello World'
console.log(message) // prints Hello World
transformerNotationFocus
console.log('Not focused')
console.log('Focused')
console.log('Not focused')
console.log('Focused')
console.log('Focused')
console.log('Not focused')
transformerNotationErrorLevel
console.log('No errors or warnings')
console.error('Error')
console.warn('Warning')
transformerMetaHighlight
console.log('1')
console.log('2')
console.log('3')
console.log('4')
transformerMetaWordHighlight
const msg = 'Hello World'
console.log(msg) // prints Hello World