Skip to content

Include gh-import source in MkDocs to solve windows path issues. #547

Closed

Description

@w3guy

I wana publish my doc to a github page, i can't seem to get it to work with mkdocs gh-deploy but i know how to do with via

Checking out the gh-pages branch and committing the site folder to GitHub.

Activity

  1. d0ugal commented on May 23, 2015

    @d0ugal
    Contributor

    Not really, there is very little to it. What happens when you run mkdocs gh-deploy?

  2. w3guy commented on May 23, 2015

    @w3guy
    Author

    It shows deploy successful but doesn't show up in GitHub

    On Sat, May 23, 2015 at 2:14 PM, Dougal Matthews [email protected]
    wrote:

    Not really, there is very little to it. What happens when you run mkdocs
    gh-deploy?

    —
    Reply to this email directly or view it on GitHub
    #547 (comment).

  3. d0ugal commented on May 23, 2015

    @d0ugal
    Contributor

    What URL does the go and display? What repo is it? Send over as many details as you can.

  4. waylan commented on May 24, 2015

    @waylan
    Contributor

    @collizo4sky has a point. There are absolutely no instructions anywhere for how to use ghp-deploy. For example, he could be missing any of the following (which I agree all seem obvious because I know how it works--but to a newcomer, maybe not so much):

    1. Clone the relevant repo from Github
    2. Checkout the branch which holds the unrendered docs (not the gh-pages branch).
    3. Make sure the docs render properly (using mkdocs build and/or mkdocs serve). If not, fix, commit, and push your changes (not to the gh-pages branch).
    4. From within the working tree of your repo (not the gh-pages branch), run mkdocs ghp-deploy.

    That's it. The deploy command will build the docs, commit them to the gh-pages branch, and push the gh-pages branch to Github for you all in one step. It is important to note that "You should never edit files in your gh-pages branch by hand if you're using this script because you will lose your work."

    That last sentence was taken directly from the docs for the ghp-import tool, which mkdocs uses under the hood. And while ghp-import does not push by default, mkdocs ghp-deploy does (and in fact the default behavior cannot be overridden--which may or may not be a good idea).

  5. w3guy commented on May 24, 2015

    @w3guy
    Author

    ‎I totally was doing this wrong.What I did was,* checkout the gh-branch* copy the content of the site folder‎ to the local branch* run gh-deployThank you for taking time to explain.I will give it a try and get back to you. From: Waylan LimbergSent: Sunday, 24 May 2015 3:44 AMTo: mkdocs/mkdocsReply To: mkdocs/mkdocsCc: Agbonghama CollinsSubject: Re: [mkdocs] Is there a guide to using gh-deploy ? can't get it to work (#547)@collizo4sky has a point. There are absolutely no instructions anywhere for how to use ghp-deploy. For example, he could be missing any of the following (which I agree all seem obvious because I know how it works--but to a newcomer, maybe not so much):

    Clone the relevant repo from Github
    Checkout the branch which holds the unrendered docs (not the gh-pages branch).
    Make sure the docs render properly (using mkdocs build and/or mkdocs serve). If not, fix, commit, and push your changes (not to the gh-pages branch).
    From within the working tree of your repo (not the gh-pages branch), run mkdocs ghp-deploy.

    That's it. The deploy command will build the docs, commit them to the gh-pages branch, and push the gh-pages branch to Github for you all in one set. It is important to note that "You should never edit files in your gh-pages branch by hand if you're using this script because you will lose your work."

    That last sentence was taken directly from the docs for the ghp-import tool, which mkdocs uses under the hood. And while ghp-import does not push by default, mkdocs ghp-deploy does (and in fact the default behavior cannot be overridden--which may or may not be a good idea).

    —Reply to this email directly or view it on GitHub.

  6. d0ugal commented on May 24, 2015

    @d0ugal
    Contributor

    Sure, so we need to cover this workflow in detail when we do #477.

  7. w3guy commented on May 26, 2015

    @w3guy
    Author

    Hi, i still can't get it to work.

    BreakDown

    The master branch of https://github.com/ProfilePress/documentation/ stores the mkdocs files with all the markdown files in doc folder

    The gh-branch of that repo is the branch for the Github page.

    Each time i run the mkdocs gh-deploy command, i get this

    $ mkdocs gh-deploy
    Building documentation to directory: site
    Directory site contains stale files. Use --clean to remove
    Copying 'site' to `gh-pages` branch and pushing to GitHub.
    

    But the gh-branch is being updated @waylan

  8. d0ugal commented on May 26, 2015

    @d0ugal
    Contributor

    @collizo4sky How are your git remotes configured? You can see this with git remote -v

  9. d0ugal commented on May 26, 2015

    @d0ugal
    Contributor
  10. w3guy commented on May 26, 2015

    @w3guy
    Author

    This was what i got after running git remote -v

    origin  https://github.com/ProfilePress/documentation.git (fetch)
    origin  https://github.com/ProfilePress/documentation.git (push)
    

    Any idea?

  11. d0ugal commented on May 26, 2015

    @d0ugal
    Contributor

    Aha! It's https I wonder if that could be a problem, I'd expect to see SSH. Can you push the branch manually okay?

    git push origin gh-pages
    

    If it asks for a username and password, I bet it wont work with MkDocs.

  12. w3guy commented on May 26, 2015

    @w3guy
    Author

    It didnt ask for a username or password cos i already have lookup the credentials from .git-credential file.

    It says everything s up to date when i ran the command.

  13. 34 remaining items

  14. reopened this on May 30, 2015
  15. added this to the 0.14.0 milestone on May 30, 2015
  16. changed the title [-]Is there a guide to using gh-deploy ? can't get it to work[/-] [+]Include gh-import source in MkDocs to solve windows path issues.[/+] on May 30, 2015
  17. modified the milestone: 0.14.0 on Jun 2, 2015
  18. reopened this on Jun 6, 2015
  19. added 2 commits that reference this issue on Jun 6, 2015
    5601d82
    eecd83b
  20. d0ugal commented on Jun 12, 2015

    @d0ugal
    Contributor

    @collizo4sky with 0.14.0 released, can you confirm this all works now?

  21. w3guy commented on Aug 1, 2015

    @w3guy
    Author

    I will do a test now and get back to you.

  22. w3guy commented on Aug 1, 2015

    @w3guy
    Author

    Hi @d0ugal, still not working.

    $ mkdocs gh-deploy --clean
    INFO    -  Cleaning site directory
    INFO    -  Building documentation to directory: c:\Users\collizo4sky\Desktop\Cod
    e\Code\pp-doc\site
    INFO    -  Copying 'c:\Users\collizo4sky\Desktop\Code\Code\pp-doc\site' to 'gh-p
    ages' branch and pushing to GitHub.
    Traceback (most recent call last):
      File "c:\Python34\lib\runpy.py", line 170, in _run_module_as_main
        "__main__", mod_spec)
      File "c:\Python34\lib\runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "c:\Python34\Scripts\mkdocs.exe\__main__.py", line 9, in <module>
      File "c:\Python34\lib\site-packages\click\core.py", line 664, in __call__
        return self.main(*args, **kwargs)
      File "c:\Python34\lib\site-packages\click\core.py", line 644, in main
        rv = self.invoke(ctx)
      File "c:\Python34\lib\site-packages\click\core.py", line 991, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\Python34\lib\site-packages\click\core.py", line 837, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\Python34\lib\site-packages\click\core.py", line 464, in invoke
        return callback(*args, **kwargs)
      File "c:\Python34\lib\site-packages\mkdocs\cli.py", line 186, in gh_deploy_com
    mand
        gh_deploy.gh_deploy(config, message=message)
      File "c:\Python34\lib\site-packages\mkdocs\gh_deploy.py", line 69, in gh_deplo
    y
        remote_branch)
      File "c:\Python34\lib\site-packages\mkdocs\utils\ghp_import.py", line 163, in
    ghp_import
        if not try_rebase(remote, branch):
      File "c:\Python34\lib\site-packages\mkdocs\utils\ghp_import.py", line 78, in t
    ry_rebase
        if sp.call(cmd) != 0:
      File "c:\Python34\lib\subprocess.py", line 537, in call
        with Popen(*popenargs, **kwargs) as p:
      File "c:\Python34\lib\subprocess.py", line 859, in __init__
        restore_signals, start_new_session)
      File "c:\Python34\lib\subprocess.py", line 1086, in _execute_child
        args = list2cmdline(args)
      File "c:\Python34\lib\subprocess.py", line 663, in list2cmdline
        needquote = (" " in arg) or ("\t" in arg) or not arg
    TypeError: 'str' does not support the buffer interface
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions