oreilly / couchdb-guide

CouchDB: The Definitive Guide
http://guide.couchdb.org/
501 stars 139 forks source link

Trailing space in code snippet breaks Attachments example #459

Open therealplato opened 12 years ago

therealplato commented 12 years ago

In the Attachments section of page http://guide.couchdb.org/editions/1/en/api.html the first code snippet reads:

> curl -vX PUT http://127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af/ 
artwork.jpg?rev=2-2739352689 --data-binary @artwork.jpg -H "Content-Type: 
image/jpg"

The space at the end of the first line (between the ID and artwork.jpg) breaks the command. I understand the need to separate this onto multiple lines, but note that the final line image/jpg" does not have a trailing space, and the second line (correctly) does have a trailing space. (so it's probably not an artifact put there by the parsing code.)

I hilighted the command and noted that there was a space at the end so I figured it was supposed to be there. As someone totally new to REST it took me a while to realize that the artwork.jpg?rev=foo was actually part of the URL, not another argument to curl.

Please remove this trailing space! I searched issues for "attachment" and noticed that this was apparently fixed in the draft version, but it still appears in this 1st edition.

janl commented 12 years ago

There is no space in the source, your browser should copy and paste this as a single line. What are you using?

therealplato commented 12 years ago

This happens in both Firefox 10.0.2 and Chrome 19.0.1041.0 dev-m on Windows 7. Screenshot: http://imgur.com/URwZA

When I highlight, copy, then paste the text into either vim or notepad++ it still has the extra space.

Why did you close this issue?

janl commented 12 years ago

Ah thanks, can you try http://guide.couchdb.org/draft/api.html? It should include the fix.

therealplato commented 12 years ago

There was a space in the source, I submitted a pull request. Did I do it right? https://github.com/oreilly/couchdb-guide/pull/461

janl commented 12 years ago

Yup, except that we treat editions/* as release tags and draft/ as master. I.e. development happens in draft and we don't alter editions/* after a release :)

therealplato commented 12 years ago

Looking at http://guide.couchdb.org/ from a user's POV the page design promotes "1st Edition" over "Draft." The 1st edition div are positioned above the Draft div. "Draft" is described as "work in progress" and offers to "help working on it." This immediately makes me think that Draft contents are probably still in flux, and if I want correct (if possibly dated) information I will click through to 1st edition.

I don't think I'm alone in this, I imagine nearly all readers click through to 1st edition from a similar train of thought.

If I understand you right, you're saying that no one will fix the typo in the 1st edition branch - the one everyone reads - because it's a policy to not modify this?

People were having this problem a year ago (https://github.com/oreilly/couchdb-guide/issues/386), eight months ago, (https://github.com/oreilly/couchdb-guide/issues/410) and now today. We'd obviously like to see it fixed.

If the editions/ branch is so sacrosanct, why not take a snapshot of draft/ and call it edition 1.1?

janl commented 12 years ago

Yeah, these are all great points, I was pondering solutions for a while as well. Maybe @nslater has an idea?

nomicode commented 12 years ago

I think we should accept this pull request. Sorry if I was unclear on IRC early Jan. I think of the 1st edition as being frozen in content. If we have markup bugs, we should definitely fix them. I also think that we should update the divs on the homepage.

sockdrawermoney commented 12 years ago

@therealplato @nslater I complete agree that the site appears to promote 1st Edition over the draft and that, if /draft is master, it should clearly be indicated as such and presented first.

I also came across a similar issue and fixed it here: https://github.com/adambrault/couchdb-guide/commit/17ab83d341d17877007577f45fa1bb6360b777a5 -- pull request here: https://github.com/oreilly/couchdb-guide/pull/462

I don't see value in keeping what are clear typographical errors in any promoted version.

ThoughtCrhyme commented 12 years ago

I just ran into this trailing whitespace problem too. Still an issue for people using firefox.