Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

Add "estimated reading time" per article in header #47

Closed
2 tasks
novoid opened this issue Jun 25, 2020 · 1 comment
Closed
2 tasks

Add "estimated reading time" per article in header #47

novoid opened this issue Jun 25, 2020 · 1 comment

Comments

@novoid
Copy link
Owner

novoid commented Jun 25, 2020

@novoid
Copy link
Owner Author

novoid commented Oct 3, 2020

Internal notes for implementation:

  • resources

    • entry['rawcontent'] is the raw content of the article
    • determine language for adapting snippet: entry['autotags']['language']
      • unsure
      • from lib/tests/utils_test.py: deutsch, english
  • algorithm

    • derive number of words from rawcontent -> entry['reading_minutes']
    • remove header + property + non-words (rough estimation!)
    • set up new template for the two default languages
  • adjustments necessary in:

    • CSS: similar to "published on"
    • _generate_tag_page()
    • _generate_persistent_article()
    • _generate_temporal_article()
    • end to end tests: re-generate, manually check result, take over result for comparison data set
    • entry page previews
  • round up

    • document in wiki: approach, sources, this issue, chosen WPM number, subtraction number
    • maybe: link from template to the wiki page with explanations

MISC temporary notes:

            # FIXXME: other languages than german have to be added
            # here: (generalize using a configured list of known
            # languages?)
            if 'autotags' in list(entry.keys()):
                if 'language' in list(entry['autotags'].keys()) and entry['autotags']['language'] == 'deutsch':
                    content += self.template_definition_by_name('backreference-header-de')
                else:
                    content += self.template_definition_by_name('backreference-header-en')

@novoid novoid self-assigned this Oct 3, 2020
novoid added a commit that referenced this issue Oct 3, 2020
@novoid novoid closed this as completed Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant