Skip to content

Commit 3682809

Browse files
authored
Generate a toc.json for Docusaurus too (#56)
* Generate a toc.json for Docusaurus too - Clean up templates, we don't do anything with css classes - Add a missing tbody * copy across readme too
1 parent 6eb4f03 commit 3682809

File tree

7 files changed

+79
-111
lines changed

7 files changed

+79
-111
lines changed

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ api-docs: gen-crd-api-reference-docs ## Generate API reference documentation
196196
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir=./api/v1alpha1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/gitopsset.md
197197
@sed -i '' -e 's/<namespace><em><name><\/em><group>_<kind>/namespace_name_group_kind/g' docs/api/gitopsset.md
198198

199+
200+
user-guide: api-docs
201+
cp ./docs/README.md ../weave-gitops/website/docs/gitopssets/guide.mdx
202+
cp ./docs/api/gitopsset.md ../weave-gitops/website/docs/gitopssets/_api.mdx
203+
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir=./api/v1alpha1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/toc-template -out-file=../weave-gitops/website/docs/gitopssets/_api-toc.json
204+
205+
199206
# go-get-tool will 'go get' any package $2 and install it to $1.
200207
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
201208
define go-get-tool

docs/api/gitopsset.md

+22-72
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
<p>Packages:</p>
2-
<ul class="simple">
2+
<ul>
33
<li>
44
<a href="#templates.weave.works%2fv1alpha1">templates.weave.works/v1alpha1</a>
55
</li>
66
</ul>
77
<h2 id="templates.weave.works/v1alpha1">templates.weave.works/v1alpha1</h2>
88
<p>Package v1alpha1 contains API Schema definitions for the gitopssets v1alpha1 API group</p>
99
Resource Types:
10-
<ul class="simple"><li>
10+
<ul><li>
1111
<a href="#templates.weave.works/v1alpha1.GitOpsSet">GitOpsSet</a>
1212
</li></ul>
1313
<h3 id="templates.weave.works/v1alpha1.GitOpsSet">GitOpsSet
1414
</h3>
1515
<p>GitOpsSet is the Schema for the gitopssets API</p>
16-
<div class="md-typeset__scrollwrap">
17-
<div class="md-typeset__table">
1816
<table>
1917
<thead>
2018
<tr>
@@ -67,6 +65,7 @@ GitOpsSetSpec
6765
<br/>
6866
<br/>
6967
<table>
68+
<tbody>
7069
<tr>
7170
<td>
7271
<code>suspend</code><br />
@@ -120,6 +119,7 @@ string
120119
when reconciling this Kustomization.</p>
121120
</td>
122121
</tr>
122+
</tbody>
123123
</table>
124124
</td>
125125
</tr>
@@ -137,8 +137,6 @@ GitOpsSetStatus
137137
</tr>
138138
</tbody>
139139
</table>
140-
</div>
141-
</div>
142140
<h3 id="templates.weave.works/v1alpha1.APIClientGenerator">APIClientGenerator
143141
</h3>
144142
<p>
@@ -148,8 +146,6 @@ GitOpsSetStatus
148146
</p>
149147
<p>APIClientGenerator defines a generator that queries an API endpoint and uses
150148
that to generate data.</p>
151-
<div class="md-typeset__scrollwrap">
152-
<div class="md-typeset__table">
153149
<table>
154150
<thead>
155151
<tr>
@@ -240,10 +236,24 @@ Kubernetes pkg/apis/apiextensions/v1.JSON
240236
<p>If set, this will configure the Method to be POST automatically.</p>
241237
</td>
242238
</tr>
239+
<tr>
240+
<td>
241+
<code>singleElement</code><br />
242+
<em>
243+
bool
244+
</em>
245+
</td>
246+
<td>
247+
<em>(Optional)</em>
248+
<p>SingleElement means generate a single element with the result of the API
249+
call.</p>
250+
<p>When true, the response must be a JSON object and will be returned as a
251+
single element, i.e. only one element will be generated containing the
252+
entire object.</p>
253+
</td>
254+
</tr>
243255
</tbody>
244256
</table>
245-
</div>
246-
</div>
247257
<h3 id="templates.weave.works/v1alpha1.ClusterGenerator">ClusterGenerator
248258
</h3>
249259
<p>
@@ -253,8 +263,6 @@ Kubernetes pkg/apis/apiextensions/v1.JSON
253263
</p>
254264
<p>ClusterGenerator defines a generator that queries the cluster API for
255265
relevant clusters.</p>
256-
<div class="md-typeset__scrollwrap">
257-
<div class="md-typeset__table">
258266
<table>
259267
<thead>
260268
<tr>
@@ -280,17 +288,13 @@ Kubernetes meta/v1.LabelSelector
280288
</tr>
281289
</tbody>
282290
</table>
283-
</div>
284-
</div>
285291
<h3 id="templates.weave.works/v1alpha1.GitOpsSetGenerator">GitOpsSetGenerator
286292
</h3>
287293
<p>
288294
(<em>Appears on:</em>
289295
<a href="#templates.weave.works/v1alpha1.GitOpsSetSpec">GitOpsSetSpec</a>)
290296
</p>
291297
<p>GitOpsSetGenerator is the top-level set of generators for this GitOpsSet.</p>
292-
<div class="md-typeset__scrollwrap">
293-
<div class="md-typeset__table">
294298
<table>
295299
<thead>
296300
<tr>
@@ -373,8 +377,6 @@ APIClientGenerator
373377
</tr>
374378
</tbody>
375379
</table>
376-
</div>
377-
</div>
378380
<h3 id="templates.weave.works/v1alpha1.GitOpsSetNestedGenerator">GitOpsSetNestedGenerator
379381
</h3>
380382
<p>
@@ -383,8 +385,6 @@ APIClientGenerator
383385
</p>
384386
<p>GitOpsSetNestedGenerator describes the generators usable by the MatrixGenerator.
385387
This is a subset of the generators allowed by the GitOpsSetGenerator because the CRD format doesn&rsquo;t support recursive declarations.</p>
386-
<div class="md-typeset__scrollwrap">
387-
<div class="md-typeset__table">
388388
<table>
389389
<thead>
390390
<tr>
@@ -455,17 +455,13 @@ APIClientGenerator
455455
</tr>
456456
</tbody>
457457
</table>
458-
</div>
459-
</div>
460458
<h3 id="templates.weave.works/v1alpha1.GitOpsSetSpec">GitOpsSetSpec
461459
</h3>
462460
<p>
463461
(<em>Appears on:</em>
464462
<a href="#templates.weave.works/v1alpha1.GitOpsSet">GitOpsSet</a>)
465463
</p>
466464
<p>GitOpsSetSpec defines the desired state of GitOpsSet</p>
467-
<div class="md-typeset__scrollwrap">
468-
<div class="md-typeset__table">
469465
<table>
470466
<thead>
471467
<tr>
@@ -529,17 +525,13 @@ when reconciling this Kustomization.</p>
529525
</tr>
530526
</tbody>
531527
</table>
532-
</div>
533-
</div>
534528
<h3 id="templates.weave.works/v1alpha1.GitOpsSetStatus">GitOpsSetStatus
535529
</h3>
536530
<p>
537531
(<em>Appears on:</em>
538532
<a href="#templates.weave.works/v1alpha1.GitOpsSet">GitOpsSet</a>)
539533
</p>
540534
<p>GitOpsSetStatus defines the observed state of GitOpsSet</p>
541-
<div class="md-typeset__scrollwrap">
542-
<div class="md-typeset__table">
543535
<table>
544536
<thead>
545537
<tr>
@@ -607,17 +599,13 @@ have been successfully applied</p>
607599
</tr>
608600
</tbody>
609601
</table>
610-
</div>
611-
</div>
612602
<h3 id="templates.weave.works/v1alpha1.GitOpsSetTemplate">GitOpsSetTemplate
613603
</h3>
614604
<p>
615605
(<em>Appears on:</em>
616606
<a href="#templates.weave.works/v1alpha1.GitOpsSetSpec">GitOpsSetSpec</a>)
617607
</p>
618608
<p>GitOpsSetTemplate describes a resource to create</p>
619-
<div class="md-typeset__scrollwrap">
620-
<div class="md-typeset__table">
621609
<table>
622610
<thead>
623611
<tr>
@@ -654,8 +642,6 @@ k8s.io/apimachinery/pkg/runtime.RawExtension
654642
</tr>
655643
</tbody>
656644
</table>
657-
</div>
658-
</div>
659645
<h3 id="templates.weave.works/v1alpha1.GitRepositoryGenerator">GitRepositoryGenerator
660646
</h3>
661647
<p>
@@ -664,8 +650,6 @@ k8s.io/apimachinery/pkg/runtime.RawExtension
664650
<a href="#templates.weave.works/v1alpha1.GitOpsSetNestedGenerator">GitOpsSetNestedGenerator</a>)
665651
</p>
666652
<p>GitRepositoryGenerator generates from files in a Flux GitRepository resource.</p>
667-
<div class="md-typeset__scrollwrap">
668-
<div class="md-typeset__table">
669653
<table>
670654
<thead>
671655
<tr>
@@ -714,8 +698,6 @@ generated.</p>
714698
</tr>
715699
</tbody>
716700
</table>
717-
</div>
718-
</div>
719701
<h3 id="templates.weave.works/v1alpha1.GitRepositoryGeneratorDirectoryItem">GitRepositoryGeneratorDirectoryItem
720702
</h3>
721703
<p>
@@ -724,8 +706,6 @@ generated.</p>
724706
</p>
725707
<p>GitRepositoryGeneratorDirectoryItem stores the information about a specific
726708
directory to be generated from.</p>
727-
<div class="md-typeset__scrollwrap">
728-
<div class="md-typeset__table">
729709
<table>
730710
<thead>
731711
<tr>
@@ -756,17 +736,13 @@ bool
756736
</tr>
757737
</tbody>
758738
</table>
759-
</div>
760-
</div>
761739
<h3 id="templates.weave.works/v1alpha1.GitRepositoryGeneratorFileItem">GitRepositoryGeneratorFileItem
762740
</h3>
763741
<p>
764742
(<em>Appears on:</em>
765743
<a href="#templates.weave.works/v1alpha1.GitRepositoryGenerator">GitRepositoryGenerator</a>)
766744
</p>
767745
<p>GitRepositoryGeneratorFileItem defines a path to a file to be parsed when generating.</p>
768-
<div class="md-typeset__scrollwrap">
769-
<div class="md-typeset__table">
770746
<table>
771747
<thead>
772748
<tr>
@@ -788,8 +764,6 @@ string
788764
</tr>
789765
</tbody>
790766
</table>
791-
</div>
792-
</div>
793767
<h3 id="templates.weave.works/v1alpha1.HeadersReference">HeadersReference
794768
</h3>
795769
<p>
@@ -798,8 +772,6 @@ string
798772
</p>
799773
<p>HeadersReference references either a Secret or ConfigMap to be used for
800774
additional request headers.</p>
801-
<div class="md-typeset__scrollwrap">
802-
<div class="md-typeset__table">
803775
<table>
804776
<thead>
805777
<tr>
@@ -832,8 +804,6 @@ string
832804
</tr>
833805
</tbody>
834806
</table>
835-
</div>
836-
</div>
837807
<h3 id="templates.weave.works/v1alpha1.ListGenerator">ListGenerator
838808
</h3>
839809
<p>
@@ -842,8 +812,6 @@ string
842812
<a href="#templates.weave.works/v1alpha1.GitOpsSetNestedGenerator">GitOpsSetNestedGenerator</a>)
843813
</p>
844814
<p>ListGenerator generates from a hard-coded list.</p>
845-
<div class="md-typeset__scrollwrap">
846-
<div class="md-typeset__table">
847815
<table>
848816
<thead>
849817
<tr>
@@ -866,8 +834,6 @@ string
866834
</tr>
867835
</tbody>
868836
</table>
869-
</div>
870-
</div>
871837
<h3 id="templates.weave.works/v1alpha1.MatrixGenerator">MatrixGenerator
872838
</h3>
873839
<p>
@@ -876,8 +842,6 @@ string
876842
</p>
877843
<p>MatrixGenerator defines a matrix that combines generators.
878844
The matrix is a cartesian product of the generators.</p>
879-
<div class="md-typeset__scrollwrap">
880-
<div class="md-typeset__table">
881845
<table>
882846
<thead>
883847
<tr>
@@ -901,8 +865,6 @@ The matrix is a cartesian product of the generators.</p>
901865
</tr>
902866
</tbody>
903867
</table>
904-
</div>
905-
</div>
906868
<h3 id="templates.weave.works/v1alpha1.PullRequestGenerator">PullRequestGenerator
907869
</h3>
908870
<p>
@@ -912,8 +874,6 @@ The matrix is a cartesian product of the generators.</p>
912874
</p>
913875
<p>PullRequestGenerator defines a generator that queries a Git hosting service
914876
for relevant PRs.</p>
915-
<div class="md-typeset__scrollwrap">
916-
<div class="md-typeset__table">
917877
<table>
918878
<thead>
919879
<tr>
@@ -1012,17 +972,13 @@ or to include forks if true</p>
1012972
</tr>
1013973
</tbody>
1014974
</table>
1015-
</div>
1016-
</div>
1017975
<h3 id="templates.weave.works/v1alpha1.ResourceInventory">ResourceInventory
1018976
</h3>
1019977
<p>
1020978
(<em>Appears on:</em>
1021979
<a href="#templates.weave.works/v1alpha1.GitOpsSetStatus">GitOpsSetStatus</a>)
1022980
</p>
1023981
<p>ResourceInventory contains a list of Kubernetes resource object references that have been applied by a Kustomization.</p>
1024-
<div class="md-typeset__scrollwrap">
1025-
<div class="md-typeset__table">
1026982
<table>
1027983
<thead>
1028984
<tr>
@@ -1046,17 +1002,13 @@ or to include forks if true</p>
10461002
</tr>
10471003
</tbody>
10481004
</table>
1049-
</div>
1050-
</div>
10511005
<h3 id="templates.weave.works/v1alpha1.ResourceRef">ResourceRef
10521006
</h3>
10531007
<p>
10541008
(<em>Appears on:</em>
10551009
<a href="#templates.weave.works/v1alpha1.ResourceInventory">ResourceInventory</a>)
10561010
</p>
10571011
<p>ResourceRef contains the information necessary to locate a resource within a cluster.</p>
1058-
<div class="md-typeset__scrollwrap">
1059-
<div class="md-typeset__table">
10601012
<table>
10611013
<thead>
10621014
<tr>
@@ -1090,8 +1042,6 @@ string
10901042
</tr>
10911043
</tbody>
10921044
</table>
1093-
</div>
1094-
</div>
1095-
<div class="admonition note">
1096-
<p class="last">This page was automatically generated with <code>gen-crd-api-reference-docs</code></p>
1045+
<div>
1046+
<p>This page was automatically generated with <code>gen-crd-api-reference-docs</code></p>
10971047
</div>

hack/api-docs/template/members.tpl

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
<br/>
3737
<br/>
3838
<table>
39-
{{ template "members" .Type }}
39+
<tbody>
40+
{{ template "members" .Type }}
41+
</tbody>
4042
</table>
4143
{{ end }}
4244
</td>

0 commit comments

Comments
 (0)