hunyadi / md2conf

Publish Markdown files to Confluence wiki
MIT License
52 stars 27 forks source link

When publishing a directory of markdown files, add option to skip over certain files #55

Closed golharam closed 3 weeks ago

golharam commented 4 weeks ago

As part of my GitHub code repository, I have a README.md and other associated markdown files that I want to publish to Confluence. The README.md refers to the other markdown files.

I have a few markdown files, including CHANGELOG.md, that I don't want published to Confluence, but it's being picked up. Since the markdown does not have a page_id, I get the error: "expected: Confluence page ID to act as parent for Markdown files with no linked Confluence page"

How do I skip over some markdown files? Ideally, I'd like to start with a root document (README.md) and only published the markdown files the root document refers to and skip the others.

golharam commented 4 weeks ago

I'd also like to ignore entire directories. I just came across a situation where README.md is being picked up from a .pytest_cache folder.

hunyadi commented 4 weeks ago

Are you using the latest version from master? Since changes introduced in the commit Add ability to index and synchronize directories recursively, hidden files and directories (name starting with .) are automatically skipped.

Currently, md2conf is implemented as a two-pass utility:

At the time of writing, no reference graph is built that would track which document is referencing which other document such that documents with no inbound links can be skipped. However, this could definitely be a future improvement.

As an alternative solution, we could consider an .mdignore, a file similar to .gitignore and .dockerignore that would exclude specific patterns.

hunyadi commented 3 weeks ago

Support for ignoring files with .mdignore has been added, and is available on the branch master. Building a reference graph is not yet implemented but may be in a future version.