Codync
免費、開源的 1:1 替代方案,取代 Grok Bot 與 Muse。從 iPhone、Mac 或 Linux 桌面將 Claude Code、Codex、Cursor 與 40+ 程式碼代理人作為持續機器人傳訊。群組聊天、主題串…
AI 翻譯
尚未收集儲存庫資訊。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗Convert Web Annotation TextQuoteSelectors into
Text Fragment URLs (#:~:text=prefix-,start,end,-suffix), and parse them back.
Zero dependencies; ESM; browser and Node >= 18.
No existing library did this (see apache/incubator-annotator#60, which describes the idea without shipping it).
import { textQuoteToUrl, annotationToUrl, urlToSelectors } from 'annotation-text-fragment';
textQuoteToUrl('https://example.com/a', { type: 'TextQuoteSelector', exact: 'brown fox', prefix: 'quick ', suffix: ' jumps' });
// https://example.com/a#:~:text=quick-,brown%20fox,-jumps
annotationToUrl(annotation); // first target with a TextQuoteSelector, or null
urlToSelectors(url); // text directives -> TextQuoteSelector / RangeSelector
Also exported: textQuoteToDirective(selector) (just the text=... term) and parseTextDirectives(url).
Existing #fragment and :~: directives on the URL are preserved; multiple selectors become &text= terms.
-, , and & are percent-encoded as the spec requires (encodeURIComponent misses -).normalize: false to disable). Lone surrogates are made well-formed.exact/prefix/suffix marks a block boundary, which one term cannot span: exact becomes textStart,textEnd; context is cut at the boundary.exact longer than maxLength (300) becomes start,end using ~edgeLength (50) characters at each end; prefix/suffix are trimmed to maxContext (64).Intl.Segmenter (so CJK/Thai work), with a whitespace fallback. Pass locale as a hint.start,end matches the first end after the first start; keep prefix to disambiguate.urlToSelectors is only an approximation of how the browser would anchor it.'fragmentDirective' in document.npm test runs the tests.