Some of the docs were accidentally reverted with other things, so I'm restoring them and adding a bit more.
Fixing an edge case: it is in fact possible to specify a URL with scheme and without netloc. Adding new tests to also catch that.
This is more considerate of the computational resources. The lint checks are not the bottleneck, and now they won't starve other jobs from starting.
All checks will still run and a failure in any of them will fail the job.
Also upgrade Python and Node versions
+ Remove unused 'max-parallel'
This reverts commit b89ec5792e.
That commit claims to fix some bugs in interactions with `use_directory_urls`, but in fact there are currently no known unfixed bugs.
So there is no need to have that breaking change.
In https://github.com/mkdocs/mkdocs/issues/1972#issuecomment-582952604
I was pointed to the README, but I hadn't looked for contact information there.
I think looking on the website is a reasonable way, and pointing to the README
from the "Contributing" page looks like a good help to me.
This goes back to the approach that was always used with 'livereload' library (but now just using the 'watchdog' implementation of the same), meaning the same downsides with latency and CPU usage.
But we have to do this to reasonably support usages that span virtual filesystems such as non-native Docker and network mounts.
This also simplifies the code, as the polling observer already follows symlinks and happens to support watching paths of files directly
This is a custom implementation that's significantly faster but gives the exact same results as the current one. The use of `posixpath.relpath` pulled in several path-specific transformations that are never needed here.
Efficiency is important because calls to `normalize_url` (e.g.) on a site with ~300 pages currently take up ~10% of the total run time due to the sheer number of them. The number of calls is at least the number of pages squared.
If the config file is specified as relative and is in the current directory, the `dirname` transform came out empty, which `subprocess` doesn't like as `cwd`.
Restore the ability to watch files through relative symlinks
(i.e. symlinks that have a non-absolute path as the target)
This was not fully fixed in #2427.
Switch from os.path.realpath to pathlib.Path.resolve
A new replacement option (theme.analytics.gtag) was added to the built-in themes. Multiple different services could be offered under theme.analytics. At this time only support for gtag exists, but more could be added in the future.
Fixes#2252.
* Support dict only markdown_extensions config
* Support dict only plugin config
* Remove explicit conversion to Unicode as PY2 is no longer supported.
* Refactor yaml_load so that is can recursively call itself.
Fixes#2218.
Watchdog doesn't support it directly but it happened to work everywhere except Windows
This is achieved by walking through the target directory, finding any symlinks in it, and watching their target too (+recursive walking of those too).
Important note: only symlinks that exist during startup will be taken into account, new ones aren't added.
Fixes#2425Closes#2426
When `mkdocs serve` is shutting down, it cleans up after itself removing
the temporary directory created earlier.
Previously the condition whether the directory is to be removed was
unchecked and prone to a file system race condition (shared resource).
Given the directory is absent on the file-system while shutting down,
`mkdocs serve` threw an exception and exited in failure.
Change is to override the cause of the exception by preventing the
attempt to remove a directory that is already gone.
Closes#2420.
This discards the dependency on 'livereload' and 'tornado'. This implementation is based on stdlib http.server and is much smaller, while not being a downgrade in any way.
This fixes#2061: multiple file changes no longer cause the site to repeatedly rebuild.
It also makes reloads much more responsive; they're "instant" rather than being on a 1-second polling interval or such.
Each HTML page gets JavaScript injected into it (like before) but now, instead of connecting to WebSocket, it requests a long-polling endpoint, which blocks until a newer version ("epoch") of the site is available - then the page knows to reload itself. After a minute without events, the endpoint will just return the unchanged epoch (to avoid timeouts), then the page requests the same endpoint again. The "downtime" in between requests is not a problem because these are not events that need to be received in real time; the endpoint can instantly report that the latest version is newer than the one the page identified itself as.
The reason to replace WebSocket isn't that it's bad or something, just that stdlib doesn't have it. But long-polling works completely fine here too.
The site_url config option is now required. If it is set to an empty
string, then use_directory_urls will be forced to false. Each will
issue a warning if not properly set. In a future release we may
raise an error instead.
Fixes#2189.
A framework for translating themes as been added, which includes:
1. Use of Jinja's `i18n` plugin for translating phrases in templates (not page content).
2. A French translation of the built-in themes (contributions in other languages are welcome).
3. A new `theme.locale` option to define the locale/language of the site.
4. The search plugin uses the value of `theme.locale` as its default 'lang'.
5. Third party themes may chose to use the framework (use is optional).
6. A documented workflow for translating MkDocs built-in themes.
7. Custom tooling for use by translators and theme devs.
The dependencies are not installed by default and are not needed to use MkDocs without translations. However, for anyone who wants to make use of the features, `pip install mkdocs[i18n]` will install all necessary dependencies.
Relates to #211.
Closes#2177
* Instead of using nav items for sitemap entries rendering, `[file.page for file in pages]` is used.
* Rendered sitemap.xml content is properly formatted using 4 spaces for indentation.