-
Notifications
You must be signed in to change notification settings - Fork 20
feat(examples): make long multi-file examples collapsible for better readability #206
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
base: main
Are you sure you want to change the base?
Changes from all commits
0666dc2
de5d884
18e0d09
0512396
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -13,6 +13,35 @@ | |||
| } | ||||
| } | ||||
|
|
||||
| /* Collapsible <details> styling */ | ||||
| details { | ||||
| margin: 1.2rem 0; | ||||
| padding: 0.6rem 1rem; | ||||
| border: 1px solid #ccc; | ||||
| border-radius: 6px; | ||||
| background-color: #f9f9f9; | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| } | ||||
|
|
||||
| details[open] { | ||||
| background-color: #fefefe; | ||||
| border-color: #999; | ||||
| } | ||||
|
|
||||
| details summary { | ||||
| font-weight: 600; | ||||
| cursor: pointer; | ||||
| margin: -0.4rem -1rem 0.6rem -1rem; | ||||
| padding: 0.6rem 1rem; | ||||
| background-color: #ececec; | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| border-radius: 6px 6px 0 0; | ||||
| transition: background-color 0.2s ease; | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| } | ||||
|
|
||||
| details summary:hover { | ||||
| background-color: #e2e2e2; | ||||
| } | ||||
|
|
||||
|
|
||||
| @media (min-width: 768px) { | ||||
| .td-404 main, | ||||
| .td-main main .examples-index-page { | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -7,17 +7,25 @@ excerpt: '' | |||
| hasMore: false | ||||
| parent: "Community Provisioners" | ||||
| flavor: "Resources" | ||||
|
|
||||
| --- | ||||
|
|
||||
| {{% details "score-backend.yaml" %}} | ||||
| {{% example-file filename="score-backend.yaml" dir="score/resources/community-provisioners/service" githubUrl="https://github.com/score-spec/community-provisioners/blob/main" %}} | ||||
| {{% /details %}} | ||||
|
|
||||
| {{% details "score-frontend.yaml" %}} | ||||
| {{% example-file filename="score-frontend.yaml" dir="score/resources/community-provisioners/service" githubUrl="https://github.com/score-spec/community-provisioners/blob/main" %}} | ||||
| {{% /details %}} | ||||
|
|
||||
| {{< tabs >}} | ||||
|
|
||||
| {{% tab name="score-compose" %}} | ||||
|
|
||||
| {{% details "10-service.provisioners.yaml (score-compose)" %}} | ||||
| {{% example-file filename="10-service.provisioners.yaml" dir="score/resources/community-provisioners/service/score-compose" githubUrl="https://github.com/score-spec/community-provisioners/blob/main" %}} | ||||
| {{% /details %}} | ||||
|
|
||||
| --- | ||||
| ... | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
|
|
||||
| Initialize your local workspace, by importing a specific community provisioner: | ||||
|
|
||||
|
|
@@ -63,12 +71,19 @@ See the running containers: | |||
| docker ps | ||||
| ``` | ||||
|
|
||||
| {{%/ tab %}} | ||||
| {{% /tab %}} | ||||
|
|
||||
| {{% tab name="score-k8s" %}} | ||||
|
|
||||
| {{% details "10-service-with-netpol.provisioners.yaml (score-k8s)" %}} | ||||
| {{% example-file filename="10-service-with-netpol.provisioners.yaml" dir="score/resources/community-provisioners/service/score-k8s" githubUrl="https://github.com/score-spec/community-provisioners/blob/main" %}} | ||||
| {{% /details %}} | ||||
|
|
||||
| {{% details "10-service.provisioners.yaml (score-k8s)" %}} | ||||
| {{% example-file filename="10-service.provisioners.yaml" dir="score/resources/community-provisioners/service/score-k8s" githubUrl="https://github.com/score-spec/community-provisioners/blob/main" %}} | ||||
| {{% /details %}} | ||||
|
|
||||
| --- | ||||
| ... | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
|
|
||||
| Initialize your local workspace, by importing a specific community provisioner: | ||||
|
|
||||
|
|
@@ -114,5 +129,6 @@ See the running containers: | |||
| kubectl get all | ||||
| ``` | ||||
|
|
||||
| {{%/ tab %}} | ||||
| {{% /tab %}} | ||||
|
|
||||
| {{< /tabs >}} | ||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <details{{ with .Get 1 }} {{ . | safeHTML }}{{ end -}}> | ||
| <summary>{{ with .Get 0 -}}{{ . | safeHTML }}{{ else -}}{{ errorf "No summary provided"}}{{ end -}}</summary> | ||
| {{ with .Inner -}}{{ . | markdownify}}{{ else -}}{{ errorf "No details provided"}}{{ end -}} | ||
| </details> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.