135 Commits

Author SHA1 Message Date
Mahdi Majidzadeh
2990af2b63 Config docs should match YAML syntax (#1341) 2017-11-07 18:21:02 -05:00
Waylan Limberg
3f2ad4977f Fix search for third-party themes.
Added theme customization settings to the search plugin:

* include_search_page: Determines whether the search plugin expects the
theme to provide a dedicated search page via a template located at
`search/search.html`.

* search_index_only: Determines whether the search plugin should only
generate a search index or a complete search solution.

Themes should define these settings in their `mkdocs_theme.yml` config file.
Documentation has been updated as well. Fixes #1315.

Note: while we would not normally add new settings (features) in a point
(bugfix) release, this is fixing a regression for third party themes.
Therefore, it is a "bugfix" and appropriate for a point release.
2017-10-25 15:46:36 -04:00
Waylan Limberg
54a24ea89f Override site_url with dev_addr on local server.
When serving locally, the `site_url` actually is the `dev_addr`, so the
config should relfect that. Note that this override must happen after
config validation so that the proper defaults are evaluated for the
`dev_addr` setting. It cannot happen as part of "post_validation" as
there is no way to know the dev server is running within the config
validation (for example, the dev_addr may not be None as the user could
have set the `dev_addr` setting in their config file). Overriding it
from the serve command is the least invasive method and guarantees it
only happens when the local dev server is being run.

Also cleaned up `dev_addr` docs, which were missleading in some respects
and actually encouraged using the dev server over a network.

Fixes #1317. 404 Error pages now work on the loval dev server when
the `site_url` in the config points to a subdir.
2017-10-20 15:12:06 -04:00
Waylan Limberg
1477ea87be Some edit_uri tweaks.
* Improve documentation and ensure it matches actual behavior.
* Use `page.edit_url` not `config.edit_url` in mkdocs template (opps).
* Include whitespace between icon and label in mkdocs theme.
* Undefined `edit_uri` results in `page.edit_url = None` when not automated.
* Setting `edit_uri: ''` disables automatic edit_uri for GitHub & Bitbucket.
2017-10-19 14:47:17 -04:00
Waylan Limberg
4b8626c166 Improved theme config docs. 2017-10-19 14:47:17 -04:00
Jesse Kinkead
3f98d1deb3 Add "edit link" support to MkDocs theme.
Theme shows either a repo link or an edit link depending on whether
`edit_uri` is set. Also clarified documentation that this behavior is
dependant upon theme support. Fixes #1129.
2017-10-19 10:05:06 -04:00
Waylan Limberg
31e7c29784 Set 'search' as a default plugin.
Maintains better backward-compatability. Documentation updated, including
how to override the default. Also renamed the entry_point to 'search'.
The lib is still 'legacy_search'. When a new/better search plugin is
developed, the `search` entry_point will be pointed there so the default
behavior will inlcude the upgrade and a new `entry_point` will be added
('legacy_search') which points to the old plugin for those who really want
it.
2017-10-12 16:12:40 -04:00
Frank Sachsenheim
a0e7f17488 Cleanup in plugin docs 2017-10-01 16:48:47 -04:00
Frank Sachsenheim
e1455e7a02 plugins: Adds a load_page_markdown event
This allows to override the loading of source files,
e.g. to fetch it from a remote location or for
generated contents.
2017-10-01 16:48:47 -04:00
Waylan Limberg
ffae0ef89c The Plugin API. (#1223)
See the included documentation for a full explanation of the API.

Search has been removed and wrapped in a plugin (named "legacy_search").
The search feature was ported as-is. None of the open issues with search
have been addressed. Presumably, a new search plugin will be built from
the ground up which addresses those issues.

Note that there is no 'default' plugins. That means that users get no
search unless they enable it in the config by adding the following to
their `mkdocs.yml` file:

    plugins:
        - legacy_search

Fixes #206
2017-10-01 16:48:47 -04:00
Waylan Limberg
75350da44c Theme refactor.
Themes now have `theme` objects, and theme specific configs.
Themes can inherit from other themes. Users (and theme authors)
can define custom static templates and variables.
2017-10-01 16:48:47 -04:00
Oscar Vasquez
aa9a2fdcea Added support for query and fragment strings in edit_uri 2017-05-12 23:42:27 -04:00
Georgii Staroselskii
bf4938d5b9 custom-themes.md: fix a homepage typo (#1199)
s/hompage/homepage
2017-04-06 08:50:09 -04:00
Terrell Russell
59026644f1 fix typo (#1185)
Fixes #1184
2017-04-04 10:07:20 -04:00
John Kerssens
82bcdbab69 Fix typos (#1181) 2017-04-04 10:07:02 -04:00
Waylan Limberg
1795d7655a System root ("/") is not a valid path for site_dir or docs_dir.
As neither setting can point at a child dir of the other, "/" would be an
invalid value for either setting. However, given its unique nature,
os.path.abspath does not follow normal bahavior of returning a string without
an ending slash when passed "/". Therefore, we need to special case it.

Fixes #1161.
2017-03-13 21:45:34 -04:00
Itamar Ostricher
48ad73c64b Fix spelling 2017-03-13 11:57:25 +02:00
Itamar Ostricher
b16dfa6d36 Fix spelling 2017-03-13 10:48:13 +02:00
Waylan Limberg
58441f368b Templates have extension .html (typo fix in docs). 2017-03-12 19:36:59 -04:00
Kevin J. Qiu
590ae3114d Fix typo (#1146) 2017-03-01 16:10:45 -05:00
Dougal Matthews
ecc0550c71 Correct the default for the remote_name config
See: https://github.com/mkdocs/mkdocs/blob/master/mkdocs/config/defaults.py#L119
2016-11-23 22:14:59 +00:00
Waylan Limberg
503ad7e9b6 Document using theme_dir and template blocks togeather. 2016-11-03 13:10:12 -04:00
Waylan Limberg
1a087f62ed Merge pull request #1068 from waylan/config-links
Clean up configuration.md links.
2016-10-06 15:19:13 -04:00
Waylan Limberg
d39743b17b Clean up configuration.md links.
They were a mess. Fixes #1058
2016-10-06 14:46:41 -04:00
Michael William Boldt
fdd6e5ac52 Fix typo (Stardard -> Standard) 2016-10-06 10:13:30 -05:00
Waylan Limberg
aebfcdc39c Merge pull request #1026 from waylan/global_vars
Global Template vars refactor
2016-09-28 09:07:12 -04:00
Waylan Limberg
de2a7370de Fix a couple markdown lint errors.?? 2016-08-25 21:42:41 -04:00
Waylan Limberg
50e1734490 Deprecate site_favicon config setting and favicon template var
Templates need only include `{{ base_url }}/img/favicon.ico` and
users only need to create a file at `img/favicon.ico` in their
`docs_dir`.

Fixes #725.
2016-08-18 14:24:12 -04:00
Waylan Limberg
2641b6409d Refactor global template variables.
Any template variables which mirrored a config setting have been deprecated
and should be accessed via the coresponding config template variable.

This resolves the rest of #874.
2016-08-15 20:53:21 -04:00
Tom Christie
4a532be1f0 Deprecate include_nav and include_next_previous.
Fixes #679 and #681.
2016-08-15 20:39:53 -04:00
Waylan Limberg
8b6c13f0e0 Break up libs and scripts into 2 seperate template blocks.
Some scripts need to execute after the page has finished loading.
To ensure that, the `scripts` block is placed at the bottom of the page.

However, if a user embeds scrpts within the body, and those scripts
rely in libs, then the libs need to already be loaded. By having
`libs` be a seperate block at the top of the page (int he header),
we can ensure that will work.

And we still want the libs in a block so a user can override them,
or even add to them (via `{{ super() }}`).

Fixes #956
2016-08-10 15:58:05 -04:00
Waylan Limberg
ea02a2eea3 Deprecate auto-populating extra_css/javascript. 2016-08-09 22:50:35 -04:00
Andrew E Slaughter
81664fac4a A simple method for providing a quick/dirty reload option (refs #990) 2016-07-27 08:33:25 -06:00
Waylan Limberg
f4d0f11335 Document pages config setting default behavior.
Fixes #992. Not sure how this was missed.
2016-07-18 15:13:29 -04:00
Dougal Matthews
19677e69b4 Merge pull request #985 from d0ugal/issue/md
Remove extra theme_dir alias
2016-06-29 07:39:34 +01:00
Dougal Matthews
8091bcc2be Sort the links to make finding duplicates easier 2016-06-28 23:18:55 +01:00
Dougal Matthews
da56388055 Remove extra theme_dir alias
theme_dir is listed twice at the bottom links, this removed the
one that relates to this page. All usages make sense when linking
directly to the config page.
2016-06-28 23:10:53 +01:00
Dougal Matthews
06fab4bf3d Add a note about 404 pages on the deploying page
Fixes #732
2016-06-28 23:04:58 +01:00
Loren Gordon
b36646bef3 Use the edit url for the GitHub 'Edit on...' links 2016-06-28 10:59:20 -04:00
lorengordon
ac5a8a7b39 Direct edit links to individual pages
This patch adds support for a configuration option `edit_uri` that
is used to generate a link directly to an individual page in the
source repository.

Fixes #269
2016-06-27 16:38:30 -04:00
Dougal Matthews
176b722c1c Merge pull request #947 from waylan/template
Support theme customization with blocks
2016-05-31 10:28:24 +01:00
Brian J King
6b892249bc Fix typo in scp command
scp -r ./site command was missing the E in user.
2016-05-27 14:53:25 -05:00
Waylan Limberg
37a542cdb2 Improve documentation regarding template blocks. 2016-05-27 11:06:04 -04:00
Waylan Limberg
3c6504fd7d Support theme customization with template blocks
This is a backward incompatable change as it switches the primary
template from base.html to main.html.  See the release notes for
details.

Partially addresses #607.
2016-05-27 11:03:52 -04:00
Saurabh Kumar
72e3992188 Fix minor typo in documentation 2016-05-11 22:59:03 +05:30
Waylan Limberg
f8a0ac6e03 Refactor page specific template variables.
A deprecation warning is issued for all old variables and all new
page specific variables are attributes of the 'page' object.

Global variables are uneffected, except page_description.

See the changes described in the release notes for details.

Fixes #874.
2016-05-01 19:40:00 -04:00
Dougal Matthews
b2cb385db3 Merge pull request #911 from waylan/theme-docs
Document theme_dir. Fixes #863
2016-04-29 15:42:22 +01:00
Dougal Matthews
d8d8341808 Fix the feedback from LinkChecker and enforce it in the Travis config 2016-04-29 11:09:48 +01:00
Waylan Limberg
4bb0c1cb1a Document theme_dir. Fixes #863 2016-04-27 11:49:37 -04:00
Jean Cruypenynck
4e889c451f Fix Markdown table syntax 2016-04-11 20:20:04 +02:00