t3docs / docker-render-documentation

Render TYPO3 Documentation the official way
https://t3docs.github.io/DRC-The-Docker-Rendering-Container/
20 stars 15 forks source link

"Edit on GitHub" button with "single-file" solution /README.rst creates edit link for Documentation/README.rst #122

Open sypets opened 2 years ago

sypets commented 2 years ago

I created an extension documentation with a README.rst as main documentation ("single file solution" because I wanted to check it out and also for minimal documentation I find this much more convenient (at least for myself). (And that is not because of problems of dealing with .rst or sphinx!).

I am not 100% sure I tested the "Edit on GitHub" before, so I don't know if this used to work. But it does not work now:

The generated link looks for a README.rst in Documentation (but the README.rst is in the root dir)

marble commented 2 years ago

without reading the above: Branch was renamed from master to main. Pleas adjust the links in the Settings.cfg

sypets commented 2 years ago

No. That is not the problem. This is about an extension with a branch master.

This has nothing to do with master / main renaming. It is not necessary to make changes in extensions where the branch was not renamed.

The problem is /Documentation/ in the "Edit on GitHub" URL:

https://github.com/sypets/migrate2composer/edit/master/Documentation /README.rst

marble commented 2 years ago

ok, thanks, got it. Will see what I can do right now, before I got the whole toolchain refactored.

marble commented 2 years ago

I just had a look at it, but there's no solution that I can get a grip on right now. Problems are: For Sphinx the "docstart" is ./Documentation. So I'll have to move the ./Documentation/../README in there. What if README already references media form ./Documentation/_images or alike? So I used to also move everything from ./Documentation to ./Documentation/.Documentation, to keep relative paths alive. PLUS, next problem, I somewhere need to keep the info that I rename and or relocate README and tell Sphinx about it, so that the correct "Edit on GitHub" link can be generated. At the moment I can't solve all this, but nevertheless will try in future. The toolchain is still awaiting a real refactoring. That will be the moment!

alexander-nitsche commented 2 years ago

Maybe it would solve the issue by adding a condition in the Sphinx template at https://github.com/TYPO3-Documentation/sphinx_typo3_theme/blob/develop/sphinx_typo3_theme/breadcrumbs.html#L50, that checks if the path to the current file contains Documentation/ or not, and if not, it does not output any path segment here.