Skip to content
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

version docs (fixes #121) #245

Merged
merged 3 commits into from
Jun 2, 2016
Merged

version docs (fixes #121) #245

merged 3 commits into from
Jun 2, 2016

Conversation

ngokevin
Copy link
Member

@ngokevin ngokevin commented May 16, 2016

Problem is we are currently only showing master/ docs on aframe.io which gives people incorrect information as most users are on 0.2.0. Default to 0.2.0 docs and add a dropdown to switch between them. The only con is not being able to upstream typo fixes in the 0.2.0 docs since that would involve cherry-picking and too much effort. But at least we show the shiny master/ version

  • Use multidep to install multiple versions of A-Frame.
  • docs/0.2.0 symbolic links to multidep/. docs/master symbolic links to node_modules/.
  • Paths changed from docs/<docpath> to docs/<VERSION>/<docpath>. Include redirects
  • Filter docs in EJS to the currently-viewing version
  • dropdown to switch between versions
  • set currently-viewed version to set correct filter
  • Import 0.1.0 docs
  • Automatically have all doc links go directly to the first page of the docs rather than rely on the redirect
  • Smart sort doc nav

Other:

  • Defaults to stable/current version (which is 0.2.0 right now).
  • Simplify redirect data structure

screen shot 2016-05-16 at 5 27 25 pm

screen shot 2016-05-16 at 5 16 16 pm

@ngokevin ngokevin changed the title [WIP] version docs version docs (fixes #121) May 17, 2016
@ngokevin ngokevin force-pushed the vdocs branch 2 times, most recently from f55bde7 to dd36af0 Compare May 17, 2016 00:30
ngokevin referenced this pull request in joliss/node-multidep May 17, 2016
@@ -30,7 +32,12 @@ And then link `aframe-site` to `aframe`:
cd aframe-site
npm link aframe

Then the documentation will update as you work on them from the A-Frame repository. This works because we have pointed the A-Frame site, via a soft symbolic link, to the documentation installed in `node_modules/aframe/docs/`.
Then the `master` documentation will update as you work on them from the
A-Frame repository. This works because we have pointed the A-Frame site, via a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link to repo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anything else for this PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll review it thoroughly tomorrow. thanks for this.

@cvan
Copy link
Contributor

cvan commented May 20, 2016

is there any way we can test with writing new docs for new versions but hide that version until it's ready and released? maybe some local dev flag. we should have one / be able to add one easily with hexo plugins (maybe browsersync).

@ngokevin
Copy link
Member Author

OK, I'll try

@ngokevin
Copy link
Member Author

Actually, the new docs are just master docs. They won't show by default like they are now, and there will be a dropdown in the versions dropdown to view master docs.

@ngokevin
Copy link
Member Author

^ So nothing else needed to be done so far.

"generate": "hexo generate",
"predeploy": "hexo clean",
"deploy": "hexo deploy && open 'https://aframe.io/'",
"pretest": "multidep multidep.json",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was not obvious to me that I had to run npm run pretest before the symlinks would work. perhaps call this too w/ postinstall.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, i was following a guide that was doing this for testing. thanks for catching

@cvan
Copy link
Contributor

cvan commented May 24, 2016

  1. load http://localhost:4000/docs/master/components/canvas.html
  2. hover over "Core" heading link in the sidebar
  3. notice the URL is http://localhost:4000/docs/core/ but then redirects to http://localhost:4000/docs/master/core/

can we fix those URL routes so we're not redirecting? because we don't have server-side redirects for any of these (yet, though I can manually add them all to our CloudFlare Page Rules), this is actually quite slow - even locally.

<a href="<%- page_url(page.path) %>" class="guide-link guide-link-left">
← <%= page.title %>
</a><
/span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this newline before actually breaks things:

image

@cvan
Copy link
Contributor

cvan commented May 24, 2016

looking great! let me know when to take another look

@ngokevin
Copy link
Member Author

OK, hope I got everything.

  • Old pre-versioned doc links (e.g.,/docs/guide/ will route to 0.2.0 docs forever in case those pages disappear in the future).
  • To solve the sidebar doc link confusion going to 0.2.0 when you may be on another version, I replaced the Guide/Install links with one Docs link that is active/disabled whenever you are browsing the docs. Then all documentation navigation is done through the docs nav.

@ngokevin
Copy link
Member Author

@cvan ready

@ngokevin
Copy link
Member Author

At your earliest convenience! Somewhat antsy about this one since the documentation is wrong for 0.2.0 and people have been running into the same breaking changes and getting confused (e.g., cursor- prefix added).

@cvan
Copy link
Contributor

cvan commented May 31, 2016

no worries - testing now, will provide feedback momentarily

var versions = aframeVersions.slice(0);
var currentVersionIndex = versions.indexOf(currentVersion);
versions.splice(currentVersionIndex, 1);
return [currentVersion, MASTER].concat(versions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems odd to me that MASTER appears below not above 0.2.0? don't we want to sort chronologically?

image

can we change that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, changed.

previous reasoning was in order of relevance, but yeah it was weird.

@ngokevin ngokevin force-pushed the vdocs branch 2 times, most recently from 5fb670d to 10f5429 Compare May 31, 2016 23:38
['docs/core/templates.html', 'https://github.com/ngokevin/aframe-template-component'],
['docs/guide/cameras-and-lights.html', 'docs/guide/building-a-basic-scene.html'],
['docs/guide/entering-vr.html', 'http://mozvr.com/#start'],
['docs/guide/installation.html', 'docs/guide/getting-started.html'],
Copy link
Contributor

@cvan cvan May 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand your point correctly, this redirect was before we were versioning. We wanted to redirect docs/guide/installation (0.1.0) to docs/guide/getting-started.html (0.2.0). Now that we have a version prefix, we don't necessarily have to redirect the 0.1.0/guide/installation.html since that page exists now.

I think I will version the destination of these redirects though so that we're not constantly updating these on each release.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I versioned the old redirects: https://github.com/aframevr/aframe-site/pull/245/files#diff-f38517d4dd3fc581f64643b3dd59e408R20

It's a bit confusing to think about, but I believe this makes sense, and users with old links should end up in the appropriate places.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which of the following should docs/guide/installation.html redirect to?

  • docs/guide/getting-started.html
  • docs/guide/0.1.0/installation.html
  • docs/guide/0.1.0/getting-started.html
  • docs/guide/0.2.0/installation.html
  • docs/guide/0.2.0/getting-started.html

Copy link
Member Author

@ngokevin ngokevin Jun 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose docs/0.2.0/guide/getting-started.html to keep things the way they are currently.

docs/0.1.0/guide/installation.html is more accurate. But not sure about having redirected to 0.2.0 and then suddenly redirecting it back to 0.1.0.

@cvan
Copy link
Contributor

cvan commented Jun 1, 2016

I just pulled, and http://localhost:4000/docs/ / http://localhost:4000/docs/0.2.0/guide/ no longer works

@ngokevin
Copy link
Member Author

ngokevin commented Jun 1, 2016

^ Did you run the new postinstall?

Updated everything, last thing I need to do is remove unnecessary redirects by assigning a index page front matter variable so we know what is the first page of the docs, and then polyfilling that for old versions that won't have that front matter.

@ngokevin
Copy link
Member Author

ngokevin commented Jun 1, 2016

Actually, I can filter order: 1 / section_order: 1 to determine the first page of the docs :)

@ngokevin
Copy link
Member Author

ngokevin commented Jun 1, 2016

OK, all complete. Most recent commit has changes for deducing the first page of the docs.

@ngokevin
Copy link
Member Author

ngokevin commented Jun 2, 2016

🐛

@cvan
Copy link
Contributor

cvan commented Jun 2, 2016

🐹 👀

@cvan
Copy link
Contributor

cvan commented Jun 2, 2016

looks like "Install" nav link is removed. IMO, we should have a very prominent "Install" or "Download" link:

image
image
image
image

will file separately.


filed #268

@cvan cvan removed the needs review label Jun 2, 2016
@cvan
Copy link
Contributor

cvan commented Jun 2, 2016

r+ this all looks great to me.

🎉 fantastic work, man!

@ngokevin
Copy link
Member Author

ngokevin commented Jun 2, 2016

re: installed, Agreed. I don't think it was prominent where it was anyways.

@ngokevin
Copy link
Member Author

ngokevin commented Jun 2, 2016

Thanks for the detailed review!

@ngokevin ngokevin merged commit d7f4f9a into aframevr:master Jun 2, 2016
@ngokevin ngokevin mentioned this pull request Jun 3, 2016
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants