-
Notifications
You must be signed in to change notification settings - Fork 687
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
Update image-layout.md: fix json format in practice #453
Conversation
@@ -21,7 +21,7 @@ It also contains a file that is used to identify the layout version: | |||
|
|||
This is an example image layout: | |||
|
|||
``` | |||
```shell |
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 language specification if for the shell language, but the following example is a shell session. It has both shell-language input (which the shell
you add formats correctly) and unformatted output (which the shell
you add also attempts to format). As an example:
$ echo "in this case, these are not shell keywords"
in this case, these are not shell keywords
I'd rather leave these as language-agnostic blobs to avoid confusion.
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.
console
is the right directive.
@wking I'd recommend at least looking at the github markdown docs before giving direction on a PR.
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 know shell
is wrong for shell sessions, because I've made that mistake before myself. Looking at the Linguist docs, they have a separate ShellSession
for these:
$ echo "in this case, these are not shell keywords"
in this case, these are not shell keywords
Which is better than the shell
version I posted earlier because the stdout in
and case
are not highlighted. Linguist is using atom/language-shellscript.
``` | ||
$ cat ./refs/v1.0 | ||
{"size": 4096, "digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f", "mediaType": "application/vnd.oci.image.manifest.list.v1+json"} |
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'm agnostic about whether we pretty-print JSON output or not, although if we do I prefer jq
;).
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.
jq
is the current json de jour. I agree.
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.
+1 on jq
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 feel strongly on this but jq is the right thing to use in 2016
``` | ||
$ cat ./refs/v1.0 | ||
{"size": 4096, "digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f", "mediaType": "application/vnd.oci.image.manifest.list.v1+json"} |
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.
+1 on jq
fixed. |
{ | ||
"size": 4096, | ||
"digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f", | ||
"mediaType": "application/vnd.oci.image.manifest.list.v1+json" |
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.
jq will use two-space indents by default.
@@ -24,7 +24,7 @@ The image layout MUST also contain a file that is used to identify the layout ve | |||
|
|||
This is an example image layout: | |||
|
|||
``` | |||
```shell |
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.
@Sn0rt can you make this change?
Signed-off-by: Sn0rt <[email protected]>
PTAL |
In real world, if you do not format the output of cat, it will be so ugly.
And the original document may generate through imagination.
Example:
Formated:
Signed-off-by: Sn0rt [email protected]