Skip to content

Add additional 'drafts' level to inclusion#3476

Merged
oprypin merged 6 commits intomkdocs:masterfrom
athackst:feat/drafts
Dec 11, 2023
Merged

Add additional 'drafts' level to inclusion#3476
oprypin merged 6 commits intomkdocs:masterfrom
athackst:feat/drafts

Conversation

@athackst
Copy link
Copy Markdown
Contributor

@athackst athackst commented Nov 20, 2023

This change adds a "drafts" configuration option so that files can be appropriately marked as 'draft' to be included in the local server, and files that shouldn't be included at all are marked in 'exclude_docs'.

This change helps #3450 by allowing users to fully exclude paths.

@athackst athackst force-pushed the feat/drafts branch 2 times, most recently from 9493d55 to 78a2c81 Compare November 20, 2023 06:07
@oprypin

This comment was marked as abuse.

@athackst
Copy link
Copy Markdown
Contributor Author

Sure, pick away.

I know it's a breaking change, but it shouldn't be too bad for users.

I think the addition of a "drafts" level makes it easier to understand the intention and behavior.

Copy link
Copy Markdown

@oprypin oprypin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I'll probably move forward with this.

@athackst
Copy link
Copy Markdown
Contributor Author

Another option might be to deprecate the 'exclude_docs' setting and rename what 'exclude_docs' is doing in this PR to 'ignore'?

That way folks using 'exclude_docs' will get a warning.

@oprypin

This comment was marked as abuse.

@athackst
Copy link
Copy Markdown
Contributor Author

@oprypin
Not quite - I updated the code to what I was thinking. Deprecate exclude_docs and new ignore and drafts settings.

I think the drafts functionality is good to keep.

The issue is that there isn't an additional way to ignore files in the docs_dir, so files we wanted to ignore were included in serve. I think this change appropriately decouples those concepts and opens the door to a couple of new features you might consider in the future:

  1. Unblocking setting docs_dir from the root directory Support docs from the root directory. #3450
  2. Supporting a command line flag to include drafts or not on serve (by updating the is_in_serve function based on this flag)
  3. Supporting a .mkdocsignore type file to locally specify additional ignore patterns (I do this in my plugin and have found it useful)

@athackst
Copy link
Copy Markdown
Contributor Author

athackst commented Nov 28, 2023

Let me know if you have any more nit picks!

I could "move" the exclude_docs option to either ignore or draft. I wasn't sure which use case was more popular, so I just went full deprecation so folks would be aware of a breaking change.

@oprypin

This comment was marked as abuse.

@oprypin

This comment was marked as abuse.

@oprypin

This comment was marked as abuse.

@oprypin

This comment was marked as abuse.

@athackst
Copy link
Copy Markdown
Contributor Author

athackst commented Dec 9, 2023

Thanks for the discussion, it's been a pleasure. I'll update my other PR after this one merges.

Copy link
Copy Markdown

@oprypin oprypin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you as well, and thanks for the patience

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.

2 participants