Skip to content

Install theme via theme_url [implement #179] - #410

Closed
ngzhian wants to merge 9 commits into
mkdocs:masterfrom
ngzhian:theme-url
Closed

ngzhian wants to merge 9 commits into
mkdocs:masterfrom
ngzhian:theme-url

Conversation

@ngzhian

@ngzhian ngzhian commented Apr 3, 2015

Copy link
Copy Markdown
Contributor

This is an updated PR from #221.

ngzhian added 3 commits April 3, 2015 17:53
First shot at enabling installation of theme via a url, specified by the
config param `theme_url`.
`theme_url` should point to a zip file online. The zip file will be
downloaded and unzipped to the `themes` folder.
Note that as of current implementation, `theme_url` installs the theme,
but does not use it, i.e. the `theme` parameter needs to be specified in
order for the newly installed theme to be used.

A point of consideration:
    - Should we check if the theme already exists? This is to prevent
      downloading every single time we run `config.py`
@d0ugal

d0ugal commented Apr 3, 2015

Copy link
Copy Markdown
Contributor

Nice! By the way, don't worry about the appveyor fail - the tests are currently failing on Windows. See #396 where I'm trying to fix that. The travis tests will need fixed tho' and then I can do a review :)

@ngzhian

ngzhian commented Apr 3, 2015

Copy link
Copy Markdown
Contributor Author

@d0ugal weird, the 2 test that failed seem to be some 404 error. That's a good chance to discuss with the way the test is written currently is suitable at all.

@d0ugal

d0ugal commented Apr 3, 2015

Copy link
Copy Markdown
Contributor

@ngzhian The problem is that you put testing data (yeti.zip) into the themes directory. We should only have themes directories in there. I'd move testing data into the tests directory.

@d0ugal

d0ugal commented Apr 3, 2015

Copy link
Copy Markdown
Contributor

To add further details - the integration test builds all themes, to find all the themes it looks in the theme directory. Until you added a zip file it only contained directories and no files - we could add a check to make sure it is a directory but I'd rather not have test data in there anyway.

@ngzhian

ngzhian commented Apr 3, 2015

Copy link
Copy Markdown
Contributor Author

@d0ugal sweet, moved the zip file to tests/ and tests passed.

- Don't install themes into the site-packages, we don't want to edit
  that. It should be considered read-only for us. Instead, download the
  theme to a .mkdocs directory in the same location as the mkdocs.yml
- When installing a theme, use it like a custom theme would be used by
  adding it to the theme_dir.
- Rather than include a zip file in the tests, create one on the fly
  that can be used - this makes it more flxible and clearer what is
  happening.
- Compare the extracted theme with the original zipped theme
- Use a pre-build theme zip for integration tests only
@d0ugal

d0ugal commented Apr 3, 2015

Copy link
Copy Markdown
Contributor

I played around with the code a bit and had a few suggestions. I sent you a pull request here: https://github.com/ngzhian/mkdocs/pull/1 - do you think they all make sense?

@d0ugal

d0ugal commented Apr 6, 2015

Copy link
Copy Markdown
Contributor

I've rebased this to fix the conflict in #424

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 this pull request may close these issues.

2 participants