335 Commits

Author SHA1 Message Date
Waylan Limberg
8bd00d5f91 markdownlint cleanup 2018-08-03 10:26:40 -04:00
Waylan Limberg
1f41f33eae Upped version 1.0 Final! 2018-08-03 10:26:40 -04:00
coliff
6c097ecbdb Losslessly optimize images with gulp-imagemin
Saved 197KB (38%)
2018-07-19 11:53:56 -04:00
coliff
b4b49a1f52 HTTPS Links 2018-07-19 11:53:56 -04:00
Christian Oliff
39dc230b6d HTTPS links to www.mkdocs.org (#1558) 2018-07-19 10:04:00 -04:00
Waylan Limberg
06608e98a7 Add hljs_style config to mkdocs theme.
This is primarily to allow third party themes which inherit from the 
mkdocs theme (such as the bootswatch themes) to alter the code 
highlighting style. Previously all of the themes hosted their own 
highlighting styles, but now that we are using the CDN, it is easier to 
use a setting, which downstream themes can override.
2018-07-17 16:14:45 -04:00
Waylan Limberg
21449eeea8 Don't conflict with accessibility shortcuts.
In both built-in themes, the default next/prev shortcut keys were
changed from arrows to n/p as the arrows conflict with common browser
accessibility extensions.

In the mkdocs theme,  users can now configure the shortcuts to whatever
they want. Note that these config options are theme specific. The
readthedocs theme does not get these options as they are not available
on the parent theme.

Fixes #1502
2018-07-13 17:40:31 -04:00
Waylan Limberg
b89d309c5f User friendly YAML parse errors.
This provides a clearer error for users who have an invalid config file. 
Partially addresses #1543.
2018-07-12 16:17:24 -04:00
Waylan Limberg
7c0d0b7624 Add official support for PY37. (#1545)
* Use Python 3.7-dev in Travis until they add official support for PY37.
* PY37 requires PyYAML 3.13+.
2018-07-12 15:24:19 -04:00
Waylan Limberg
c99ea4e250 Missing theme config file raises an error.
Previously a warning was raised and the build proceeded.
2018-07-11 14:54:58 -04:00
Waylan Limberg
ad867796eb theme_dir config fully Deprecated.
An error is now raised if the option is defined.
2018-07-11 14:54:58 -04:00
Waylan Limberg
d0c67b849c Empty extra_css and extra_javascript settings no longer raise a warning.
This fully deprecates autopopulating those settings.
2018-07-11 14:54:58 -04:00
Waylan Limberg
da92f72ec8 Add support for YAML meta data. (#1542)
If the frontmatter is surrounded by YAML deliminators, then it is parsed 
as YAML. Otherwise it is parsed as MultiMarkdown meta-data and each 
value is returned as a joined string.

Closes #1471.
2018-07-11 13:18:20 -04:00
Waylan Limberg
2f34aec1eb Up version to 1.0.dev
And update release notes to include 0.17.5.
2018-07-06 11:47:11 -04:00
Dmitry Shachnev
67630d888b docs: Replace RTD screenshot with a working one. (#1505)
The remotely linked image was removed in rtfd/readthedocs.org#3438.

Turns out we already have a local image we can use.
2018-07-05 16:35:18 -04:00
Waylan Limberg
2e9de0a297 Add a highlightjs config setting (#1533)
The built-in themes now include support for enabling/disabling
highlight.js. They also use a CDN to load the files. As the CDN only
includes 23 languages, a second setting to support more languages
is included.

If a user wishes to use a different tool for highlighting, they can
"disable" highlight.js and then use extra_css and/or extra_javasript
to add support for their tool of choice.
2018-07-05 13:47:16 -04:00
Waylan Limberg
de576b03bd Close search modal when result is selected.
Fixes #1527.
2018-07-04 17:59:54 -04:00
Waylan Limberg
a1b26ebabe Update documenation. 2018-07-03 15:26:28 -04:00
Waylan Limberg
fb5abb05a7 Document the builtin themes' lack of support for multi-level nav. 2018-06-29 16:07:03 -04:00
Waylan Limberg
fb9d9e36fb Add a level attribute to AnchorLinks.
This relimplements #1272 on the current code in master. Thanks to 
@funkyfuture for the original work on this.

Also removes some unused code after #1504.

Closes #1272.
2018-06-29 14:40:22 -04:00
Waylan Limberg
78ee87cc2e Document using custom domains with GitHub Pages.
Fixes #1496.
2018-06-29 11:14:57 -04:00
Waylan Limberg
34ef3ca6d0 Internal Refactor of Pages, Files, and Navigation (#1504)
Internal handling of pages, files and navigation has been completely refactored.
The changes included in the refactor are summarized below.

* Support for hidden pages. All Markdown pages are now included in the build
  regardless of whether they are included in the navigation configuration
  (fixes #699).
* The navigation can now include links to external sites (fixes #989, fixes #1373,
  & fixes #1406).
* Page data (including titles) is properly determined for all pages before any
  page is rendered (fixes #1347).
* Automatically populated navigation now sorts index pages to the top. In other
  words, The index page will be listed as the first child of a directory, while
  all other documents are sorted alphanumerically by file name after the index
  page (fixes #73 & fixes #1042).
* A `README.md` file is now treated as an index file within a directory and
  will be rendered to `index.html` (fixes #608).
* The URLs for all files are computed once and stored in a files collection.
  This ensures all internal links are always computed correctly regardless of
  the configuration. This also allows all internal links to be validated, not
  just links to other Markdown pages. (fixes #842 & fixes #872).
* An `on_files` plugin event has been added, which could be used to include
  files not in the `docs_dir`, exclude files, redefine page URLs (i.e.
  implement extensionless URLs), or to manipulate files in various other ways.

Backward incompatible changes are highlighted in the release notes included 
with this commit. Some notes regarding various decisions follow in no particular 
order:

This started out as the contents of the 'structure' dir from @tomchristie's 
work in #689.

All paths must be all Unicode all the time. When a byte string and a 
Unicode string are both passed to os.path (join ect) then returned value 
is always a byte string. Therefore, we need every path string to be 
Unicode. This ensures validation checks that and if the byte string uses 
the file system encoding, decodes it. For any other encoding, a 
validation error is raised.

Paths which start with a slash are assumed to be relative to the
docs_dir root. This behavior fixes #192. However, the slash not being
present in the output may surprise some users who are trying to create a
link relative to the server root when the mkdocs root is not at the
server root. The URLs available on a page are:

* Page.url is the url relative to the site_dir
* Page.canonical_url is the relative url joined with site_url or None if
  site_url is not defined (the default).
* Page.abs_url is the path component of the canonical url or None if
  canonical_url is None.

Note that new behavior is slightly different than before. Previously
abs_url ignored site_url and was always url with '' prepended. With the
new behavior, if site_url includes a subdir, that subdir will be
included in the abs_url.

When not on a server, there is no sensable "absolute_url" for a page.
Therefore, we shouldn't try to define one.

The thinking is that users generating docs to be browsed in the local
file system (`file://`) should leave the site_url setting unset, while
users who will be serving their docs from a server should be setting the
site_url. And if the site_url point sot a subdir of the server, the
abs_url will stil be absolute from the server root as it uses the "path"
of the canonical_url of the page.

Note that without the magical url context all URLs must be prepended by
`{{ base_url }}/` in the templates. While this requires a change in
third party themes, it is more consistent.

Links being ignored in raw HTML is now documented. Fixes #991.

All related tests that require temp dirs use the `mkdocs.tests.base.tempdir`
decorator. Note that any unrelated tests have not yet been updated. 
That can happen separately from this. The one test in 
`mkdocs.tests.structure.page_tests` (test_BOM) is unique enough to 
not use the decorator.
2018-06-28 15:08:17 -04:00
Waylan Limberg
7e06ca68d1 Add multi-level nesting support to sitemap.xml
Fixes #1481.
2018-05-09 11:55:58 -04:00
Waylan Limberg
e5c2459fdf Warn users deploying with older version. (#1467)
Fixes #640.
2018-04-12 16:08:33 -04:00
Waylan Limberg
e57e2269d9 Improve Markdown extension error messages.
Fixes #782. Note that we mock Markdown in the tests to ensure those
tests are not using Markdown to validate the extension names. We don't
mock Markdown in the tests which we do want Markdown to validate the
extension names.

Also ensure project-min has all relevant extensions.
2018-04-06 15:26:57 -04:00
Waylan Limberg
a43163fc8d Document deploying to GH User/Org Pages.
Fixes #1291 and made possable by the work in #1376.
2018-04-04 15:55:40 -04:00
Joseph Lombrozo
a3e60f1385 Paths in config file are relative to the config file. (#1376) 2018-04-04 11:58:38 -04:00
Waylan Limberg
d6449f9080 Drop official support for Python 3.3.
Also up tornado version to >=5.0. Fixes #1427.
2018-04-03 15:49:15 -04:00
James Rhea
fa4c7e5bb3 Noted support for python 3.6
"Officially added support for Python 3.6 (#1296)" as of version 0.17.0.

Source: http://www.mkdocs.org/about/release-notes/#version-0170-2017-10-19
2018-04-03 13:33:57 -04:00
Waylan Limberg
35f6412b51 Update release-notes
Whoops, forgot to add this in 71ebf35.
2018-03-16 15:34:42 -04:00
Felix Eckhofer
71ebf353e6 Add support for GitLab repositories (#1435)
Note that the icons in the themes will not show up until FontAwesome is
updated to at least version 4.6 and/or an up-to-date version of the
upstream readthedocs css is imported.

This commit also fixes a slight documentation error regarding the
default value of `repo_name` and removes some tautological tests.
2018-03-15 09:31:51 -04:00
Waylan Limberg
1c80f6d663 Better document plugin config
Fixes #1391.
2018-03-09 19:06:24 -05:00
Waylan Limberg
5ee6600c95 Link to GitHub issues from release notes.
Uses the `mdx_gh_links` Markdown extension. Fixes #644.
2018-03-09 14:08:24 -05:00
Waylan Limberg
dd7e2d910b Refactor search plugin (#1418)
* Use a web worker in the browser with a fallback (fixes #859 & closes #1396).
* Optionally pre-build search index (fixes #859 & closes #1061).
* Upgrade to lunr.js 2.x (fixes #1319).
* Support search in languages other than English (fixes #826).
* Allow the user to define the word separators (fixes #867).
* Only run searches for queries of length > 2 (fixes #1127).
* Remove dependency on require.js, mustache, etc. (fixes #1218).
* Compress the search index (fixes #1128).
2018-03-05 19:42:20 -05:00
Anatoli Babenia
0dce2b2b9e Expand {sha} and {version} is user commit message (#1410) 2018-02-22 09:31:19 -05:00
Waylan Limberg
a793eede8b Update release notes. (#1403) 2018-02-06 14:58:45 -05:00
Mario
a63d885cc8 Update Tables documentation (#1361) 2018-02-02 23:35:21 -05:00
Waylan Limberg
4b8687eee7 Refactor writing-your-docs.md (#1392)
Present the sections in a logical manner:

1. File Layout (where to save documents)
   * Configure Navigation...
2. Writing with Markdown
   * Supported extensions...

Added documentation for all included extensions. Also added some basic
information about Markdown; pointing to the implementation and rules.
Fixes #1385, fixes #316, and fixes #1172.
2018-01-23 16:29:14 -05:00
brandongc
d00a8e52f5 Refactor utils.copy_media_files for more flexibility (#1370) 2018-01-05 14:01:34 -05:00
Waylan Limberg
fc2f105bad Document how to generate/install manpages. (#1302)
Fixes #686.
2017-12-31 22:19:58 -05:00
Alexandre ZANNI
8d4a883d89 change theme_dir to custom_dir 2017-12-29 08:42:24 -05:00
Brendan Abbott
ab0b5824d0 Update Release Notes regarding Search plugin. (#1364)
Outline that the path where the search index is written to has changed slightly from `mkdocs/` to `search/`
2017-12-18 11:22:10 -05:00
Waylan Limberg
b9b37491e9 Update Python-Markdown links.
Python-Markdown has moved its documentation to
https://python-markdown.github.io/. See Python-Markdown/markdown#601
for details. The docs now point to the new location.

The Python-Markdown GitHub repo was also moved to
https://github.com/Python-Markdown/markdown so any links to the repo
have been updated as well.
2017-12-07 12:04:28 -05:00
Waylan Limberg
dfb50c9160 Remove PyPI Deployment Docs.
PyPI's documentation hosting has been deprecated, and in fact, it
is no longer possable to upload documentation to PyPI. Therefore,
it is a disservice to our users to document how to deploy to that
service.

See the mailing list dicussions for the official announcement:
https://mail.python.org/pipermail/distutils-sig/2015-May/026327.html
https://mail.python.org/pipermail/distutils-sig/2015-May/026381.html
2017-12-07 12:04:28 -05:00
Matthew Schmoyer
4c7c69cd3a Fix typo with plugins module name 2017-11-29 21:58:35 -05:00
Robin Stevens
e46506b4ce Typo (#1357) 2017-11-27 11:58:04 -05:00
Waylan Limberg
269190c9aa Up version to 0.17.2. (#1350) 2017-11-15 10:34:02 -05:00
Mahdi Majidzadeh
2990af2b63 Config docs should match YAML syntax (#1341) 2017-11-07 18:21:02 -05:00
Waylan Limberg
b504e14501 Correct extra_* config setting regressions.
The warning for missing files should only be issued if the config
setting is empty. The warning only exists because we disabled
autopopulating of the settings. Autopopulating only used to run
when the setting was empty so the warning is not nessecary if
the setting has been populated.

Given the above, no string comparisons need to be made as we
only need to check if any files exist when empty. Therefore, we
don't actually need to normalize paths. As we are no longer
modifying users' strings, they can again put any string in their
config, such as URLs of CDNs.

Fixes #1335 & #1336.
2017-11-01 15:24:52 -04:00
Waylan Limberg
109e517f7f Upped version to 0.17.1. 2017-10-30 14:45:58 -04:00