Skip to content
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

docs: admin api headers #5662

Merged
merged 4 commits into from
Mar 16, 2020
Merged

docs: admin api headers #5662

merged 4 commits into from
Mar 16, 2020

Conversation

kikito
Copy link
Member

@kikito kikito commented Mar 11, 2020

This change on the autodoc for the Admin API improves legibility on the Admin API headers and tables.

This has a sister PR in Kong/docs.konghq.com#1851

This change modifies the admin api generation in two ways:

* Adds a new "indent" css class to certain elements. This should increase those element's left margin.
* Replaces some "bold text sections" (markdown sections whose title was bold text instead of a header) by "real sections" (markdown sections with headers). The reason we used bold text was to prevent it from appearing on the automated nav tables, but that is not a problem any more (nav tables only look at levels >= 3).
This introduces a max_level (value = 3) beyond which links will not be generated. In other words all h4 and h5s will be skipped when generating the Admin API navigation.
kikito added a commit to Kong/docs.konghq.com that referenced this pull request Mar 11, 2020
This regenerates the Admin API docs using the changes included in
Kong/kong#5662, which involve:

* Replacing some "fake bold letters headers" with real headers
* Adding the `indent` class to some of the generated headers and tables
@@ -1104,8 +1104,9 @@ return {
to the field [health checker's threshold][healthchecks.threshold].
]],
endpoint = [[
<div class="endpoint get">/upstreams/{name or id}/health/</div>
<div class="endpoint get indent">/upstreams/{name or id}/health/</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh boy, I wish I had abstracted this div tag away back in the day

This table was a little too wide for our docs website. I have slightly reworded things so that it properly fits.
The current version of the PR generates some very long field names, like `healthchecks.active.unhealthy.tcp_failures`, as well as some very long default values, like `[200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308]`.

These very wide values are problematic when included inside tables, as code blocks (html does not know how to split them up, so they end up maximizing the tables, breaking layout and style).

This change adds some "word breaks" (`<wbr>`) inside some of those long code blocks when they are inside tables, so that the browser knows it can break them at those points, fixing the table formatting issues.
kikito added a commit to Kong/docs.konghq.com that referenced this pull request Mar 13, 2020
This regenerates the Admin API docs using the changes included in
Kong/kong#5662, which involve:

* Replacing some "fake bold letters headers" with real headers
* Adding the `indent` class to some of the generated headers and tables
* Splitting long field names and default values with word breaks
  so that they don't break table layouts
@kikito
Copy link
Member Author

kikito commented Mar 13, 2020

Thanks for the approvals! I added a couple new changes in order to deal with wrongly formatted tables (unrelated with the other issues fixed on this PR), hopefully the docs people will be satisfied with those.

@kikito kikito merged commit 86477b6 into master Mar 16, 2020
@kikito kikito deleted the docs/admin-api-headers branch March 16, 2020 15:55
GayleNeumann added a commit to Kong/docs.konghq.com that referenced this pull request Mar 20, 2020
* style(base/docs) tweak the heading sizes in docs

This change increases the size difference of some of our docs headers.
h1 gets slightly bigger, h6 gets significantly smaller. The rest of the headings are evenly distributed on the now wider gap.

* style(docs) add a new .indent style for increasing indentation in docs

* docs(2.0.0) regenerate admin API docs

This regenerates the Admin API docs using the changes included in
Kong/kong#5662, which involve:

* Replacing some "fake bold letters headers" with real headers
* Adding the `indent` class to some of the generated headers and tables
* Splitting long field names and default values with word breaks
  so that they don't break table layouts

* Update app/2.0.x/admin-api.md

Co-Authored-By: lena-larionova <54370747+lena-larionova@users.noreply.github.com>

Co-authored-by: Gayle Neumann <55467607+GayleNeumann@users.noreply.github.com>
Co-authored-by: lena-larionova <54370747+lena-larionova@users.noreply.github.com>
@hutchic hutchic added this to the 2.0.3 milestone Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants