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

Bring back the /docs directory #12037

Merged
merged 9 commits into from Dec 31, 2013
Merged

Bring back the /docs directory #12037

merged 9 commits into from Dec 31, 2013

Conversation

mdo
Copy link
Member

@mdo mdo commented Dec 29, 2013

This moves all documentation files to a /docs subdirectory to help clean up the file tree. Here are some thoughts on what's changed and why it matters.

  • All .html files, /examples, and Jekyll directories have been moved to a subfolder, /docs.
  • By far the biggest win is organization. It cleans up the file tree for beginners who have no idea what some of this stuff is and makes it easier for us as maintainers (@twbs/team) to stare at this stuff all day.
  • By far the biggest downside is that this duplicates some code. However, I've tried to keep that to a minimum by only bringing over the minified CSS and JS files. All the fonts are duped though.
  • As part of this, the _config.yml file has been cleaned up. Nested configs look way better. I was also able to remove all the exclude lists since the stuff we really need to compile the docs is now all in one spot, free of extra noise.
  • I've also replaced all instances of {{ page.base_url }} with {{ site.baseurl }}. Better to use an official config setting than a custom one on each page. This does, however, mean that folks who fork Bootstrap need to change the baseurl option in Jekyll if they wish to host our docs themselves. I'm not worried in the slightest about this.

By moving the Jekyll folders, our examples, docs assets, HTML files, and docs license to the subdirectory, we effectively lose 13 items from the root directory. The root file tree looks like this now:

├─ dist/
├─ docs/
├─ fonts/
├─ js/
├─ less/
├─ test-infra/
├─ .csscomb.json
├─ .csslintrc
├─ .editorconfig
├─ .gitattributes
├─ .gitignore
├─ .travis.yml
├─ CNAME
├─ CONTRIBUTING.md
├─ Gruntfile.js
├─ LICENSE
├─ README.md
├─ _config.yml
├─ bower.json
├─ composer.json
└─ package.json

It's a bit better, but could still use some cleanup. I'm curious if we could punt any of those other files somewhere else. It'd be great if a repo could just have a .files/ directory for this stuff.

/cc @fat, because <3.

@mdo
Copy link
Member Author

mdo commented Dec 29, 2013

Unrelated, but why are all our builds failing? @fat, Travis says the qunit tests are fubared—perhaps something you did in the last week?

@cvrebert
Copy link
Collaborator

@mdo There's some recent mild wonkiness in the Sauce service or toolchain with a couple of the browser/OS combos; don't think it's an actual problem in our JS. (Might be a bad version update on their end or something.)

@mdo
Copy link
Member Author

mdo commented Dec 29, 2013

@cvrebert Gah, okay. Anything we can do? Even if it's just to connect with them? And let me know your thoughts on this PR, too, please :).

@cvrebert
Copy link
Collaborator

(Although the fact that our QUnit version is so outdated can't be helping things; see #11240).

@cvrebert
Copy link
Collaborator

@mdo @fat: I stand corrected. We are getting some real JS errors; the grunt plugin is just not reporting this fact very well (again, possibly due to old QUnit).

(And for that matter, OS X Firefox has been failing 1 tooltip test for a while, which is why it's been disabled in our Sauce config, along with all IE versions... 😞 Would be nice if we could get all the platforms enabled+passing again.)

@@ -196,6 +196,23 @@ module.exports = function (grunt) {
expand: true,
src: ['fonts/*'],
dest: 'dist/'
},
dist_css: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be in mixedCase per JS convention? Or is there a Grunt convention for task naming?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, perhaps include "doc" or "docs" in the names of these new tasks?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@cvrebert
Copy link
Collaborator

I think it's definitely a net win to do this move.

@mdo
Copy link
Member Author

mdo commented Dec 31, 2013

I stand corrected. We are getting some real JS errors; the grunt plugin is just not reporting this fact very well (again, possibly due to old QUnit).

@cvrebert Let's open a new issue and ping @fat about that stuff. In the mean time, perhaps we comment those out again to get some green back in our lives?

@@ -199,6 +199,23 @@ module.exports = function (grunt) {
expand: true,
src: ['fonts/*'],
dest: 'dist/'
},
docsDistCss: {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can replace all three targets

docs: {
    expand: true,
    cwd: './dist',
    src: [
        '{css,js}/*.min.*',
        '{css,js}/*.map',
        'fonts/*'
    ],
    dest: 'docs/dist'
}

cwd: './dist',
src: [
'{css,js}/*.min.*',
'{css}*.map',
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, this is my bad from the original snippet. There should be a / after {css}

Copy link
Member Author

Choose a reason for hiding this comment

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

Nah, it was my fault I think—I changed the line to not include ,js within the braces (unless you edited the comment). Either way, all set :).

Copy link
Contributor

Choose a reason for hiding this comment

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

😉 I did edit it a second or two after I posted

mdo added a commit that referenced this pull request Dec 31, 2013
Bring back the `/docs` directory
@mdo mdo merged commit 8812856 into master Dec 31, 2013
@mdo mdo deleted the docs_dir branch December 31, 2013 21:43
@mdo mdo mentioned this pull request Dec 31, 2013
cvrebert added a commit that referenced this pull request Jan 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants