任务二,
1、抓取 http://www.paulgraham.com/read.html 的内容
2、从中提取「标题」和「链接」,存成对象或者数组,保存到本地 articles.json
3、抓取每个「链接」的内容,并保存到 articles 目录下,比如 articles/read.html
4、分析其中的正文部分,保存到 pure-articles 目录下,比如 pure-articles/read.html
5、后面会做翻译(这个先不做)
一些常见问题(FAQ),
| # Add Slash Commands: /spec and /plan | |
| ## Overview | |
| This design document outlines the addition of two new built-in slash commands to Takumi's command system: `/spec` and `/plan`. These commands enhance the AI-assisted development workflow by providing structured approaches to idea refinement and implementation planning. | |
| **Purpose:** | |
| - `/spec`: Interactive brainstorming command that helps transform rough ideas into fully-formed design specifications through guided questioning | |
| - `/plan`: Planning command that generates comprehensive, bite-sized implementation plans from specifications |
| function getTerminal() { | |
| if (process.env.CURSOR_TRACE_ID) return 'cursor'; | |
| if (process.env.VSCODE_GIT_ASKPASS_MAIN?.includes('/.cursor-server/bin/')) | |
| return 'cursor'; | |
| if (process.env.VSCODE_GIT_ASKPASS_MAIN?.includes('/.windsurf-server/bin/')) | |
| return 'windsurf'; | |
| let A = process.env.__CFBundleIdentifier?.toLowerCase(); | |
| if (A?.includes('vscodium')) return 'codium'; | |
| if (A?.includes('windsurf')) return 'windsurf'; | |
| if (A?.includes('pycharm')) return 'pycharm'; |
| export function createRuntime(makoModules, entryModuleId) { | |
| const modulesRegistry = {}; | |
| function requireModule(moduleId) { | |
| if (modulesRegistry[moduleId] !== undefined) { | |
| return modulesRegistry[moduleId].exports; | |
| } | |
| const module = { | |
| exports: {}, |
| // ==UserScript== | |
| // @name YuQue x 霞鹜文楷 | |
| // @namespace http://sorrycc.com/ | |
| // @version 0.1 | |
| // @description 使用「霞鹜文楷」字体 | |
| // @author [email protected] | |
| // @match https://yuque.antfin.com/* | |
| // @match https://*.yuque.com/* | |
| // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
| // @grant none |
任务二,
1、抓取 http://www.paulgraham.com/read.html 的内容
2、从中提取「标题」和「链接」,存成对象或者数组,保存到本地 articles.json
3、抓取每个「链接」的内容,并保存到 articles 目录下,比如 articles/read.html
4、分析其中的正文部分,保存到 pure-articles 目录下,比如 pure-articles/read.html
5、后面会做翻译(这个先不做)
一些常见问题(FAQ),
| function getContainer(root) { | |
| root ||= document.body; | |
| if (!root.innerText) return null; | |
| const totalWords = root.innerText.match(/\S+/g).length; | |
| let ps = root.querySelectorAll('p'); | |
| if (!ps.length) ps = root.querySelectorAll('div'); | |
| if (!ps.length) return null; |
| function getContainer(root) { | |
| root ||= document.body; | |
| if (!root.innerText) return null; | |
| const totalWords = root.innerText.match(/\S+/g).length; | |
| let ps = root.querySelectorAll('p'); | |
| if (!ps.length) ps = root.querySelectorAll('div'); | |
| if (!ps.length) return null; |
| import { useSyncExternalStore } from 'use-sync-external-store/shim' | |
| import { | |
| affectedToPathList, | |
| createProxy as createProxyToCompare, | |
| isChanged, | |
| } from 'proxy-compare'; | |
| import {useCallback, useDebugValue, useEffect, useMemo, useRef} from "react"; | |
| type ProxyObject = { | |
| listeners: Set<Function>; |
| import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector'; | |
| function createStore(createState: Function) { | |
| let state: any; | |
| const listeners = new Set<Function>(); | |
| const setState = (partial: any, replace: any) => { | |
| const nextState = typeof partial === 'function' ? partial(state) : partial; | |
| if (nextState !== state) { | |
| const previousState = state; | |
| state = replace ? nextState : Object.assign({}, state, nextState); |
| import invariant from 'tiny-invariant'; | |
| import 'zx/globals'; | |
| import { event, info } from '../logger'; | |
| // Patched: use domino-ext instead of domino in turndown.umd.js | |
| // ref: https://github.com/fgnass/domino/issues/146 | |
| // @ts-ignore | |
| import TurndownService from 'turndown/lib/turndown.umd.js'; | |
| (async () => { |