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

Adding author names in title of the main page #239

Merged
merged 9 commits into from
Dec 13, 2023
Merged

Conversation

AakashGfude
Copy link
Member

@AakashGfude AakashGfude commented Nov 22, 2023

Screen Shot 2023-12-11 at 1 57 09 pm

Author names from the description need to be removed from individual repos.

fixes #233

@AakashGfude AakashGfude changed the title Adding author title Adding author names in title of the main page Nov 22, 2023
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e65778b) 73.18% compared to head (d81a464) 73.07%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #239      +/-   ##
==========================================
- Coverage   73.18%   73.07%   -0.11%     
==========================================
  Files           2        2              
  Lines         261      260       -1     
==========================================
- Hits          191      190       -1     
  Misses         70       70              
Flag Coverage Δ
pytests 73.07% <100.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@AakashGfude AakashGfude marked this pull request as ready for review November 22, 2023 10:46
@github-actions github-actions bot temporarily deployed to commit November 22, 2023 10:49 Inactive
@mmcky
Copy link
Contributor

mmcky commented Nov 22, 2023

@jstac we are adding the ability to create hyperlinked names as well but let us know what you think of style.

I think:

  • some additional padding between title and authors

What do you think about the relative text size?

@AakashGfude
Copy link
Member Author

@mmcky author names with links, i have kept it blue purposefully to indicate its clickable.
https://github.com/QuantEcon/quantecon-book-theme/assets/6542997/d8e53230-30e7-4b9f-834f-46bfb5d46ab1

The config variable for this is:

authors:
        - name: Thomas J. Sargent
          url: http://www.tomsargent.com/
        - name: John Stachurski
          url: https://johnstachurski.net/

@github-actions github-actions bot temporarily deployed to commit November 30, 2023 01:11 Inactive
@github-actions github-actions bot temporarily deployed to commit November 30, 2023 02:21 Inactive
@AakashGfude
Copy link
Member Author

Note that this link feature extends to author names displayed in sub-pages as well. But will revert to previous non-clickable titles if the authors config is not provided.

@AakashGfude
Copy link
Member Author

@mmcky have added the feature now to:

  1. if number of elements (names) ==2 use and
  2. if number of elements (names) > 2 then use name1, name2, and name3
  3. and nothing for number of elements (names) < 2

@github-actions github-actions bot temporarily deployed to commit November 30, 2023 23:41 Inactive
@AakashGfude
Copy link
Member Author

AakashGfude commented Dec 1, 2023

  • Added docs

@github-actions github-actions bot temporarily deployed to commit December 1, 2023 02:11 Inactive
@mmcky
Copy link
Contributor

mmcky commented Dec 6, 2023

thanks @AakashGfude -- great work.

@mmcky
Copy link
Contributor

mmcky commented Dec 8, 2023

@AakashGfude would we be able to add font size as a parameter in the config then we can adjust if needed.

@mmcky mmcky self-requested a review December 11, 2023 01:08
Copy link
Contributor

@mmcky mmcky left a comment

Choose a reason for hiding this comment

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

@AakashGfude I think the remaining items are:

  • check if no author information is provided then the element is not added to the HTML
  • add font size passthrough as a config option

Once that edge case is tested and the font size passthrough is set and added to the docs then LGTM. :-)

@AakashGfude
Copy link
Member Author

AakashGfude commented Dec 11, 2023

@AakashGfude I think the remaining items are:

* [ ]  check if no author information is provided then the element is not added to the HTML

@mmcky this should be handled already. If no author dict is provided, then we take the author names from the old author key (But it doesn't have hyperlinks). If even that is not available, then the element should be empty.

Let me know if this is not working. I will test it again too.

@mmcky
Copy link
Contributor

mmcky commented Dec 11, 2023

Thanks @AakashGfude that's great.

@AakashGfude
Copy link
Member Author

AakashGfude commented Dec 13, 2023

@mmcky I have created a config for font size. called author_font_size. Looking for name ideas.
Should we just use it for the main toc page. or the rest of the pages as well?
Rest of the page have different header size to front toc page, so the same font size might for authors might not have the same look.

The property has default value of 18px. We can set pixels, by giving a number. FOr example:

html_theme_options:
        author_font_size: 20

would set 20px.

@github-actions github-actions bot temporarily deployed to commit December 13, 2023 01:05 Inactive
@mmcky
Copy link
Contributor

mmcky commented Dec 13, 2023

Should we just use it for the main toc page. or the rest of the pages as well?

I think this should be just for main page as it is likely to be bigger than other pages.
I think the other pages is OK as it is (matching font size to text around it).

I suspect the other pages are using the author information in _config.yml. Is that right? We should add a note to the documentation perhaps.

If yes, maybe the theme author setting should be

mainpage_author
mainpage_author_fontsize

What do you think about that?

thanks @AakashGfude

@AakashGfude
Copy link
Member Author

@mmcky, I made the other pages also use authors with hyperlinks, cause I suspected readers would want that clickable as well? And not having to go to main toc to get the link? What do you think?
The font size one I agree.

@mmcky
Copy link
Contributor

mmcky commented Dec 13, 2023

@mmcky, I made the other pages also use authors with hyperlinks, cause I suspected readers would want that clickable as well? And not having to go to main toc to get the link? What do you think?

@AakashGfude -- Roger that. That makes sense and also becomes a single source of truth. So the way it works is if Author is specified in _config.yml then that will get used, but if author is specified in html_theme_options that will take priority?

Let's keep the relationship in font size on the other pages (to the surrounding text) and only allow font size changes for the mainpage. ✅

@mmcky mmcky self-requested a review December 13, 2023 03:06
Copy link
Contributor

@mmcky mmcky left a comment

Choose a reason for hiding this comment

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

Love your work on this @AakashGfude. Thanks.

When you're ready please go ahead and merge and make a new release.

With new features I think you can do a semi-major release 0.7.0

@github-actions github-actions bot temporarily deployed to commit December 13, 2023 03:08 Inactive
@AakashGfude
Copy link
Member Author

So the way it works is if Author is specified in _config.yml then that will get used, but if author is specified in html_theme_options that will take priority?

That's right @mmcky.

Let's keep the relationship in font size on the other pages (to the surrounding text) and only allow font size changes for the mainpage. ✅

Done!

Great. I will merge and make a release.

@github-actions github-actions bot temporarily deployed to commit December 13, 2023 03:27 Inactive
@AakashGfude AakashGfude merged commit 0d5242c into master Dec 13, 2023
12 checks passed
@mmcky mmcky deleted the author-title branch December 13, 2023 03:31
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.

ENH: Add Author below Title (for Main Page)
2 participants