-
Notifications
You must be signed in to change notification settings - Fork 40
Removed $ symbol from code blocks in the Docs #392
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Santosh Kaluskar <[email protected]>
✅ Deploy Preview for osm-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
For snippets where the output is displayed along with the command, having the $
symbol distinguishes the command from its output, otherwise, it can be hard to know whether these are multiple commands or if it's the output of a single command. For console
blocks, I feel having the $
symbol helps.
I agree with @shashankram that the '$' does represent the command. We could put output in it's own block <``> if that makes it clearer, but not sure that is necessary. |
I agree, that this is a matter to be deliberated upon. As many code blocks do have a command and an output combined in a block. That would surely confuse the users in distinguishing the command to operate and the output to expect from it. I tried a solution to omit the My suggestion for that kind of code block would be to separate the input and output codes. And, to display the output in a separate indented code block or add an views appreciated! |
It seems like a better solution would be to remove the selection of the dollar sign in code block selection. I am not familiar with the internals of how this can be achieved with Hugo, but you might find theme-next/hexo-theme-next#448 (comment) useful. |
Thanks for the link @shashankram, I went into the rabbit hole. But, could not get hold of the implementation process. I also found an option to escape the How do you propose we move on from here? |
I'd recommend separating the command into one code fence without the |
Thanks for the suggestion. I hope you are suggesting this format: |
I am not very familiar with Hugo and CSS, but there should be a way to achieve this. |
Based on my research, this should be possible using Hugo shortcodes. You would need to:
|
@Santosh1176 I spent time researching the options, and it seems like we would need to use a combination of Hugo shortcodes and embedded format blocks, and then disable $ selection at the start of the line for specific command blocks. I am afraid testing this across all the docs is not going to be easily feasible, so unless we are 100% certain this works, it may not be a good idea as I initially thought. Simplest would be to do the following for
E.g. kubectl get service The output is similar to:
|
@shashankram Thanks for the reply, I am trying to wrap my head around Hugo Shortcodes but, I feel it's a bit hard to implement it on all of the osm docs. I agree with your suggestion of initially separating the commands without the |
That seems good to me. I'll let other maintainers on the project comment on it if they have any hesitation with this approach. Since I have looked into using shortcodes + preformatted blocks, I think I can confidently say the approach to split the console blocks into 2 bash blocks as suggested in #392 (comment) would work best. Also don't forget to update/rebase your tree as it is out of sync with main. |
Looks like this PR will also resolve #374 |
Signed-off-by: Santosh Kaluskar <[email protected]>
Hi, I've modified the code blocks to show the command and the output in separate code blocks. I've only made changes to the DEMO section of the docs. Could someone please review the changes? Also, I've updated the tree by pulling the latest history. I am getting some merge conflicts can someone please help me with that. |
I'm fine moving from using bash to console in the docs. We can update this as the primary method of showing commands in a terminal. |
thanks @Santosh1176 you'll need to pull in the latest changes to resolve the conflicts. I'd also like to see all the docs updated for consistency, but i understand its a lot of work. If you don't have the bandwidth to include updating the rest of the docs in this PR, please add a comment and we'll find a way to work around it. |
Thanks @zr-msft for reviewing the PR. Let me resolve the issues along with latest changes. Then I'll start with the updating the remaining docs. |
@zr-msft is this good to merge? I'm trying to close out all relevant PRs for the project. Thanks. |
@phillipgibson no, see the below conflicts that would need to be resolved before merging |
@Santosh1176 are you looking to fix the outstanding issues to have this get merged? If not we'll close this out by the end of the week. It's been idle since Sept '22. |
Signed-off-by: Santosh Kaluskar [email protected]
Removed all the
$
symbol from the code blocks in the docs, eliminating the possibility of copying the$
to the clipboard using the copy button.This PR resolves Issue #375