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

Retrieve and rewrite Detailed licensing pages content #98

Open
wants to merge 1 commit into
base: detect_special_pages
Choose a base branch
from

Conversation

benoit74
Copy link
Contributor

Fix #54

@benoit74 benoit74 self-assigned this Nov 26, 2024
@benoit74 benoit74 marked this pull request as ready for review November 26, 2024 16:23
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 54.16667% with 22 lines in your changes missing coverage. Please review.

Project coverage is 44.45%. Comparing base (a86df2c) to head (bd1b95d).

Files with missing lines Patch % Lines
...src/mindtouch2zim/libretexts/detailed_licensing.py 58.13% 18 Missing ⚠️
scraper/src/mindtouch2zim/processor.py 20.00% 4 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           detect_special_pages      #98      +/-   ##
========================================================
+ Coverage                 43.96%   44.45%   +0.48%     
========================================================
  Files                        17       18       +1     
  Lines                      1053     1100      +47     
  Branches                    149      154       +5     
========================================================
+ Hits                        463      489      +26     
- Misses                      578      599      +21     
  Partials                     12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

else:

def get_restriction_label(restriction_key: str):
if restriction_key == "noncommercial":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a simple map

return {"noderivatives": "No Derivatives", ...}.get(restriction_key, restriction_key)

@@ -224,6 +225,9 @@ def run(self) -> Path:
self.libretexts_index_template = self.jinja2_env.get_template(
"libretexts.index.html"
)
self.libretexts_detailed_licensing_template = self.jinja2_env.get_template(
"libretexts.detailed-licensing.html.jinja2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we agree on using .html extensions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants