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

Avoid replacing dots for underscores in the documentation url. #116

Closed
wants to merge 2 commits into from

Conversation

bitsondatadev
Copy link

Many older documentation frameworks don't slugify the . character in the url. For us to migrate and use this tool, we had to skip this instance to avoid from breaking the versioned urls.

e.g.
https://iceberg.apache.org/docs/1.2.0/

This new way will require folks to update their folder names to the url name if they are already using 1_2_0 but it will enable both options with this PR. I'm open to hearing a backwards compatible approach that needs to be switched on as well.

@bih
Copy link
Collaborator

bih commented Jan 3, 2024

Thanks for the PR! As you rightly mentioned, this is something that would break existing integrations. As I've not seen enough people raise this issue it feels unnecessary to introduce a breaking change. I will close this as won't fix for now for this reason, but would encourage you to create a fork to address your particular needs regarding the period .

@bih bih closed this Jan 3, 2024
@bih bih added the wontfix This will not be worked on label Jan 3, 2024
@bitsondatadev
Copy link
Author

bitsondatadev commented Jan 10, 2024

@bih thanks for the response. I have done this for now, but I'd rather not have to maintain this if I don't have to. However, I understand if what I'm about to suggest is also not an option.

I am curious if you might consider me exposing a valid_slug_regex Mkdocs config.

Something like:

mkdocs.yml

plugins:
  - monorepo
     valid_slug_regex: '^[a-zA-Z0-9_\.\-/]+$'

plugin.py

class MonorepoPluginConfig(mkdocs.config.base.Config):
    valid_slug_regex = mkdocs.config.config_options.Type(str, default='^[a-zA-Z0-9_\-/]+$') # noqa: W605

class MonorepoPlugin(MonorepoPlugin[MonorepoPluginConfig]):

parser.py

    def getAlias(self):
        alias = self.navYaml["site_name"]
        regex = self.valid_slug_regex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants