Skip to content

[Demo] Add a tidelift footer block into the docs layout and a ToC link#2708

Closed
webknjaz wants to merge 2 commits into
pypa:mainfrom
webknjaz:docs/tidelift-autointegration
Closed

[Demo] Add a tidelift footer block into the docs layout and a ToC link#2708
webknjaz wants to merge 2 commits into
pypa:mainfrom
webknjaz:docs/tidelift-autointegration

Conversation

@webknjaz

Copy link
Copy Markdown
Member

Summary of changes

This is mainly a demo for @jaraco of how to solve problems raised in #2465 and jaraco/tidelift#2.

Pull Request Checklist

@webknjaz

Copy link
Copy Markdown
Member Author

@jaraco you could either merge this and #2465 temporarily and then integrate it into your skeleton or just implement this approach elsewhere in the infra.

@jaraco

jaraco commented Jul 18, 2021

Copy link
Copy Markdown
Member

Thanks for this webknjaz. The two techniques demonstrated herein are helpful in understanding some of the techniques that might be available to enable tidelift notices in a doc suite.

I particularly like the Sphinx plugin for altering the ToC, because anything that's a Sphinx plugin could be easily integrated using Python packaging without having to edit the source of any file. This capability could be extracted from the conf.py file and put into jaraco.tidelift and thus made available to any docs builds by simply declaring the dependency in the .[docs] extra.

What I'm not fond of in this demo is how big the block is on every page. I would like to have a big, prominent block, preferably on the home page (index.html) or wherever the project decides to place it.

Is there a way that the tidelift referral banner could be indicated by an RST directive and a plugin could generate the doc elements necessary to render the banner? Something like this:

setuptools docs/tidelift-autointegration $ git diff docs/index.rst
diff --git a/docs/index.rst b/docs/index.rst
index b9a796476..559af014b 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -18,3 +18,6 @@ Documentation content:
    Development guide <development/index>
    Backward compatibility & deprecated practice <deprecated/index>
    Changelog <history>
+
+
+.. tidelift-referral-banner::

jaraco added a commit to jaraco/jaraco.tidelift that referenced this pull request Jul 18, 2021
@jaraco

jaraco commented Jul 18, 2021

Copy link
Copy Markdown
Member

This PR is superseded by aa5ef50, which addresses the issue and may/should unblock #2465.

@jaraco jaraco closed this Jul 18, 2021
@webknjaz

Copy link
Copy Markdown
Member Author

@jaraco I noticed you adopted my hacky demo HTML snippet as is in your directive. Let me point out that since it was a demo, I didn't make it very clean — ideally, the styles should go to the CSS files and not be inline. Also, I didn't optimize for mobile and because of that it doesn't look great on phones at all — https://setuptools--2465.org.readthedocs.build/en/2465/

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