Skip to content

Commit

Permalink
Merge pull request #638 from graphistry/dev/plausible
Browse files Browse the repository at this point in the history
docs(plausible): privacy-preserving docs analytics
  • Loading branch information
lmeyerov authored Jan 11, 2025
2 parents 62ab2ca + 07d7a95 commit bd483a9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
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)

0 comments on commit bd483a9

Please sign in to comment.