Skip to content

Conversation

@davep
Copy link
Contributor

@davep davep commented May 29, 2023

This is a follow-on PR from #1726, which aimed to satisfy #631. Since that PR #2629 and #2639 have arisen; likely the same issue, or at least massively-overlapping.

The main changes in this PR include:

  • Removal of the privacy plugin, which is only available to "Insiders". Without this change anyone wishing to build the Textual documentation for themselves would have to be a "Material for MkDocs Insider".
  • Removal of interlinking to the Python and Rich documentation for Python and Rich types from the common configuration, placing it instead in the "online" configuration. The downloading of the .inv files would result in an error when building the documentation while offline so this solves that.

With #2629 in mind specifically: we may want to have a think about what "building from scratch" means and who we have in mind when we say this. For the Textualize team, with access the "Insiders", this should never be a problem as long as the correct "Material for MkDocs" setup is in place; if that's the case then make docs-serve should work out of the box.

For people downloading the Textual source and wanting to build or work on the docs, they will need to use the offline targets in the Makefile. At the moment this isn't especially obvious so as a subsequent bit of work to this PR, perhaps there's some things to think about:

  • Perhaps building in a non-Textualize context should be the default?
  • Perhaps there should be a "How To" document that's about how to get a development environment up and running, including how to locally build or locally serve the documentation?
  • Both?

Meanwhile though, with this PR in place, as long as someone uses either make docs-serve-offline or make docs-build-offline, they should be able to work with the docs.

NOTE: The privacy plugin was originally used to reduce the number of external resources used by the documentation (fonts and, I think, some stylesheets). With it removed those external resources of course remain external. This means that if someone builds the offline docs and then actually uses them offline, there will be a degraded experience, mainly relating to the fonts used in diagrams and screenshots.

Here's some examples of the offline docs being viewed without an Internet connection:

Screenshot 2023-05-29 at 08 35 45 Screenshot 2023-05-29 at 08 36 51 Screenshot 2023-05-29 at 08 36 27

davep added 2 commits May 29, 2023 07:40
Yes, this does pretty much undo the "offline" part, but without this the
docs can't build if the builder doesn't have access to the insiders' edition
of mkdocs. Doing this as a first step to investigating if there's any
possible way to achieve what we want here:

- Anyone can build
- They can build offline
- They can build for maximum privacy

If not, this step at least hits the first requirement.

See Textualize#2629.
It looks like mkdocstrings will fail out if it can't download the inv files.
Unless there's a setting where you can tell it "try, but if you can't grab
them just don't try and create links" the approach here seems reasonable and
has the same effect.

Textualize#2629 (comment)
for reference.
@davep davep added documentation Improvements or additions to documentation Task labels May 29, 2023
@davep davep self-assigned this May 29, 2023
@davep davep marked this pull request as ready for review May 29, 2023 08:42
@davep davep merged commit 3e46279 into Textualize:main May 29, 2023
@davep davep deleted the docs-no-insiders-redux branch May 29, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get docs building without insiders Investigate building docs from scratch Include docs and tests on PyPI

3 participants