Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Updated the scripts for generating the documentation #144

Merged
merged 3 commits into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/python/docs/sphinx/installationguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Installation Guide
Supported Platforms
-------------------

Release 0.6:
Release 1.1:
* Windows 10, Ubuntu 14.04, Ubuntu 16.04, CentOS 7, RHEL 7, Mac OS 10.11, 10.12, 10.13


Expand Down
21 changes: 11 additions & 10 deletions src/python/docs/sphinx/make.bat
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
@ECHO OFF

pushd %~dp0
set PYTHONINTERPRETER=%~dp0..\..\..\..\dependencies\Python3.7\python.exe
set PYTHONPATH=%~dp0..\..\..\..\Python\
set PYTHONINTERPRETER=%~dp0..\..\..\..\dependencies\Python3.6\python.exe
set SPHINXOPTS=-j 4

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=%PYTHONINTERPRETER% -msphinx
set SPHINXBUILD=%PYTHONINTERPRETER% -m sphinx
)

:: Todo: Fix the issue here, the installtion guide is not showing correctly
set SOURCEDIR=.
set BUILDDIR=_build
set BUILDDIR=%~dp0_build
set SPHINXPROJ=microsoftml

if "%1" == "" goto html:
if "%1" == "" goto html:
set format=%1
goto next:

Expand All @@ -24,8 +25,8 @@ set format=html
:next:

@echo remove %BUILDDIR%\%format%
rmdir /s /q %BUILDDIR%\doctrees
rmdir /s /q %BUILDDIR%\%format%
call rmdir /s /q %BUILDDIR%\doctrees
call rmdir /s /q %BUILDDIR%\%format%
if exist %BUILDDIR%\_static rmdir /S /Q %BUILDDIR%\_static
if exist %BUILDDIR%\%format% goto issue:

Expand All @@ -42,15 +43,15 @@ if errorlevel 9009 (
exit /b 1
)

%SPHINXBUILD% -M %format% %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
call %SPHINXBUILD% -M %format% %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
call %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end:

:issue:
@echo An issue happened. Check %BUILDDIR%\%format% is not here.

:end
popd
popd
2 changes: 0 additions & 2 deletions src/python/docs/sphinx/make_md.bat

This file was deleted.

103 changes: 78 additions & 25 deletions src/python/docs/sphinx/make_yaml.bat
Original file line number Diff line number Diff line change
@@ -1,34 +1,87 @@
@ECHO ON
set PY=%~dp0..\..\..\..\dependencies\Python3.7\python.exe
set PYS=%~dp0..\..\..\..\dependencies\Python3.7\Scripts
@if not defined _echo @echo off
if exist %~dp0build (rmdir /S /Q %~dp0build)
if exist %~dp0..\..\..\..\dependencies\Python3.6 (
echo "Python3.6 exists"
) else (
echo "Please run build.cmd under NimbusML with Python3.6's configuration first"
call exit /b
)
echo "###Downloading Dependencies######"
echo "Downloading Dependencies "
set PY=%~dp0..\..\..\..\dependencies\Python3.6\python.exe
set PYTHONPATH=%~dp0..\..\..\..\python
%PYS%\pip install sphinx==1.5.5
%PYS%\pip install sphinx-docfx-yaml
%PYS%\pip install sphinx_rtd_theme
%PYS%\sphinx-build -c ci_script . _build
call %PY% -m pip -q install pip==9.0.3
echo "Installing sphinx-docfx-yaml "
call %PY% -m pip -q install sphinx-docfx-yaml
echo "Installing sphinx "
call %PY% -m pip -q install sphinx==2.1.1
echo "Installing sphinx_rtd_theme "
call %PY% -m pip -q install sphinx_rtd_theme
echo "Installing NimbusML "
call %PY% -m pip -q install nimbusml
echo "#################################"
echo.

if exist _build del /Q _build
echo.
echo "#################################"
echo "Running sphinx-build "
echo "#################################"
call %PY% -m sphinx -c %~dp0ci_script %~dp0 %~dp0_build

mkdir _build\ms_doc_ref\
xcopy /S /I /Q /Y /F _build\docfx_yaml\* _build\ms_doc_ref\nimbusml\docs-ref-autogen
del _build\ms_doc_ref\nimbusml\docs-ref-autogen\toc.yml
echo.
echo "#################################"
echo "Copying files "
echo "#################################"
call mkdir %~dp0_build\ms_doc_ref\
call xcopy /S /I /Q /Y /F %~dp0_build\docfx_yaml\* %~dp0_build\ms_doc_ref\nimbusml\docs-ref-autogen

%PYS%\pip install sphinx==1.6.2
CALL make_md.bat
echo.
echo "#################################"
echo "Running make_md.bat"
echo "Fixing API guide
echo "#################################"
call make md
call %py% %~dp0ci_script\fix_apiguide.py

copy /Y toc.yml _build\ms_doc_ref\nimbusml\toc.yml
xcopy /Y /S _build\md\* _build\ms_doc_ref\nimbusml
call copy /Y %~dp0toc.yml %~dp0_build\ms_doc_ref\nimbusml\toc.yml
call xcopy /Y /S %~dp0_build\md\* %~dp0_build\ms_doc_ref\nimbusml
:: Append the text in index.md under tutorial.md

del _build\ms_doc_ref\nimbusml\doc-warnings-rx.log
del _build\ms_doc_ref\nimbusml\doc-warnings-rx-all.log
del _build\ms_doc_ref\nimbusml\tutorial.md
echo.
echo "#################################"
echo "updating yml......."
echo "#################################"
call %PY% %~dp0ci_script\gen_toc_yml.py -input %~dp0_build\ms_doc_ref\nimbusml\index.md -temp %~dp0_build\ms_doc_ref\nimbusml\toc_ref.yml -output %~dp0_build\ms_doc_ref\nimbusml\toc.yml

echo updating yml...
%PY% ci_script\gen_toc_yml.py -input _build\ms_doc_ref\nimbusml\index.md -temp _build\ms_doc_ref\nimbusml\toc_ref.yml -output _build\ms_doc_ref\nimbusml\toc.yml
echo.
echo "#################################"
echo "updating reference links...."
echo "#################################"
call %PY% %~dp0ci_script\update_all_toc_yml.py

echo updating reference links....
%PY% ci_script\update_all_toc_yml.py
echo.
echo "#################################"
echo "updating ms-scikit.md to modules.md"
echo "#################################"
call move %~dp0_build\ms_doc_ref\nimbusml\modules.md %~dp0_build\ms_doc_ref\nimbusml\ms-scikit.md

echo updating ms-scikit.md to modules.md
del _build\ms_doc_ref\nimbusml\ms-scikit.md
mv _build\ms_doc_ref\nimbusml\modules.md _build\ms_doc_ref\nimbusml\ms-scikit.md
echo.
echo "#################################"
echo "Cleaning files"
echo "#################################"
call mkdir %~dp0_build\ms_doc_ref\nimbusml\_images\_static
call xcopy /S /I /Q /Y /F %~dp0ci_script\_static %~dp0_build\ms_doc_ref\nimbusml\_images\_static
call mkdir %~dp0build
call move %~dp0_build\ms_doc_ref %~dp0\build\
call more +29 %~dp0build\ms_doc_ref\nimbusml\index.md >> %~dp0build\ms_doc_ref\nimbusml\overview.md
call del /Q %~dp0build\ms_doc_ref\nimbusml\*log
call del /Q %~dp0build\ms_doc_ref\nimbusml\concepts.md
call del /Q %~dp0build\ms_doc_ref\nimbusml\index.md
call del /Q %~dp0build\ms_doc_ref\nimbusml\toc.yml
call rmdir /Q %~dp0build\ms_doc_ref\nimbusml\_static
:: call rmdir /S /Q %~dp0_build

echo.
echo "#################################"
echo "#########Built Finished##########"
echo "#################################"