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

Compatibility with autolinks plugin #20

Closed
Stanzilla opened this issue Apr 7, 2021 · 15 comments
Closed

Compatibility with autolinks plugin #20

Stanzilla opened this issue Apr 7, 2021 · 15 comments

Comments

@Stanzilla
Copy link

Plugin: https://github.com/midnightprioriem/mkdocs-autolinks-plugin

I'm testing with version 0.3.0 because the latest release is buggy for me.

So during build it will throw a duplicate file warning for every file that contains a link to a file that now has a multi language version. In my repo for example

WARNING -  Documentation file 'getting_started/community_content.fr.md' contains a link to 'getting_started/publishing.md' which is not found in the documentation files. 
WARNING -  Documentation file 'getting_started/editor_intro.fr.md' contains a link to 'getting_started/my_first_multiplayer_game.md' which is not found in the documentation files. 
WARNING -  Documentation file 'getting_started/my_first_multiplayer_game.fr.md' contains a link to 'getting_started/installing_core.md' which is not found in the documentation files. 
WARNING -  Documentation file 'getting_started/my_first_multiplayer_game.fr.md' contains a link to 'getting_started/publishing.md' which is not found in the documentation files. 
WARNING -  Documentation file 'getting_started/my_first_multiplayer_game.fr.md' contains a link to 'getting_started/publishing.md' which is not found in the documentation files. 
WARNING -  Documentation file 'getting_started/publishing.fr.md' contains a link to 'getting_started/publishing_checklist.md' which is not found in the documentation files. 
WARNING -  Documentation file 'getting_started/publishing.fr.md' contains a link to 'getting_started/publishing_checklist.md' which is not found in the documentation files. 
WARNING -  Documentation file 'getting_started/publishing_checklist.fr.md' contains a link to 'getting_started/publishing.md' which is not found in the documentation files. 
WARNING -  Documentation file 'getting_started/publishing_checklist.fr.md' contains a link to 'getting_started/publishing.md' which is not found in the documentation files. 
WARNING -  Documentation file 'getting_started/publishing_checklist.fr.md' contains a link to 'getting_started/publishing.md' which is not found in the documentation files. 
WARNING -  Documentation file 'getting_started/publishing_checklist.fr.md' contains a link to 'getting_started/community_content.md' which is not found in the documentation files. 
@ultrabug
Copy link
Owner

ultrabug commented Apr 7, 2021

I'm not sure messing with the markdown sources is the job of this plugin tbh.

The proper way to handle this is that .fr.md files should link to their .fr.md counterparts if they exist. Then autolinks will do its own magic without complaning.

@Stanzilla
Copy link
Author

Hrm but what when they don't exist yet? Or did you suggest that I file that as a request over there?

@ultrabug
Copy link
Owner

ultrabug commented Apr 7, 2021

As far as I understand this, autolinks is not the one spouting those WARNING messages.

You're seeing this because when mkdocs-static-i18n builds a language specific version of your site it only considers and uses the translated versions of all pages if they exist (and fallback to their default one if not).

Let's take an example:

WARNING -  Documentation file 'getting_started/community_content.fr.md' contains a link to 'getting_started/publishing.md' which is not found in the documentation files. 

In the markdown of the getting_started/community_content.fr.md file, there is a link to the getting_started/publishing.md (default = en) page BUT there is a getting_started/publishing.fr.md that exists and that is thus used by the french version of your site.

So on the fr context of the build the getting_started/publishing.md does not exist as it has been replaced by its getting_started/publishing.fr.md translation.

Which means that you should update the markdown of getting_started/community_content.fr.md to link to getting_started/publishing.fr.md so that french pages link to each others when they exist.

Does that make sense?

@Stanzilla
Copy link
Author

oh it does, thank you! Guess I was kinda expecting some magic happening there that is doing it for me, but I can just change it!

@Stanzilla
Copy link
Author

I guess the other part is these

WARNING -  A relative path to 'tutorials/environment_art.md' is included in the 'nav' configuration, which is not found in the documentation files 
WARNING -  A relative path to 'tutorials/modeling_basics.md' is included in the 'nav' configuration, which is not found in the documentation files 
WARNING -  A relative path to 'tutorials/persistent_storage_tutorial.md' is included in the 'nav' configuration, which is not found in the documentation files 
WARNING -  A relative path to 'tutorials/scene_creation.md' is included in the 'nav' configuration, which is not found in the documentation files 
WARNING -  A relative path to 'tutorials/lua_basics_helloworld.md' is included in the 'nav' configuration, which is not found in the documentation files 
WARNING -  A relative path to 'tutorials/lua_basics_lightbulb.md' is included in the 'nav' configuration, which is not found in the documentation files 
WARNING -  A relative path to 'tutorials/lua_basics_manticoin.md' is included in the 'nav' configuration, which is not found in the documentation files 

any idea what triggers those?

@ultrabug
Copy link
Owner

ultrabug commented Apr 8, 2021

I guess it's the same problem @Stanzilla ?

src/getting_started/my_first_multiplayer_game.md:[Publish a Game](publishing.md) | [Terrain Tutorial](environment_art.md) | [Basic Weapon Tutorial](weapons.md) | [Abilities Tutorial](abilities.md)
src/getting_started/my_first_multiplayer_game.fr.md:[Publish a Game](publishing.md) | [Terrain Tutorial](environment_art.md) | [Basic Weapon Tutorial](weapons.md) | [Abilities Tutorial](abilities.md)

@Stanzilla
Copy link
Author

So I guess the problem is that not all pages have a .fr counterpart yet?

@ultrabug
Copy link
Owner

ultrabug commented Apr 9, 2021

So I guess the problem is that not all pages have a .fr counterpart yet?

No, it seems you still have fr pages pointing to non fr pages while those pages do exist.

What's your newest test branch?

@Stanzilla
Copy link
Author

Stanzilla commented Apr 9, 2021

It's in dev now, https://github.com/ManticoreGamesInc/platform-documentation/tree/development but disabled (check config)

@ultrabug
Copy link
Owner

@Stanzilla the WARNING you experience are there because you have some non translated pages pointing to files that do have a translation...

For example :

  • other_platforms/fortnite_creative.md is not translated in French and contains a link to getting_started/editor_intro.md
  • but getting_started/editor_intro.md has a translation as getting_started/editor_intro.fr.md

when the fr version is built it only takes the translated versions of every page into account so getting_started/editor_intro.md does not exist in this context since it has a translation...

does it make sense?

@Stanzilla
Copy link
Author

hrm yeah it does, that means everything should still work then because the "fallback" files that are not translated do exist, yes?

@ultrabug
Copy link
Owner

No, they do not exist in the language specific context so that means that whenever a page is translated, anything linking to it should be too

@ultrabug
Copy link
Owner

@Stanzilla do you still want this issue open mate, can I be of help here still? thanks

@Stanzilla
Copy link
Author

I think it's fine to close it! Thank you so much for your help!

@ultrabug
Copy link
Owner

Thanks for your positive comments and help in improving the plugin mate

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

No branches or pull requests

2 participants