vmbrasseur / IAS3API

Documentation for the Internet Archive S3 API
Other
72 stars 13 forks source link

Fix code example formatting #14

Closed vmbrasseur closed 10 years ago

vmbrasseur commented 10 years ago

Reported by @tardispackrat via email:

On https://github.com/vmbrasseur/IAS3API/blob/master/examples/curl-create_video_item_with_metadata.md should the code example be formatted? Looks... off. Ditto: https://github.com/vmbrasseur/IAS3API/blob/master/examples/curl-update_metadata.md And again: https://github.com/vmbrasseur/IAS3API/blob/master/examples/curl-upload_text_item.md And again: https://github.com/vmbrasseur/IAS3API/blob/master/examples/curl-upload_to_existing_item.md And again: https://github.com/vmbrasseur/IAS3API/blob/master/examples/curl-upload_video_item.md And again: https://github.com/vmbrasseur/IAS3API/blob/master/examples/curl-upload_video_with_metadata.md

Huh. Not sure what happened there. I'll have a look.

vmbrasseur commented 10 years ago

Ah!

The problem is that the leading whitespace (which tells MD to display as a code) is a combo of tabs and spaces.

vmbrasseur commented 10 years ago

Hrm. That commit doesn't seem to have fixed it. It cleaned up plenty of OTHER stuff, but not the code formatting.

Testing an example here:

curl --location \
    --header 'x-archive-ignore-preexisting-bucket:1' \
    --header 'x-archive-meta01-collection:opensource' \
    --header 'x-archive-meta-mediatype:texts' \
    --header 'x-archive-meta-title:Fancy new title' \
    --header "authorization: LOW $accesskey:$secret" \
    --upload-file /dev/null \
http://s3.us.archive.org/sam-s3-test-08

Interesting. That looks good in this preview but not in the final doc. This example was cut&pasted from the latest version of curl-update_metadata.md.

vmbrasseur commented 10 years ago

It may be some odd MD parser bug having to do with an ordered list immediately followed by a code block. When I add a horizontal rule between the two the code block formats correctly.

vmbrasseur commented 10 years ago

Confirmed: these two commits fixed the problem.

Thank you, @tardispackrat, for spotting this!