Code Monkey home page Code Monkey logo

mudkip's Issues

[bug]: Update gh-pages fails

mudkip build --update-gh-pages fails with following trace:

Traceback (most recent call last):
  File "/opt/python/3.10.4/lib/python3.10/site-packages/mudkip/cli.py", line 22, in exception_handler
    yield
  File "/opt/python/3.10.4/lib/python3.10/site-packages/mudkip/cli.py", line 135, in build
    application.build(
  File "/opt/python/3.10.4/lib/python3.10/site-packages/mudkip/application.py", line 313, in build
    GitHubPagesUpdater(self.sphinx.outdir, self.config.repository).update()
  File "/opt/python/3.10.4/lib/python3.10/site-packages/mudkip/github.py", line 23, in update
    run(["git", "remote", "add", "origin", self.repository])
  File "/opt/python/3.10.4/lib/python3.10/subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/opt/python/3.10.4/lib/python3.10/subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/python/3.10.4/lib/python3.10/subprocess.py", line 1775, in _execute_child
    self.pid = _posixsubprocess.fork_exec(
TypeError: expected str, bytes or os.PathLike object, not NoneType

preset flag as combination of theme and builder

Currently preset flag seems a combination of builders and themes - if there is both -t | --theme and -b | --builder flag, then presets can be defined in their terms: -p rtd is -t rtd -b html and -p xml is -b xml

  -p, --preset [xml|latex|dirhtml|alabaster|rtd|furo|pydata|vitepress]
                                  Documentation preset.

Users for quickstart could use -p and later refine their pipelines with -t / -b.

Running sphinx-apidoc equivalent

Hi! Currently playing around with mudkip with the hope of using the tool for documenting my projects going forward.

I was wondering how to invoke the autodoc extension using mudkip. In my current sphinx setup, I run the sphinx-apidoc command, which automatically generates the .rst files for my modules and I would like to recover this behavior with mudkip.

I tried running sphinx-apidoc separately before mudkip develop, but then I get some import errors (those are fixed in my current setup by modifying the sys.path variable in conf.py).

Thanks!

can rely on ghp-import instead github.py

mudkip/mudkip/github.py

Lines 1 to 24 in e0740e9

import shutil
import subprocess
from functools import partial
from pathlib import Path
from tempfile import TemporaryDirectory
class GitHubPagesUpdater:
def __init__(self, upload_dir, repository):
self.upload_dir = Path(upload_dir).absolute()
self.repository = repository
def update(self):
with TemporaryDirectory() as tmp:
shutil.copytree(self.upload_dir, tmp, dirs_exist_ok=True)
run = partial(subprocess.run, check=True, cwd=tmp)
run(["git", "init"])
run(["git", "checkout", "-b", "gh-pages"])
run(["git", "add", "."])
run(["git", "commit", "-m", "Update GitHub Pages"])
run(["git", "remote", "add", "origin", self.repository])
run(["git", "push", "-f", "origin", "gh-pages"])

https://github.com/c-w/ghp-import#python-usage

provide example of [mudkip.override] in documentation

I tried to relay something I needed for conf.py in mudkip and it worked:

[mudkip.override]
myst_enable_extensions = ["smartquotes", "tasklist"]

Maybe describe in a bit more detail in the documentation the powers of override, also tell it can be a separate section in TOML like [mudkip.override] or [tool.mudkip.override]

cannot generate latex without conf.py

I tried building latex with sphinx-build - but for that I miss conf.py

λ sphinx-build -b latex docs/ docs/_latex/
Running Sphinx v4.5.0

Configuration error:
missing conf.py file (q:\chaos\docs)

Should mudkip be able to write temporary conf.py or there is a different way to invoke labex build without conf.py?

lightweight HTML to PDF generation with puppeteer

Found that jupyterbook in addition to latex+pdflatex builder has a lightweight builder for PDF using puppeteer, a headleass browser that can emulate printing, and puppeteer port is available as python package.

So on jupyterbook lightweight pdf generation will look like:

pip install pyppeteer
jupyter-book build mybookname/ --builder pdfhtml

Possible mudkip version is, with new builder flag:

mudkip build -b pdfhtml
mudkip build --builder pdfhtml

[bug]: mudkip develop issues error trace but keeps working

This is not a big pain, but takes few tries to get used to - on Windows mudkip develop starts with error message:

Watching "docs"...
Server running on http://localhost:5500
q:\chaos\docs\index.rst:4: WARNING: toctree contains reference to nonexisting document 'README'
q:\chaos\docs\link.md: WARNING: document isn't included in any toctree
Process Process-1:
Traceback (most recent call last):
  File "c:\users\epogr\anaconda3\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "c:\users\epogr\anaconda3\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\epogr\anaconda3\lib\site-packages\mudkip\server.py", line 32, in serve_directory
    server.serve(port=port, host=host, root=directory)
  File "c:\users\epogr\anaconda3\lib\site-packages\livereload\server.py", line 339, in serve
    self.application(
  File "c:\users\epogr\anaconda3\lib\site-packages\livereload\server.py", line 291, in application
    app.listen(port, address=host)
  File "c:\users\epogr\anaconda3\lib\site-packages\tornado\web.py", line 2116, in listen
    server.listen(port, address)
  File "c:\users\epogr\anaconda3\lib\site-packages\tornado\tcpserver.py", line 151, in listen
    sockets = bind_sockets(port, address=address)
  File "c:\users\epogr\anaconda3\lib\site-packages\tornado\netutil.py", line 174, in bind_sockets
    sock.bind(sockaddr)
OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted

Suggest updates for documentation

  • pokemon / naming story with wiki link
  • pip install update git+https://github.com/vberlier/mudkip.git for dev version
  • index.rst already created by develop command
  • brush README.md with npx prettier
  • overrides as conf.py replacement #205

Aspect: new user of sphinx who would like a jump start with pshinx and would like to start using mudkip quickly

List of topics for Github

Here is a list of tags one can use to enhance Mudkip visibility on Github

python 
documentation 
documentation-tool 
sphinx 
sphinx-doc
sphinx-theme
sphinxcontrib
sphinx-extension 
mudkip

The list is from sphinx itself and projects around it.

Mudkip fails to use repo specific git config

Since mudkip creates a git repo in a temp directory, it only listens to the --global git config. This means any values in the repo specific (or local) git config don't work which is either unexpected behavior or forces the command to fail (mostly when using it locally).

@ mudkip build --update-gh-pages 
Updating GitHub Pages with "docs"...
Initialized empty Git repository in /private/var/folders/6q/ybrmmgj52znd2g6xrm4w68sw0000gn/T/tmp10jw9dl6/.git/
Switched to a new branch 'gh-pages'
Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

Even though the message indicates that you can "omit" --global, it's incorrectly show since the git repo's location is in a different location.

`pygments_dark_style` and maybe other theme options fail

It seems to me that setting some values for the override (aka the conf.py file) don't override theme set options. Example:

[tool.mudkip]
preset = "furo"
title = "my-epic-docs"

[tool.mudkip.override]
...
pygments_style = "material"

Here, I wish to change the code highlighting style for pygments to material as furo uses a different theme. Removing preset = "furo" enables for my code highlighting theme to work while enabling furo causes my option to effectively get ignored. It seems to me that my overrides get set first, and then the furo preset gets set, but I can't be too certain.

Edit: furo has pygments_dark_style but it seems to me that mudkip isn't recognizing or letting sphinx recognize this field based on how the config is getting parsed or something.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.