Skip to content

Commit 169712f

Browse files
committed
future work + review
1 parent 551037a commit 169712f

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

content/en/blog/_posts/2020-12-04-gsod-2020-improving-api-reference-experience.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ Shortly after, the DocBook language was adopted to write the Linux Documentation
2121

2222
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/).
2323

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.
2525

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
3131

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.
3333

3434
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/).
3535

@@ -68,7 +68,7 @@ Here are the features of the new API Reference to be included in the official do
6868
- 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)
6969
- each page displays associated resources at the first level ; for example: Pod, PodSpec, PodStatus, PodList
7070
- 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 definitions are documented in a specific page (ex ObjectMeta)
71+
- some widely used definitions, such as `ObjectMeta`, are documented in a specific page
7272
- required fields are indicated, and placed first
7373
- 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)
7474
- `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
7878

7979
When the work is integrated, the API reference will be available at https://kubernetes.io/docs/reference/
8080

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+
8188
## Appreciation
8289

8390
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

Comments
 (0)