Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subcategory to generated documentation #126

Merged
merged 1 commit into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/data-sources/anonymous.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_anonymous"
subcategory: "Other"
sidebar_current: "docs-nexus-datasource-anonymous"
description: |-
Use this get the anonymous configuration of the nexus repository manager.
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/blobstore.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_blobstore"
subcategory: "Other"
sidebar_current: "docs-nexus-datasource-blobstore"
description: |-
Use this to create a Nexus blobstore.
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/privileges.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_privileges"
subcategory: "Other"
sidebar_current: "docs-nexus-datasource-privileges"
description: |-
Use this data source to work with privileges
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/repository.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_repository"
subcategory: "Other"
sidebar_current: "docs-nexus-datasource-repository"
description: |-
Use this data source to get a repository data structure
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/routing_rule.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_routing_rule"
subcategory: "Routing"
sidebar_current: "docs-nexus-datasource-routing_rule"
description: |-
Use this data source to work with routing rules
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/security_ldap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_ldap"
subcategory: "Security"
sidebar_current: "docs-nexus-datasource-security_ldap"
description: |-
Use this data source to work with LDAP security
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/security_realms.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_realms"
subcategory: "Security"
sidebar_current: "docs-nexus-datasource-security_realms"
description: |-
Use this data source to work with Realms security
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/security_saml.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_saml"
subcategory: "Security"
sidebar_current: "docs-nexus-datasource-security_saml"
description: |-
Use this data source to get the saml configuration
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/security_user.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_user"
subcategory: "Security"
sidebar_current: "docs-nexus-datasource-security_user"
description: |-
Use this data source to get a user data structure
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/security_user_token.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_user_token"
subcategory: "Security"
sidebar_current: "docs-nexus-datasource-security_user_token"
description: |-
Use this data source to get the global user-token configuration.
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/user.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_user"
subcategory: "Other"
sidebar_current: "docs-nexus-datasource-user"
description: |-
This data source is deprecated.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/anonymous.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_anonymous"
subcategory: "Other"
sidebar_current: "docs-nexus-resource-anonymous"
description: |-
Use this resource to change the anonymous configuration of the nexus repository manager.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/blobstore.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_blobstore"
subcategory: "Other"
sidebar_current: "docs-nexus-resource-blobstore"
description: |-
Use this resource to create a Nexus blobstore.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/content_selector.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_content_selector"
subcategory: "Other"
sidebar_current: "docs-nexus-resource-content_selector"
description: |-
Use this resource to create a Nexus Content Selector
Expand Down
1 change: 1 addition & 0 deletions docs/resources/privilege.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_privilege"
subcategory: "Other"
sidebar_current: "docs-nexus-resource-privilege"
description: |-
Use this resource to create a Nexus privilege
Expand Down
1 change: 1 addition & 0 deletions docs/resources/repository.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_repository"
subcategory: "Other"
sidebar_current: "docs-nexus-resource-repository"
description: |-
Use this resource to create a Nexus Repository.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/role.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_role"
subcategory: "Other"
sidebar_current: "docs-nexus-resource-role"
description: |-
Use this resource to create a Nexus Role.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/routing_rule.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_routing_rule"
subcategory: "Routing"
sidebar_current: "docs-nexus-resource-routing_rule"
description: |-
Use this resource to create a Nexus Routing Rule.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/script.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_script"
subcategory: "Other"
sidebar_current: "docs-nexus-resource-script"
description: |-
Use this resource to create and execute a custom script.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/security_ldap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_ldap"
subcategory: "Security"
sidebar_current: "docs-nexus-resource-security_ldap"
description: |-
Use this resource to create a Nexus Security LDAP
Expand Down
1 change: 1 addition & 0 deletions docs/resources/security_ldap_order.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_ldap_order"
subcategory: "Security"
sidebar_current: "docs-nexus-resource-security_ldap_order"
description: |-
Use this resource to change the LDAP order.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/security_realms.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_realms"
subcategory: "Security"
sidebar_current: "docs-nexus-resource-security_realms"
description: |-
Use this resource to activate Nexus Security LDAP and order
Expand Down
1 change: 1 addition & 0 deletions docs/resources/security_saml.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_saml"
subcategory: "Security"
sidebar_current: "docs-nexus-resource-security_saml"
description: |-
Use this resource to create a Nexus Security SAML
Expand Down
1 change: 1 addition & 0 deletions docs/resources/security_user.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_user"
subcategory: "Security"
sidebar_current: "docs-nexus-resource-security_user"
description: |-
Use this resource to manage users
Expand Down
1 change: 1 addition & 0 deletions docs/resources/security_user_token.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_security_user_token"
subcategory: "Security"
sidebar_current: "docs-nexus-resource-security_user_token"
description: |-
Use this resource to manage the global configuration for the user-tokens
Expand Down
1 change: 1 addition & 0 deletions docs/resources/user.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: "nexus"
page_title: "Nexus: nexus_user"
subcategory: "Other"
sidebar_current: "docs-nexus-resource-user"
description: |-
This data source is deprecated.
Expand Down
8 changes: 8 additions & 0 deletions gendocs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ func genDoc(dtype, fpath, name string, resource *schema.Resource) {
"description": "",
"description_short": "",
"import": "",
"subcategory": "Other",
}

nameArray := strings.Split(name, "_")
if len(nameArray) > 2 {
if nameArray[1] != "content" {
data["subcategory"] = strings.Title(nameArray[1])
}
}

fname := fmt.Sprintf("%s_%s.go", dtype, data["resource"])
Expand Down
1 change: 1 addition & 0 deletions gendocs/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const (
docTPL = `---
layout: "{{.cloud_mark}}"
page_title: "{{.cloud_title}}: {{.name}}"
subcategory: "{{.subcategory}}"
sidebar_current: "docs-{{.cloud_mark}}-{{.dtype}}-{{.resource}}"
description: |-
{{.description_short}}
Expand Down