PK!˨**publish_sphinx_docs/__init__.py__version__ = '1.0.0' from .main import *PK!o  publish_sphinx_docs/main.pyimport os from pathlib import Path import subprocess as sp import click BUILD_DIR = "docs/_build/tmp" GITLAB_CLI = """ image: alpine:latest pages: stage: deploy script: - echo 'Nothing to do...' artifacts: paths: - public only: - master """ @click.command() @click.option( '--docs-dir', default="docs", show_default=True, help='Name of your Sphinx documentation directory', ) @click.option( '--docs-remote', prompt=True, default=lambda: os.getenv('DOCS_REMOTE', ''), show_default='DOCS_REMOTE environment variable', help='URL of your Github Pages or Gitlab Pages repository ' 'e.g. https://github.com/user/repo or git@github.com:user/repo', ) def publish(docs_remote, docs_dir, build_dir=BUILD_DIR): """ Use Sphinx, which needs to be installed in your virtual environment, to build your documentation as a single HTML page, then push the result to your Github Pages or Gitlab Pages repository. """ # Build docs build_dir = Path(build_dir) if "gitlab" in docs_remote.lower(): sp.run([ "sphinx-build", "-b", "singlehtml", docs_dir, str(build_dir / 'public') ]) # Add the required Gitlab CLI file to BUILD_DIR with (build_dir / ".gitlab-ci.yml").open("w") as tgt: tgt.write(GITLAB_CLI) elif "github" in docs_remote.lower(): sp.run([ "sphinx-build", "-b", "singlehtml", docs_dir, str(build_dir) ]) # Use ghp-import to do the Git magic, # then push to docs_remote master branch sp.run(["ghp-import", "--no-jekyll", "--branch=docs-build", str(build_dir)]) sp.run(["git", "push", docs_remote, "docs-build:master", "--force"]) # Clean up sp.run(["rm", "-rf", str(build_dir)]) sp.run(["git", "branch", "-D", "docs-build"]) PK!H^9H4publish_sphinx_docs-1.0.0.dist-info/entry_points.txtN+I/N.,()*(M,-.̫MO.CAbVyzP ..PK!4ys--/publish_sphinx_docs-1.0.0.dist-info/LICENSE.txtMIT License Copyright (c) 2018 Alex Raichev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK!HnHTU)publish_sphinx_docs-1.0.0.dist-info/WHEEL A н#Z;/"d&F[xzw@Zpy3Fv]\fi4WZ^EgM_-]#0(q7PK!H{k8Z,publish_sphinx_docs-1.0.0.dist-info/METADATASR0}Wc/'0̈́^2>lc J2IPdϞ=(2J }Pd=6%f;B+Yz")R:U:0ca {O'j[yڐU%(#5 _T,;yk}{t6h}-W["wfv6>cS 8\QE%xI. |Ktҷ`-r[KY)MdprL}$}teB"AFyM̽]yYʬ`*ͪ|7.{-^ ^qSbV=99>i2<ۿqڬ@$T ^v:q~27S W5[iva};t9mc/6bclbBZoccST ئmpbA7XH6 R[)2jX4"i<#Fvf :`"2Uo 0G?3JYite@" PK!H>`lo*publish_sphinx_docs-1.0.0.dist-info/RECORDKs0} X@i""n2PDNƙԅySRZvR;!%5c&'6GĖFv0yUx;,Oo Z"{R-U zA&7]76,/WpgCbx%uϚ:R~BiWR=a-N`lo*publish_sphinx_docs-1.0.0.dist-info/RECORDPK^o