From cdb088cec288a20e14240f86a689dd14f4cd603b Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 22 May 2023 04:57:49 +0200 Subject: Add CRAN package registry (#22331) This PR adds a [CRAN](https://cran.r-project.org/) package registry. ![grafik](https://user-images.githubusercontent.com/1666336/210450039-d6fa6f77-20cd-4741-89a8-1624def267f7.png) --- templates/package/content/cran.tmpl | 59 ++++++++++++++++++++++++++++++++++++ templates/package/metadata/cran.tmpl | 5 +++ templates/package/view.tmpl | 2 ++ templates/swagger/v1_json.tmpl | 1 + 4 files changed, 67 insertions(+) create mode 100644 templates/package/content/cran.tmpl create mode 100644 templates/package/metadata/cran.tmpl (limited to 'templates') diff --git a/templates/package/content/cran.tmpl b/templates/package/content/cran.tmpl new file mode 100644 index 0000000000..dcabdbce93 --- /dev/null +++ b/templates/package/content/cran.tmpl @@ -0,0 +1,59 @@ +{{if eq .PackageDescriptor.Package.Type "cran"}} +

{{.locale.Tr "packages.installation"}}

+
+
+
+ +
options("repos" = c(getOption("repos"), c(gitea="")))
+
+
+ +
install.packages("{{.PackageDescriptor.Package.Name}}")
+
+
+ +
+
+
+ + {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Title}} +

{{.locale.Tr "packages.about"}}

+
+ {{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Title}}{{else}}{{end}} +
+ {{end}} + + {{if or .PackageDescriptor.Metadata.Imports .PackageDescriptor.Metadata.Depends .PackageDescriptor.Metadata.LinkingTo .PackageDescriptor.Metadata.Suggests}} +

{{.locale.Tr "packages.dependencies"}}

+
+ + + {{if .PackageDescriptor.Metadata.Imports}} + + + + + {{end}} + {{if .PackageDescriptor.Metadata.Depends}} + + + + + {{end}} + {{if .PackageDescriptor.Metadata.LinkingTo}} + + + + + {{end}} + {{if .PackageDescriptor.Metadata.Suggests}} + + + + + {{end}} + +
Imports{{StringUtils.Join .PackageDescriptor.Metadata.Imports ", "}}
Depends{{StringUtils.Join .PackageDescriptor.Metadata.Depends ", "}}
LinkingTo{{StringUtils.Join .PackageDescriptor.Metadata.LinkingTo ", "}}
Suggests{{StringUtils.Join .PackageDescriptor.Metadata.Suggests ", "}}
+
+ {{end}} +{{end}} diff --git a/templates/package/metadata/cran.tmpl b/templates/package/metadata/cran.tmpl new file mode 100644 index 0000000000..7b113ec797 --- /dev/null +++ b/templates/package/metadata/cran.tmpl @@ -0,0 +1,5 @@ +{{if eq .PackageDescriptor.Package.Type "cran"}} + {{if .PackageDescriptor.Metadata.License}}
{{svg "octicon-law" 16 "mr-3"}} {{.PackageDescriptor.Metadata.License}}
{{end}} + {{range .PackageDescriptor.Metadata.Authors}}
{{svg "octicon-person" 16 "mr-3"}} {{.}}
{{end}} + {{range .PackageDescriptor.Metadata.ProjectURL}}
{{svg "octicon-link-external" 16 "mr-3"}} {{$.locale.Tr "packages.details.project_site"}}
{{end}} +{{end}} diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl index 5285a0838d..aadaaa412a 100644 --- a/templates/package/view.tmpl +++ b/templates/package/view.tmpl @@ -26,6 +26,7 @@ {{template "package/content/conan" .}} {{template "package/content/conda" .}} {{template "package/content/container" .}} + {{template "package/content/cran" .}} {{template "package/content/debian" .}} {{template "package/content/generic" .}} {{template "package/content/go" .}} @@ -57,6 +58,7 @@ {{template "package/metadata/conan" .}} {{template "package/metadata/conda" .}} {{template "package/metadata/container" .}} + {{template "package/metadata/cran" .}} {{template "package/metadata/debian" .}} {{template "package/metadata/generic" .}} {{template "package/metadata/helm" .}} diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 3859eb5567..3c56fc9efb 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -2416,6 +2416,7 @@ "conan", "conda", "container", + "cran", "debian", "generic", "go", -- cgit v1.2.3