mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
sphinx-quickstart now has --use-make-mode
option for generating Makefile that use sphinx make-mode.
This commit is contained in:
parent
e968a6c1a1
commit
3d3bee1c8b
2
CHANGES
2
CHANGES
@ -19,6 +19,8 @@ Features added
|
|||||||
described in documentation.
|
described in documentation.
|
||||||
* HTML breadcrumb items tag has class "nav-item" and "nav-item-N" (like
|
* HTML breadcrumb items tag has class "nav-item" and "nav-item-N" (like
|
||||||
nav-item-0, 1, 2...).
|
nav-item-0, 1, 2...).
|
||||||
|
* sphinx-quickstart now has `--use-make-mode` option for generating Makefile
|
||||||
|
that use sphinx make-mode.
|
||||||
|
|
||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
@ -120,6 +120,10 @@ Extension options
|
|||||||
Makefile and Batchfile creation options
|
Makefile and Batchfile creation options
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
.. option:: --use-make-mode, --no-use-make-mode
|
||||||
|
|
||||||
|
Makefile/make.bat uses (or not use) make-mode. Default is not use.
|
||||||
|
|
||||||
.. option:: --makefile, --no-makefile
|
.. option:: --makefile, --no-makefile
|
||||||
|
|
||||||
Create (or not create) makefile.
|
Create (or not create) makefile.
|
||||||
|
@ -947,7 +947,7 @@ help:
|
|||||||
|
|
||||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||||
%:
|
%%:
|
||||||
\t@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
\t@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@ -1341,16 +1341,23 @@ def generate(d, overwrite=True, silent=False):
|
|||||||
masterfile = path.join(srcdir, d['master'] + d['suffix'])
|
masterfile = path.join(srcdir, d['master'] + d['suffix'])
|
||||||
write_file(masterfile, MASTER_FILE % d)
|
write_file(masterfile, MASTER_FILE % d)
|
||||||
|
|
||||||
|
if d.get('make_mode') is True:
|
||||||
|
makefile_template = MAKEFILE_NEW
|
||||||
|
batchfile_template = BATCHFILE_NEW
|
||||||
|
else:
|
||||||
|
makefile_template = MAKEFILE
|
||||||
|
batchfile_template = BATCHFILE
|
||||||
|
|
||||||
if d['makefile'] is True:
|
if d['makefile'] is True:
|
||||||
d['rsrcdir'] = d['sep'] and 'source' or '.'
|
d['rsrcdir'] = d['sep'] and 'source' or '.'
|
||||||
d['rbuilddir'] = d['sep'] and 'build' or d['dot'] + 'build'
|
d['rbuilddir'] = d['sep'] and 'build' or d['dot'] + 'build'
|
||||||
# use binary mode, to avoid writing \r\n on Windows
|
# use binary mode, to avoid writing \r\n on Windows
|
||||||
write_file(path.join(d['path'], 'Makefile'), MAKEFILE % d, u'\n')
|
write_file(path.join(d['path'], 'Makefile'), makefile_template % d, u'\n')
|
||||||
|
|
||||||
if d['batchfile'] is True:
|
if d['batchfile'] is True:
|
||||||
d['rsrcdir'] = d['sep'] and 'source' or '.'
|
d['rsrcdir'] = d['sep'] and 'source' or '.'
|
||||||
d['rbuilddir'] = d['sep'] and 'build' or d['dot'] + 'build'
|
d['rbuilddir'] = d['sep'] and 'build' or d['dot'] + 'build'
|
||||||
write_file(path.join(d['path'], 'make.bat'), BATCHFILE % d, u'\r\n')
|
write_file(path.join(d['path'], 'make.bat'), batchfile_template % d, u'\r\n')
|
||||||
|
|
||||||
if silent:
|
if silent:
|
||||||
return
|
return
|
||||||
@ -1452,6 +1459,10 @@ def main(argv=sys.argv):
|
|||||||
group.add_option('--no-batchfile', action='store_true', dest='no_batchfile',
|
group.add_option('--no-batchfile', action='store_true', dest='no_batchfile',
|
||||||
default=False,
|
default=False,
|
||||||
help='not create batchfile')
|
help='not create batchfile')
|
||||||
|
group.add_option('-M', '--no-use-make-mode', action='store_false', dest='make_mode',
|
||||||
|
help='not use make-mode for Makefile/make.bat')
|
||||||
|
group.add_option('-m', '--use-make-mode', action='store_true', dest='make_mode',
|
||||||
|
help='use make-mode for Makefile/make.bat')
|
||||||
|
|
||||||
# parse options
|
# parse options
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user