docz icon indicating copy to clipboard operation
docz copied to clipboard

How to include the root's CHANGELOG.md?

Open charlax opened this issue 4 years ago • 4 comments

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:

  1. 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 say src: ['./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 only docs/* and the changelog.
  2. Using a symlink: does not work, I get an unrelated module not found error.
  3. 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.

charlax avatar May 04 '20 09:05 charlax

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.

stale[bot] avatar Jul 03 '20 10:07 stale[bot]

This question is important I think.

charlax avatar Jul 03 '20 10:07 charlax

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?

adamkudrna avatar Aug 21 '20 14:08 adamkudrna

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.

sheedy avatar Aug 24 '20 04:08 sheedy