You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/blog/_posts/2020-12-04-gsod-2020-improving-api-reference-experience.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,15 +21,15 @@ Shortly after, the DocBook language was adopted to write the Linux Documentation
21
21
22
22
The [Kubernetes documentation website](https://kubernetes.io/docs/home/) is built with Hugo from documentation written in Markdown format in the [website repository](https://github.com/kubernetes/website), using the [Docsy Hugo theme](https://www.docsy.dev/about/).
23
23
24
-
The existing API reference documentation is a large HTML file generated from the Swagger specifications of the API, added to the content of the website.
24
+
The existing API reference documentation is a large HTML file generated from the Kubernetes OpenAPI specification.
25
25
26
-
This API reference has some drawbacks:
27
-
-it is a single huge HTML page containing all the API reference
28
-
-its format is not adapted to mobile reading
29
-
-its design is not integrated with the kubernetes.io/docs website
30
-
-its content cannot be referenced by search engines
26
+
On my side, I wanted for some time to make the API Reference more accessible, by:
27
+
-building individual and autonomous pages for each Kubernetes resource
28
+
-adapting the format to mobile reading
29
+
-reusing the website's assets and theme to build, integrate, and display the reference pages
30
+
-allowing the search engines to reference the content of the pages
31
31
32
-
On my side, I wanted for some time to make the API Reference more accessible. Around one year ago, I started to work on the generator building the current unique HTML page, to add a DocBook output, so the API Reference could be generated first in DocBook format, and after that in PDF or other formats supported by DocBook processors. The first result has been some [Ebook files for the API Reference](https://github.com/feloy/kubernetes-resources-reference/releases) and an auto-edited paper book.
32
+
Around one year ago, I started to work on the generator building the current unique HTML page, to add a DocBook output, so the API Reference could be generated first in DocBook format, and after that in PDF or other formats supported by DocBook processors. The first result has been some [Ebook files for the API Reference](https://github.com/feloy/kubernetes-resources-reference/releases) and an auto-edited paper book.
33
33
34
34
I decided later to add another output to this generator, to generate Markdown files and create [a website with the API Reference](https://web.archive.org/web/20201022201911/https://www.k8sref.io/docs/workloads/).
35
35
@@ -68,7 +68,7 @@ Here are the features of the new API Reference to be included in the official do
68
68
- the resources are categorized, in the categories Workloads, Services, Config & Storage, Authentication, Authorization, Policies, Extend, Cluster. This structure is configurable with a simple [`toc.yaml` file](https://github.com/kubernetes-sigs/reference-docs/blob/master/gen-resourcesdocs/config/v1.20/toc.yaml)
69
69
- each page displays associated resources at the first level ; for example: Pod, PodSpec, PodStatus, PodList
70
70
- most resource pages inline relevant definitions ; the exceptions are when those definitions are common to several resources, or are too complex to be displayed inline. With the old approach, you had to follow a hyperlink to read each extra detail.
71
-
- some widely used definitionsare documented in a specific page (ex ObjectMeta)
71
+
- some widely used definitions, such as `ObjectMeta`, are documented in a specific page
72
72
- required fields are indicated, and placed first
73
73
- fields of a resource can be categorized and ordered, with the help of a [`fields.yaml` file](https://github.com/kubernetes-sigs/reference-docs/blob/master/gen-resourcesdocs/config/v1.20/fields.yaml)
74
74
-`map` fields are indicated. For example the `.spec.nodeSelector` for a `Pod` is `map[string]string`, instead of `object`, using the value of `x-kubernetes-list-type`
@@ -78,6 +78,13 @@ Here are the features of the new API Reference to be included in the official do
78
78
79
79
When the work is integrated, the API reference will be available at https://kubernetes.io/docs/reference/
80
80
81
+
### Future Work
82
+
83
+
There are points to improve, particularly:
84
+
85
+
- some Kubernetes resources are deeply nested. Inlining the definition of these resources makes them difficult to understand
86
+
- the created `shortcode` uses the URL of the page to reference a Resource page. It would be easier for the technical writers if they could reference a Resource by its group and name
87
+
81
88
## Appreciation
82
89
83
90
I would like to thank my mentor [Zach Corleissen](https://github.com/zacharysarah) and the lead writers [Karen Bradshaw](https://github.com/kbhawkey), [Celeste Horgan](https://github.com/celestehorgan), [Tim Bannister](https://github.com/sftim) and [Qiming Teng](https://github.com/tengqm) who supervised me during all the season. They all have been very encouraging and gave me tons of great advice.
0 commit comments