Code Monkey home page Code Monkey logo

Comments (7)

joolswills avatar joolswills commented on May 20, 2024 1

I have implemented a workaround for this using a small php script on our server that redirects to the correct page. This avoids having to modify mkdocs.

from retropie-docs.

HerbFargus avatar HerbFargus commented on May 20, 2024

The material theme by default assumes the docs are hosted on a GitHub repository but we build them from the retropie wiki itself (which is technically a repository to but not the type that's expected)

https://github.com/RetroPie/RetroPie-Setup/wiki

Two options for us are to remove the edit on github links, or find a way to point them to where they actually reside. My preference would be the former.

from retropie-docs.

jamesrhea avatar jamesrhea commented on May 20, 2024

What would happen if you changed repo_url within https://github.com/RetroPie/RetroPie-Docs/blob/master/mkdocs.yml to "https://github.com/RetroPie/RetroPie-Setup/wiki"?

The other config possibility is to use the edit_uri config option: http://www.mkdocs.org/user-guide/configuration/#edit_uri.

from retropie-docs.

HerbFargus avatar HerbFargus commented on May 20, 2024

So from the docs mkdocs appends the repo_url with the edit_uri to get an editable link.

Changing the repo url wouldn't really solve it. for example:

The default (incorrect) link to edit the home page is:

https://github.com/Retropie/RetroPie-Setup/edit/master/docs/index.md

This assumes it's hosted on a github wiki, but even if we switched it to https://github.com/RetroPie/RetroPie-Setup/wiki it wouldn't work since it would append an edit path incorrectly:

https://github.com/RetroPie/RetroPie-Setup/wiki/edit/master/docs/index.md

lets say we manually redefine the edit_uri to just the root path /

You still would get:

https://github.com/RetroPie/RetroPie-Setup/wiki/edit/index.md

which doesn't work as the wiki edit urls resolve to:

https://github.com/RetroPie/RetroPie-Setup/wiki/Home/_edit

(btw the home page will always be perpetually broken since the github wiki's home page is named Home.md whereas mkdocs looks for index.md as the home page so in our conversion script we end up renaming Home.md to index.md

So if there is a way to have the edit_uri use variables or wildcards (perhaps that's what they mean by fragments or query characters) of sorts like

/wiki/$pagename/_edit

It might work for all but the home page. but I haven't tested it. note this is all conjecture based on how I understand the docs, I haven't validated it with any real tests as of yet

from retropie-docs.

HerbFargus avatar HerbFargus commented on May 20, 2024

From my tests:

using something like

edit_uri: '/RetroPie/RetroPie-Setup/wiki/'

On the installation page it will resolve to:

https://github.com/RetroPie/RetroPie-Setup/wiki/First-Installation.md

which redirects to:

https://raw.githubusercontent.com/wiki/RetroPie/RetroPie-Setup/First-Installation.md

And even if we were able to append _edit to the URL it would yield this:

https://github.com/RetroPie/RetroPie-Setup/wiki/First-Installation.md/_edit

Instead of the correct page:

https://github.com/RetroPie/RetroPie-Setup/wiki/First-Installation/_edit

So unless I'm missing some fancy querying sorcery to strip the markdown extension and append _edit this just wasn't designed for our conversion use case.

from retropie-docs.

jamesrhea avatar jamesrhea commented on May 20, 2024

@joolswills - I've submitted a request for MkDocs to support wiki URLs. But I'm wondering: would this JavaScript snippet have also done the trick?

https://github.com/mkdocs/mkdocs/wiki/MkDocs-Recipes#associate-github-page-with-current-mkdoc-page

from retropie-docs.

joolswills avatar joolswills commented on May 20, 2024

Could be yeah, although I will probably just stick with the current solution for now.

Thanks for submitting a request upstream.

from retropie-docs.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.