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(plausible): privacy-preserving docs analytics #638

Merged
merged 7 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Development]

## [0.35.6 - 2025-01-11]

### Docs

* Fix typo in new shaping tutorial

* Privacy-preserving analytics

## [0.35.5 - 2025-01-10]

Expand Down
11 changes: 1 addition & 10 deletions demos/more_examples/simple/table_to_graph_three_ways.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"\n",
"Local pip install to run the shaping and analytics locally, CPU or GPU\n",
"\n",
"For the GPU cloud visualization sessons, and GPU analytics offloading of bigger graphs, get a free username/password or api key at [hub.graphistry.com](hub.graphistry.com)"
"For the GPU cloud visualization sessons, and GPU analytics offloading of bigger graphs, get a free username/password or api key at [hub.graphistry.com](https://hub.graphistry.com)"
]
},
{
Expand Down Expand Up @@ -839,15 +839,6 @@
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "-TGBwgfNgATr"
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
31 changes: 29 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import docutils.nodes, os, logging, re, sys
from docutils import nodes
from packaging.version import Version
from sphinx.application import Sphinx


sys.path.insert(0, os.path.abspath("../.."))
Expand Down Expand Up @@ -759,12 +760,38 @@ def assert_external_images_removed(app, doctree, fromdocname):
assert "://" not in image_uri, f"Failed to remove external image: {image_uri}"


def setup(app):
def setup(app: Sphinx):
"""
Connect the replace_iframe_src function to the doctree-resolved event.
"""

app.connect("doctree-resolved", ignore_svg_images_for_latex)
app.connect("doctree-resolved", remove_external_images_for_latex)
app.connect('doctree-resolved', replace_iframe_src)
app.connect("doctree-resolved", assert_external_images_removed)
app.add_css_file('graphistry.css', priority=900)

def on_builder(app: Sphinx) -> None:
if not hasattr(app, 'builder'):
print('No app.builder found for app type=', type(app))
# use dir to enumerate field names & types
attr_and_types: str = '\n'.join([f'{name}: {type(getattr(app, name))}' for name in dir(app)])
print(f'attr_and_types:\n---\n{attr_and_types}\n---\n')
return

if (app.builder.name == "html" or app.builder.name == "readthedocs"):
app.add_css_file('graphistry.css', priority=900)
app.add_js_file("https://plausible.io/js/script.hash.outbound-links.js", **{
"defer": "true",
"data-domain": "pygraphistry.readthedocs.io",
})
app.add_js_file(None, body="""
window.plausible = window.plausible || function() {
(window.plausible.q = window.plausible.q || []).push(arguments)
}
""")
return

print('No custom handling for app.builder.name=', app.builder.name)

app.connect('builder-inited', on_builder)

Loading