Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ability to search for documentation in repository root and in "./docs/" #4

Merged
merged 10 commits into from
Feb 19, 2019
Merged

Adds ability to search for documentation in repository root and in "./docs/" #4

merged 10 commits into from
Feb 19, 2019

Conversation

dduportal
Copy link
Contributor

This PR introduce the ability to search, build and manage documentation when it's located in the ./docs sub directory.

Please note that it fixes an issue coming from #2 (and currently on master): if docs.Dockerfile is found into ./docs, then the build fails if requirements.txt is not next to it. But if we let mkdocs.yml at the root of the repo (on the same version), it also requires requirements.txt next to it.

…r mkdocs.yml

Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>

No need to duplicate the same information

Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
@ldez ldez added the kind/enhancement New feature or request label Feb 18, 2019
core/core.go Outdated Show resolved Hide resolved
core/core.go Outdated Show resolved Hide resolved
core/core.go Outdated Show resolved Hide resolved
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Some code can be simplify.

Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
…nction

Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
@dduportal
Copy link
Contributor Author

  • First batch of review applied. WDYT @ldez : did I forget something of what we discussed?
  • This PR should be blocked: there is a regression for generating the menu, I'm working on this.

Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
@dduportal
Copy link
Contributor Author

Broken menu fixed, it was easy:

  • Added a method to get the value of the docs_dir attribute from mkdocs.yml and returns the full path (parent dir of mkdocs.yml + found value of docs_dirs).
  • Edited the menu.go to adapt the copy of the JS (and eventual custom CSS) for menu.
  • And that's all: we don't have to rollback anything in Documentation Revamp traefik#4475 . This fix does not enforce anything about existing resources: structor adapts itself.

=> Validated on github.com/dduportal/traefik.

Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@dduportal
Copy link
Contributor Author

OK, latest code works very well (on my fork :) ) for all of these scenarios:

  • Build with current master (all branches have mkdocs.yml on the root). Even v1.1 works. Menu works for all.
  • Build with master having mkdocs.yml in ./docs/. Even v1.1 works. Menu works for all.
  • Build with a branch v15.0 tagged with v15.0.0 and v15.0.1. Even v1.1 works. Menu works for all. v1.7 is seen as v.1.6 today.

@ldez ldez merged commit b5d235c into traefik:master Feb 19, 2019
@dduportal dduportal deleted the docs-root branch February 19, 2019 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants