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

Fix issue #271 (Allow -- in titles) #331

Merged
merged 2 commits into from
Apr 27, 2024

Conversation

jeanphilippegg
Copy link
Contributor

A pull request to fix issue #271. Has no impact on users that keep the default sluggification. Those that don't are allowed to have consecutive hyphens in titles. We do not remove them.

The fontification does not need to be updated. It handles this correctly already.

@protesilaos protesilaos merged commit 5a7b408 into protesilaos:main Apr 27, 2024
@protesilaos
Copy link
Owner

Merged. Thank you!

Though now we need to think how best to design this to make it opt-in for users who want more flexibility with the file-naming scheme. Maybe it is too early to add a user option, given the planned changes you are working on, but it is something to consider once things have settled.

@jeanphilippegg
Copy link
Contributor Author

Is it not already opt-in? Currently, with the default sluggification as it is, it is not possible to have consecutive hyphens in a file name title. If users disable the title sluggification, that's when they are allowed to type any title that they want, including the "-----" if they want.

I think that "disabling all sluggification" to mean "allow as much flexibility as possible in file name components" is intuitive.

protesilaos added a commit that referenced this pull request Apr 27, 2024
This reflects the change made by Jean-Philippe Gagné Guay in pull
request 331: <#331>.
@jeanphilippegg
Copy link
Contributor Author

Actually, I am not sure I understood your point about an opt-in option. I think we should impose as few rules as possible to the file naming scheme when sluggification is disabled. Then, with the default sluggification, we "impose" some defaults.

Here are the strict rules of the file naming scheme (without sluggification), as they currently stand:

  • No dot character except for the extension.
  • No consecutive delimiter characters (-,_,=) in the components, except for the title which accepts multiple hyphens.
  • No delimiter character at the end of a component (to prevent conflict with a possible next component).

I think we should aim for as much flexibility as possible when sluggification is disabled. Then, through sluggification, users can impose further rules on their file name components.

@jeanphilippegg jeanphilippegg deleted the title-sluggification branch April 27, 2024 05:26
@protesilaos
Copy link
Owner

protesilaos commented Apr 27, 2024 via email

@jeanphilippegg
Copy link
Contributor Author

There are 2 cases:

  • The user accepts the default sluggification. He cannot input "--" in titles because of the default sluggification.
  • The user disables the default sluggification for titles. He can input (almost) anything in the title, including "--".

Is it by configuring 'denote-file-name-slug-functions'?

Yes, a user would need to disable the default sluggification through this option to be able to input "--" in titles.

I think we only need to document the rules of the file naming scheme (in my previous comment) and the default sluggification.

@protesilaos
Copy link
Owner

protesilaos commented Apr 27, 2024 via email

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

Successfully merging this pull request may close these issues.

None yet

2 participants