docz
docz copied to clipboard
How to include the root's CHANGELOG.md?
Question
Description
I have the following (shortened) structure:
CHANGELOG.md
docs/
docz.js
package.json
src/
my-docs.md
... # (lots of other folders)
My docz.js
is almost empty. Nothing special in there.
I'd like to include the CHANGELOG.md
in my docs. I understand that docz cannot include files outside its package. I see multiple ways to achieve this:
- Move docz to the root package (solution recommended by #459). But then I will have to ignore a lot of folders... I wish the
src
option accepted a list of files and folders so that I could saysrc: ['./CHANGELOG.md', 'docs/']
. There are a lot of other folders in this repo and I don't want to manually manage the list of excluded files, I'd rather selectively include onlydocs/*
and the changelog. - Using a symlink: does not work, I get an unrelated module not found error.
- Copy
CHANGELOG.md
as part of the release process. A bit annoying to maintain...
The other thing to think about is the CHANGELOG.md
's frontmatter. I might not want to include it directly.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This question is important I think.
So far I'm fine with having Docz at the root of my project, but automating the idea no. 3 with an npm script shouldn't be hard: you would just copy the CHANGELOG.md
over to your docs directory and prepend it with front matter (if necessary).
# .gitignore
/docs/CHANGELOG.md
package.json
:
{
"scripts": {
"docs": "<copy and prepend the CHANGELOG somehow> && docz build"
}
}
Does it make sense in your use case?
I'm using the files
property in the config file with the following to pull in files from outside the Docz directory and it works well.
files: [
'../other/directory/src/**/*.{md,markdown,mdx}',
'**/*.{md,markdown,mdx}'
],
Just make sure to add the name
and route
yaml header to the markdown files you want to show up in Docz.