QuantEcon / jupinx

Jupyter + Sphinx Utilities and Tools
https://quantecon.github.io/jupinx/
20 stars 4 forks source link

ENH: Added functionality to specify individual files to compile #51

Closed AakashGfude closed 5 years ago

AakashGfude commented 5 years ago

Individual file names can now be specified in the jupinx build tool to specifically target those filenames. argument to specify the files are -f or --files .

Example usage :- jupinx -n -f source/rst/index.rst source/rst/amss.rst

Note:- If no directory is specified then the path of files is relative to the current directory else the path is relative to the directory specified.

Note: This PR also removes the python2 support code from build tool.

fixes #30 #46

needs discussion with @mmcky to update the help tool and docs

mmcky commented 5 years ago

@AakashGfude Thanks for the PR. So if <PROJECT-DIRECTORY> is specified it would be:

jupinx -n lecture-source-py -f source/rst/index.rst source/rst/amss.rst

the file path would be the same for specifying files relative to the root level of the repo?

Also I think if you specified source/rst/amss.rst that would trigger source/rst/index.rst to build automatically (without having to specify it) if there were title changes in the amss lecture. Can you confirm?

mmcky commented 5 years ago

Also if a user specified:

jupinx -n -f source/rst/index.rst source/rst/amss.rst lecture-source-py 

This wouldn't work right? the lecture-source-py would be added to the -f option given nargs='*'

AakashGfude commented 5 years ago

Also if a user specified:

jupinx -n -f source/rst/index.rst source/rst/amss.rst lecture-source-py 

This wouldn't work right? the lecture-source-py would be added to the -f option given nargs='*'

True @mmcky , this will take lecture-source-py as one of the filenames and it will fail. We will have to mention explicitly that sourcedir should be defined before -f

@AakashGfude Thanks for the PR. So if <PROJECT-DIRECTORY> is specified it would be:

jupinx -n lecture-source-py -f source/rst/index.rst source/rst/amss.rst

the file path would be the same for specifying files relative to the root level of the repo?

Also I think if you specified source/rst/amss.rst that would trigger source/rst/index.rst to build automatically (without having to specify it) if there were title changes in the amss lecture. Can you confirm?

Yes, you are right. It will trigger index automatically during execution

mmcky commented 5 years ago

now that we launch an instance of notebookapp we can also specify a file to open once this branch is tested we should add this functionality into the notebook preview and html preview to open a specific page. I am unsure how we would handle a list of files though (probably assume open the first in the list?). Let's add this as an issue and implement later on. [wont implement here]

mmcky commented 5 years ago

thanks @AakashGfude I tested this and it is looking good.

mmcky commented 5 years ago

This will require companion PRs for:

to ensure FILES = support is included in the Makefile

mmcky commented 5 years ago

thanks @AakashGfude