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

Google Fonts are loaded from remote server #111

Closed
jbms opened this issue Jun 15, 2022 · 7 comments · Fixed by #144
Closed

Google Fonts are loaded from remote server #111

jbms opened this issue Jun 15, 2022 · 7 comments · Fixed by #144

Comments

@jbms
Copy link
Owner

jbms commented Jun 15, 2022

Currently, this theme references Google Fonts from the Google server (inherited from mkdocs-material).

However, that means even a local copy of the built documentation still requires network access to obtain the fonts.

It would be better if the fonts could somehow be fetched/cached when building the documentation so that the built docs have no outside dependencies.

@2bndy5
Copy link
Collaborator

2bndy5 commented Jun 15, 2022

Google fonts are hosted from their own dedicated repo. Downloading them all can add an upward of 600 MB to the distribution. And then there's the problem that Google seems to update them whenever they want without notice (and often not tagging the changes).

Luckily, there seems to be a project that provides the fonts via npm called fontsource. Maybe that can be used to better solve this issue.

@2bndy5
Copy link
Collaborator

2bndy5 commented Jun 15, 2022

Have you thought about taking this upstream? I wonder if squidfunk would be keen on the idea. There's still the fetching of mermaid.js to consider.

@jbms
Copy link
Owner Author

jbms commented Jun 15, 2022

Yes, we wouldn't want to include all 600MB of fonts as part of the PyPI package. I think it would be better if as part of the documentation build (as opposed to the sphinx-immaterial package build), the fonts selected by the user were downloaded if not already cached and copied into the output directory.

Possibly mkdocs-material would also be interested in solving this issue, although I think they are less concerned about references external resources. Also since the solution would happen at documentation build time, it would be specific to sphinx or mkdocs.

@squidfunk
Copy link

We already solved this 4 months ago! 😊

@2bndy5
Copy link
Collaborator

2bndy5 commented Jun 15, 2022

We seem to building a growing list of features available to insiders; #61, #58, #56, and now this -- not a bad sign for us, but a competitive edge vs upstream public releases.


Unfortunately, I doubt we can solve this with an existing Sphinx ext because this theme is a rather unorthodox Sphinx theme (to keep faithful to upstream src).

@squidfunk
Copy link

squidfunk commented Jun 15, 2022

Linked content tabs have been released with 8.3.0 when the last funding goal was reached.

jbms added a commit that referenced this issue Aug 17, 2022
jbms added a commit that referenced this issue Aug 17, 2022
jbms added a commit that referenced this issue Aug 17, 2022
@2bndy5 2bndy5 linked a pull request Aug 17, 2022 that will close this issue
jbms added a commit that referenced this issue Aug 18, 2022
jbms added a commit that referenced this issue Aug 29, 2022
@jbms jbms closed this as completed in #144 Aug 29, 2022
jbms added a commit that referenced this issue Aug 29, 2022
* Download Google Fonts during the build

Fixes #111

* Add graphviz integration

Co-authored-by: Brendan <2bndy5@gmail.com>

* Add missing pyyaml test dependency to dev-requirements.txt

* chang dot file to radial graph

ensure dot files checkout with LF using .gitattributes

* remove graph name from dot file

* create a symlink to Graphviz plugins on all platforms

remove unused imports (namely the private _winapi from std python)

this relies on pathlib API more than os.path API for identical behavior

* graphviz: Add warning if LibGD cannot be found

Co-authored-by: Brendan <2bndy5@gmail.com>
@2bndy5
Copy link
Collaborator

2bndy5 commented Aug 30, 2022

fixed in v0.9.0

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 a pull request may close this issue.

3 participants