Skip to content

Commit

Permalink
修复了文档编译的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
苍之幻灵 committed May 22, 2021
1 parent a8dbb13 commit 4d8c844
Show file tree
Hide file tree
Showing 7 changed files with 177 additions and 5 deletions.
10 changes: 6 additions & 4 deletions doc.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cd NODE/doc
new
cd ..
cd ..
del /q /s "./doc/source/cpmel/"
rd /s /q "./doc/source/cpmel/"
del /q /s "./doc/build/"
rd /s /q "./doc/build/"
"C:\Program Files\Autodesk\Maya2018\Python\Scripts\sphinx-apidoc" -l -f -o ./doc/source/cpmel/ ./build/debug/ -d 4
"C:\Program Files\Autodesk\Maya2018\Python\Scripts\sphinx-build" -b html ./doc/source/ ./doc/build/
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
86 changes: 86 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/python
# -*-coding:utf-8 -*-
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import pymel

code_dir = r'D:\Development\python\CPMel\src'
sys.path.insert(0, os.path.abspath(code_dir))
sys.path.insert(0, os.path.abspath(code_dir + '/CPMel/'))
sys.path.insert(0, os.path.abspath(code_dir + '/CPMel/'))
sys.path.insert(0, os.path.abspath(code_dir + '/CPMel/api/'))
sys.path.insert(0, os.path.abspath(code_dir + '/CPMel/cmds/'))
sys.path.insert(0, os.path.abspath(code_dir + '/CPMel/cmds/node/'))
sys.path.insert(0, os.path.abspath(code_dir + '/CPMel/core/'))
sys.path.insert(0, os.path.abspath(code_dir + '/CPMel/mayaPlug/'))
sys.path.insert(0, os.path.abspath(code_dir + '/CPMel/mayaPlug/API_1/'))
sys.path.insert(0, os.path.abspath(code_dir + '/CPMel/mayaPlug/API_2/'))

# import maya.standalone
#
# maya.standalone.initialize(name = 'python')
# sys.path.insert(0, os.path.abspath('.'))


from recommonmark.parser import CommonMarkParser

source_parsers = {
'.md': CommonMarkParser,
}
# -- Project information -----------------------------------------------------

project = u'CPMEL'
copyright = u'2020, 苍之幻灵'
author = u'苍之幻灵'

# The full version, including alpha/beta/rc tags
release = '2.0.0'

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
]
source_suffix = ['.rst']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
14 changes: 14 additions & 0 deletions doc/source/contents.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CPMEL
=================================

.. toctree::
:maxdepth: 2
:caption: Contents:

* :ref:`genindex`
* :ref:`modindex`

.. automodule:: CPMel
:members:
:undoc-members:
:show-inheritance:
13 changes: 13 additions & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CPMEL
=================================

.. toctree::
:maxdepth: 2
:caption: Contents:

* :ref:`genindex`
* :ref:`modindex`
.. automodule:: CPMel
:members:
:undoc-members:
:show-inheritance:
4 changes: 3 additions & 1 deletion src/CPMel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@
* 使用CLI
注意2.7的CLI还不完善将于!!!CPMel3版本稳定CLI功能
"""

from . import initializeMaya

import os
import sys
import maya.cmds

sys.cpmel_data = dict()
MAYAINDEX = int(maya.cmds.about(v=True))

Expand Down Expand Up @@ -132,4 +134,4 @@
maya.cmds.pluginInfo(cc=cmds.upcommands)
del maya
if hasattr(sys, "cpmel_data"):
del sys.cpmel_data
del sys.cpmel_data

0 comments on commit 4d8c844

Please sign in to comment.