SassDoc / sassdoc

Release the docs!
http://sassdoc.com
MIT License
1.41k stars 56 forks source link

Why wipe the entire destination folder? #499

Closed mirisuzanne closed 7 years ago

mirisuzanne commented 7 years ago

For several of my projects, I don't need any site beyond the generated sassdoc output. I wish I could compile directly into a gh-pages/ directory, without losing all the git-init settings required to publish the output directly onto the web. In the end, I have to generate sassdoc into a subfolder, which then requires adding a redirect or unnecessary index page to the outer folder.

If sassdoc would remove non-dot-files instead of wiping the entire directory, I could avoid the extra nested directory. Is that possible?

Thanks for sass documentation!

KittyGiraudel commented 7 years ago

Hey Miri!

I think the reason we wipe the whole thing is because it’s easier for us to do so. I’m not sure there is any more rational than that behind that choice. Maybe @valeriangalliat remembers?

Regarding deploying a SassDoc project to gh-pages, we have sassdocify for that. Otherwise, I tend to do something like so:

"generate-doc": "sassdoc dist/index.scss sassdoc/ --verbose --config=.sassdocrc && echo 'Documentation successfully generated in sassdoc/index.html'",
"deploy-doc": "git add sassdoc/ && git commit -m 'Compile SassDoc' --allow-empty && git subtree push --prefix sassdoc origin gh-pages && echo 'Documentation successfully deployed to http://yourdomain.com/sassdoc'",
mirisuzanne commented 7 years ago

Oh, Sassdocify is interesting, but I'm running into some problems. The second time I use it, and try to cd .pages && git push -u origin gh-pages as instructed, I get an error:

To github.com:oddbird/true.git
 ! [rejected]        gh-pages -> gh-pages (fetch first)
error: failed to push some refs to 'git@github.com:oddbird/true.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
mirisuzanne commented 7 years ago

Oh, after fuzzing around for a bit, I finally got it working. I think the trick is making sure you fetch gh-pages from origin before running sassdocify the second time.