Skip to content

Commit

Permalink
Merge pull request #126 from datadrivers/fea/sub-categories
Browse files Browse the repository at this point in the history
Add subcategory to generated documentation
  • Loading branch information
anmoel committed Oct 7, 2021
2 parents c5f61b9 + 3c77409 commit db37d9e
Show file tree
Hide file tree
Showing 28 changed files with 35 additions and 0 deletions.
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

0 comments on commit db37d9e

Please sign in to comment.