diff options
author | John Olheiser <john.olheiser@gmail.com> | 2023-07-25 23:53:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 04:53:13 +0000 |
commit | bd4c7ce578956d9839309b16753bd5505b63b2e3 (patch) | |
tree | 1d3074ef542cee11707bc4985ce54dc40facb9b6 /docs/content/usage/packages/cran.zh-cn.md | |
parent | 5dc37ef97a30628027a723ee944225a33a6511f8 (diff) | |
download | gitea-bd4c7ce578956d9839309b16753bd5505b63b2e3.tar.gz gitea-bd4c7ce578956d9839309b16753bd5505b63b2e3.zip |
Docusaurus-ify (#26051)
This PR cleans up the docs in a way to make them simpler to ingest by
our [docs repo](https://gitea.com/gitea/gitea-docusaurus).
1. It includes all of the sed invocations our ingestion did, removing
the need to do it at build time.
2. It replaces the shortcode variable replacement method with
`@variable@` style, simply for easier sed invocations when required.
3. It removes unused files and moves the docs up a level as cleanup.
---------
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'docs/content/usage/packages/cran.zh-cn.md')
-rw-r--r-- | docs/content/usage/packages/cran.zh-cn.md | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/docs/content/usage/packages/cran.zh-cn.md b/docs/content/usage/packages/cran.zh-cn.md new file mode 100644 index 0000000000..c8e32a64c0 --- /dev/null +++ b/docs/content/usage/packages/cran.zh-cn.md @@ -0,0 +1,89 @@ +--- +date: "2023-01-01T00:00:00+00:00" +title: "CRAN 软件包注册表" +slug: "cran" +draft: false +toc: false +menu: + sidebar: + parent: "packages" + name: "CRAN" + sidebar_position: 35 + identifier: "cran" +--- + +# CRAN 软件包注册表 + +将 [R](https://www.r-project.org/) 软件包发布到您的用户或组织的类似 [CRAN](https://cran.r-project.org/) 的注册表。 + +## 要求 + +要使用CRAN软件包注册表,您需要安装 [R](https://cran.r-project.org/)。 + +## 配置软件包注册表 + +要注册软件包注册表,您需要将其添加到 `Rprofile.site` 文件中,可以是系统级别、用户级别 `~/.Rprofile` 或项目级别: + +``` +options("repos" = c(getOption("repos"), c(gitea="https://gitea.example.com/api/packages/{owner}/cran"))) +``` + +| 参数 | 描述 | +| ------- | -------------- | +| `owner` | 软件包的所有者 | + +如果需要提供凭据,可以将它们嵌入到URL(`https://user:password@gitea.example.com/...`)中。 + +## 发布软件包 + +要发布 R 软件包,请执行带有软件包内容的 HTTP `PUT` 操作。 + +源代码软件包: + +``` +PUT https://gitea.example.com/api/packages/{owner}/cran/src +``` + +| 参数 | 描述 | +| ------- | -------------- | +| `owner` | 软件包的所有者 | + +二进制软件包: + +``` +PUT https://gitea.example.com/api/packages/{owner}/cran/bin?platform={platform}&rversion={rversion} +``` + +| 参数 | 描述 | +| ---------- | -------------- | +| `owner` | 软件包的所有者 | +| `platform` | 平台的名称 | +| `rversion` | 二进制的R版本 | + +例如: + +```shell +curl --user your_username:your_password_or_token \ + --upload-file path/to/package.zip \ + https://gitea.example.com/api/packages/testuser/cran/bin?platform=windows&rversion=4.2 +``` + +如果同名和版本的软件包已存在,则无法发布软件包。您必须首先删除现有的软件包。 + +## 安装软件包 + +要从软件包注册表中安装R软件包,请执行以下命令: + +```shell +install.packages("{package_name}") +``` + +| 参数 | 描述 | +| -------------- | ----------------- | +| `package_name` | The package name. | + +例如: + +```shell +install.packages("testpackage") +``` |