Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a troublesome print statement #59

Merged
merged 1 commit into from
Feb 14, 2024
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
5 changes: 2 additions & 3 deletions jupyter_book_to_htmlbook/file_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,12 @@ def get_main_section(soup):
try:
main_title = article.find('h1').get_text()
except AttributeError:
main_title = soup.find("h1")
main_title = soup.find("h1").get_text()
err_msg = f"The chapter with title '{main_title}' " + \
"has extra <section>s " + \
"has extra sections " + \
"that will not be processed. Please check the " + \
"notebook source files."
logging.warning(err_msg)
print(err_msg)
bibliography = soup.find('section', id="bibliography")

return main, bibliography
Expand Down
1 change: 0 additions & 1 deletion tests/test_file_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def test_process_chapter_single_file_with_multiple_h1s(self,
process_chapter((test_env / 'many_a_levels.html'),
test_env, test_out)
log = caplog.text
assert "will not be processed" in capsys.readouterr().out
assert "will not be processed" in log

def test_process_chapter_single_file_bibliogrpahy(self,
Expand Down
Loading