Native Shell
Native Shell:AI 生成的 UI,在你的应用中原生呈现,覆盖每个平台。iOS、Android、macOS、Windows 与 Linux 上的应用、GPUI 应用与网页在运行时加载已签名、沙箱隔离的 TSX 模块并绘制 th
AI 翻译
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Read-only mirror of gitlab.com/bart-turczynski/sitemapr
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗sitemapr is a deterministic toolkit for reading and validating XML, text, and index sitemaps against the Sitemap Protocol 0.9 and the related W3C and RFC standards. It parses sitemap sources into tidy tibbles, expands sitemap indexes, discovers a site’s sitemaps from its root URL, and reports schema and protocol findings with stable, reproducible output.
Status: experimental. The package works and is covered by an extensive test suite, but the API may still change without deprecation and it is not yet on CRAN. Pin a commit or tag if you depend on it.
sitemapr is not on CRAN yet. Install it from r-universe:
install.packages(
"sitemapr",
repos = c("https://bart-turczynski.r-universe.dev", "https://cloud.r-project.org")
)
Or install the development version from GitLab:
# install.packages("pak")
pak::pak("gitlab::bart-turczynski/sitemapr")
Its URL-parsing dependency, rurl, is installed automatically from CRAN.
read_sitemap() accepts a sitemap URL or a local file (.xml, .txt,
.gz, or .tar.gz) and returns one row per URL, with lastmod,
changefreq, priority, and the image/video/news/alternate extension
columns.
library(sitemapr)
sitemap <- '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2024-01-01</lastmod>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/?page=about</loc>
<changefreq>monthly</changefreq>
</url>
</urlset>'
path <- tempfile(fileext = ".xml")
writeLines(sitemap, path)
read_sitemap(path)
#> # A tibble: 2 × 9
#> loc lastmod changefreq priority images video news alternates
#> <chr> <dttm> <chr> <dbl> <list> <list> <list> <list>
#> 1 https… 2024-01-01 00:00:00 <NA> 1 <NULL> <NULL> <NULL> <NULL>
#> 2 https… NA monthly NA <NULL> <NULL> <NULL> <NULL>
#> # ℹ 1 more variable: source_sitemap <chr>
A top-level sitemap index is expanded recursively (cycle-safe, depth- and count-capped) so every reachable child sitemap’s rows carry provenance.
validate_sitemap() returns a stable findings tibble — one row per
issue, with a code, severity, and the layer (schema, protocol,
classification, or index) that produced it. The same source and mode
always yield a row-for-row identical result.
invalid <- '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://example.com/</loc><priority>2.0</priority></url>
<url><loc>/relative/path</loc></url>
</urlset>'
path <- tempfile(fileext = ".xml")
writeLines(invalid, path)
findings <- validate_sitemap(path)
findings[, c("code", "severity", "layer")]
#> # A tibble: 3 × 3
#> code severity layer
#> <chr> <chr> <chr>
#> 1 SCHEMA_INVALID error schema
#> 2 PROTOCOL_PRIORITY_OUT_OF_RANGE error protocol
#> 3 PROTOCOL_URL_NOT_ABSOLUTE error protocol
Pass mode = "non-strict" to downgrade schema violations to warnings
and drop strict-only findings.
sitemap_tree() takes a site-root URL, tries a catalog of common
sitemap paths (generic, then WordPress/Shopify), and returns a discovery
tree: one row per candidate, marked accepted or rejected. It needs
network access, so it is not run here.
sitemap_tree("https://example.com")
vignette("introduction", package = "sitemapr")