fastai / fastdoc

Create publication-quality books from Jupyter notebooks
https://fastai.github.io/fastdoc/
Apache License 2.0
231 stars 30 forks source link

Folder structure #3

Closed lvwerra closed 3 years ago

lvwerra commented 3 years ago

First of all thanks for releasing the conversion scripts as a library! I followed the instructions in the Readme and created a folder in my repo called ./books/ and ran the fastdoc_convert_all within the folder but got the following error:

FileNotFoundError: [Errno 2] No such file or directory: 'book'

When running the fastdoc_convert_all one level up outside the book folder but inside the repo (./) it worked, however the convert_book was created one level higher outside the repo (../convert_books). Is this the intended behaviour? If not I can look into it and create a PR.

lvwerra commented 3 years ago

I found that one can easily control the behaviour with the CLI arguments fastdoc_convert_all --dest_path SAVE_PATH --path SOURCE_PATH. Nevertheless, I think the readme needs to be updated or the default arguments changed. To work as explained in the readme the following would work:

def fastdoc_convert_all(
    path:Param("Path to notebooks",str)='./', # instead of 'books'
    dest_path:Param("Path to generated asciidoc files",str)='../convert_book'):
robintibor commented 3 years ago

I encountered the same issue, documentation seems inconsistent with what happens by default or at least easily misunderstandable.

sugatoray commented 3 years ago

I got a similar error after I used:

$ cd book
$ fastdoc_convert_all --path ../book --dest_path ../convert_book
# or if I use just
# fastdoc_convert_all

Error:

FileNotFoundError: [Errno 2] No such file or directory: '../books/images'

However, I found that the output directory was created (../convert_book) with one folder made for each notebook in book folder. The strange thing is that none of the folders had any contents. I found only one file with *.asciidoc format, even-though I had four notebooks.

Installation: conda install -c fastai nbdev fastdoc

jph00 commented 3 years ago

I believe the README is fixed now - feel free to reopen if there are still issues.