-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Fix list formatting in kubeadm setup tutorial #8663
Fix list formatting in kubeadm setup tutorial #8663
Conversation
/assign @MistyHacks |
Deploy preview for kubernetes-io-master-staging ready! Built with commit 51c1e7f https://deploy-preview-8663--kubernetes-io-master-staging.netlify.com |
yikes, this is horrible. not your efforts @tfogo, but rather the underlying bugs... @tfogo @MistyHacks WDYT? |
@neolit123 I know! It's a pretty awkward bug, particularly for our yaml heavy use case. There's been open PR to fix it for several months (russross/blackfriday#372). Unordered lists are also affected by the bug, unfortunately. I think manual ordering might work well in some cases. We could manually number each item in the list, but multi-paragraph list items won't be properly indented. Which means they aren't visually grouped together. Alternatively, we could signpost with bolded text (e.g. Step 1:, Step 2:). Whatever is decided, it might be useful to add a note to the style guide (similar to the Common Shortcode Issues section). |
i personally i like this solution. if the ordering is broken at the backend we should write the steps ourselves. |
There is a slightly cleaner way to fix this. Let me add a commit. |
OK, I added my commit. What I did was this:
|
ed6dd39
to
973eb96
Compare
/lgtm @tfogo please ack my content changes here. The output looks fine to me now, though the sub-lists look kind of ugly. If you agree, maybe file a GH issue for CSS. |
@MistyHacks Thanks, looks cleaner for sure! One awkward thing about indenting block-level things inside lists an extra tabstop is that code blocks all have two spaces before each line. This is a bit awkward for copy-paste. Particularly with commands that are piping a heredoc to a file. Do you have any thoughts on this? |
``` | ||
|
||
{{< note >}} | ||
**Optional:** You can modify `ca-csr.json` to add a section for `names`. See [the CFSSL wiki](https://github.com/cloudflare/cfssl/wiki/Creating-a-new-CSR) for an example. |
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.
This outputs the contents in a code block due to the indentation. Putting it all on one line would fix this.
|
||
**Note:** If you are using Kubernetes 1.9+, you can replace the `apiserver-count: 3` extra argument with `endpoint-reconciler-type: lease`. For more information, see [the documentation](/docs/admin/high-availability/#endpoint-reconciler). | ||
{{< note >}} | ||
**Note:** If you are using Kubernetes 1.9+, you can replace the `apiserver-count: 3` extra argument with `endpoint-reconciler-type: lease`. For more information, see [the documentation](/docs/admin/high-availability/#endpoint-reconciler). |
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.
Same issue with this one.
Added a fix for the shortcodes - I know it's ugly that they're on the same line. If you know of a better fix, let me know :) |
```shell | ||
export PEER_NAME=$(hostname) | ||
export PRIVATE_IP=$(ip addr show eth1 | grep -Po 'inet \K[\d.]+') | ||
``` |
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.
can we just leave everything aligned to the left? i don't think it looks bad without it.
once the ordered list bugs are fixed we just have to modify the digits and the extra space and the alignment will be auto-added; if i understand this correctly, that is...
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.
I don't think leaving everything aligned to the left is necessary. The sublist bug only affects two code blocks and we've edited it in such a way that they're no longer affected. So we have the list indentation being rendered correctly and there are no sublist bugs.
And we have no idea when a fix to this bug will make its way into Hugo.
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.
Leaving everything aligned to the left seems to sometimes work and sometimes not. Indenting everything a level seems to always work. I think we have to teach contributors how to contribute docs in the way that creates the least amount of cognitive load, so it's easier to give guidance to always indent things inside lists another level.
There are multiple bugs with Hugo / BlackFriday and list handling. One is the "bullet lists" inside code blocks (which has the likelihood of screwing up lots of YAML code blocks, cc/ @steveperry-53 who raised this yesterday). The other is the very loosely deterministic way that nested lists and nested content inside lists is handled, depending on the indentation level. The second one seems to be "working as intended" / "not defined in the Markdown spec", so I have no optimism about it getting fixed. |
{{% /tab %}} | ||
{{< /tabs >}} | ||
|
||
|
||
|
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.
Nit: This probably can be reverted (did I do this?)
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.
My bad! I'll fix that.
@MistyHacks I'm working with the author of this PR (russross/blackfriday#372) to fix the lists inside code blocks issue with blackfriday. I'm hopeful that we can get that fix merged in soon. :) |
aba6da3
to
e972e52
Compare
@MistyHacks I fixed that newline and rebased. Do you have any thoughts on the code blocks having an extra two spaces? I mentioned above that it can be awkward for copy-pasting heredocs. I don't think it's a huge issue - but it might be good to revisit it when blackfriday is acting more predictable. |
As to code blocks vs copy and paste, you may consider using the "table format", which should give you copy-and-paste friendly blocks. See example here: https://github.com/linode/docs A big Hugo docs site (bigger than Kubernetes) with lots of code examples. No complaints about extra spaces, so might be a good source of inspiration. |
More on removing code formatting from headers: this is what was happening. @MistyHacks Any recommendation about how to proceed here? |
@tfogo if you could please rebase/resolve conflicts, we can get this merged. It also looks as though your HTML comment about code fencing appears in the config file example -- please remove :-) |
eebee10
to
5345332
Compare
This became a mess because a lot of these fixes have actually already been made in master. I worked with @Bradamant3 to figure out which changes were unique to this PR and I re-applied those, and also fixed an issue I saw with the tabs in the content and another with a skip in heading order level. |
5345332
to
a28f5aa
Compare
a28f5aa
to
51c1e7f
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Bradamant3 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@MistyHacks @Bradamant3 Thank you for going through and doing that. FYI, we've fixed the blackfriday issue in v2 (russross/blackfriday#372) but still need to backport to v1 for Hugo. |
There is an issue with ordered lists in the Creating HA clusters with
kubeadm setup tutorial. All list items are labeled 1. This is because
the underlying markdown processor for Hugo, blackfriday, requires
list items with multiple paragraphs to have four space indentation.
(See russross/blackfriday#244)
This commit adds an extra space before paragraphs in lists so they are
correctly interpreted as multi-paragraph lists.
However, this exposes a bug in blackfriday where lines beginning with
-
in codefenced code blocks inside lists are parsed as sub-lists.This means code fenced code blocks inside lists that contain yaml are
malformed. (See russross/blackfriday#239)
So this commit mitigates this bug in two situations. It uses a 4-space
indented code block in one situation. In another situation where a list
only contained one element, it is no longer a list.