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

DOCS: Add documentation on enabling Plausible Analytics #1814

Merged
merged 8 commits into from
Aug 21, 2022

Conversation

firasm
Copy link
Contributor

@firasm firasm commented Aug 18, 2022

Hello,

I wanted to add a section in the documentation about enabling and adding Plausible.io since I've now got its working.

Let me know if you'd suggest any changes to what I've written. (h/t to @RobertJoonas for the code and the idea).

Fixes and closes #1811.

@codecov
Copy link

codecov bot commented Aug 18, 2022

Codecov Report

Base: 91.39% // Head: 91.39% // No change to project coverage 👍

Coverage data is based on head (c9eb950) compared to base (f7d1e42).
Patch has no changes to coverable lines.

❗ Current head c9eb950 differs from pull request most recent head 29811f9. Consider uploading reports for the commit 29811f9 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1814   +/-   ##
=======================================
  Coverage   91.39%   91.39%           
=======================================
  Files           7        7           
  Lines         686      686           
=======================================
  Hits          627      627           
  Misses         59       59           
Flag Coverage Δ
pytests 91.39% <ø> (ø)

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

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

A few quick thoughts but it looks good to me! Also a note that we can have this supported natively when we update to the latest pydata theme:

docs/advanced/html.md Show resolved Hide resolved
docs/advanced/html.md Outdated Show resolved Hide resolved
docs/advanced/html.md Outdated Show resolved Hide resolved
docs/advanced/html.md Outdated Show resolved Hide resolved
docs/advanced/html.md Outdated Show resolved Hide resolved
firasm and others added 6 commits August 19, 2022 10:29
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
@firasm
Copy link
Contributor Author

firasm commented Aug 19, 2022

Thanks @choldgraf ! I've accepted all your suggestions.

Great to hear native support is coming in - if you think that'll be merged in, in the next few days/weeks, then I'm fine to close this PR without merging it in.

It's in the git repo as a PR and there's an associated issue so it's reasonably discoverable already for the keenest.

docs/advanced/html.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

Nah let's merge this in since it's an improvement and we can re-arrange things later if that feature gets made available in the pydata theme! Many thanks @firasm :-)

@choldgraf choldgraf changed the title Add documentation on enabling Plausible Analytics DOCS: Add documentation on enabling Plausible Analytics Aug 21, 2022
@choldgraf choldgraf merged commit 91b52c4 into jupyter-book:master Aug 21, 2022
@rkdarst
Copy link
Contributor

rkdarst commented Oct 24, 2022

By the way, custom theme support shouldn't be necessary. I just made a Sphinx extension that should handle it for any theme (that uses standard sphinx includes...) https://pypi.org/project/sphinx-plausible/

Is there any chance you would want to adopt this project? There is nothing specific to executablebooks about this, but executablebooks is where I contribute to most of my sphinx extensions, so seems like a place with enough knowledge for group maintenance...

@choldgraf
Copy link
Collaborator

My 2 cents is that I prefer to re-usr sphinx extensions (provided they are lightweight, tested, etc) for the functionality, and just provide theme-specific support for the UI/UX

@rkdarst
Copy link
Contributor

rkdarst commented Oct 27, 2022

Actually, an extension is just as unnecessary as modifying the theme. This config in conf.py will add the relevant script tag to any sphinx project using any (properly designed) theme:

html_js_files = [                                                                                                          
    ('https://plausible.io/js/script.js', {"data-domain": "yourdomain.com", "defer": "defer"}),                            
]                                                                                                                          

... which I guess you can directly hook into the jupyter-book config system?

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.

Incorrect instructions for Plausible.io Analytics
3 participants