Multipaging Documentation
- set_book_config(options, paths, menu_title='Select a chapter', menu_icon='book', icons=None, orientation=None, styles=None, save_answers=False, display_page_info=True)
Creates a book using the streamlit_option_menu library. Renders each of the corresponding chapters based on their properties. Uses the same configurations used by streamlit-option-menu and icons from bootstrap-icons.
- Parameters:
options (list of str) – List of chapter names to be displayed
paths (list of str) – List of chapter paths containging the pages (py, md) to be displayed
menu_title (str) – Title of the menu, can be empty to be skipped.
menu_icon (str or list of str) – Icon to be used on the menu, from bootstrap icons.
icons – Icons to be used. Can be a single one used for all books, or a list of icons for each book.
orientation (str) – Orientation of the menu. Can be “horizontal” or “vertical”.
styles (dict) – Styles to be used. See the documentation of streamlit_option_menu.
save_answers (bool) – If True, it will save the answers in a csv file. Defaults to False.
display_page_info (bool) – If True, it will display the page info with the name and number. Defaults to True.
- Returns:
None
- set_chapter_config(path='pages', toc=False, button='top', button_previous='⬅️', button_next='➡️', button_refresh='🔄', on_load_header=None, on_load_footer=None, save_answers=False, display_page_info=True)
Sets the book configuration, and displays the selected file.
- Parameters:
path (string, dict) – The path to root directory of the the files (py or md) to be rendered as pages of the book.
toc (bool) – If True, it will display the table of contents for the files on the path. Defaults to False.
button (str) – “top” (default behavior) or “bottom”.
button_previous (str) – icon or text for the previous button.
button_next (str) – icon or text for the next button.
button_refresh (str) – icon or text for the refresh button.
on_load_header (function) – function to be called before the page is loaded.
on_load_footer (function) – function to be called after the page is loaded.
save_answers (bool) – If True, it will save the answers in a csv file. Defaults to False.
display_page_info (bool) – If True, it will display the page info with the name and number. Defaults to True.
- Returns:
None