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

Documentation: Generates the manifest dynamically to include the data module docs in the handbook #7411

Merged
merged 4 commits into from
Jun 28, 2018

Conversation

youknowriad
Copy link
Contributor

I'm not certain the Handbook supports more than one level of nesting in the menu because this PR uses two level. If it's not we can update it to move the Data Module Menu Item to the root level.

This PR includes a build step to generate the manifest.json by concatenating the root-manifest.json containing the static docs with the manifest generated by parsing the data module selectors/actions.

Not certain how I can test the result, if everything is working as expected. Some help needed here @pento :)

@youknowriad youknowriad added the [Type] Developer Documentation Documentation for developers label Jun 20, 2018
@youknowriad youknowriad self-assigned this Jun 20, 2018
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Great job on providing docs for data parts. I love this because it makes it easier to generate more sections like this. My next immediate use case would be to offer a section for packages.

There is one improvement to consider:

  • Add comments to all generated files to make it clear that they were auto-generated with link to the original file.

It still needs to be confirmed that we can have 2 levels of nesting for sections in Gutenberg hsndbook, otherwise we should promote it to its own section.

"parent": "outreach"
}
]
{
Copy link
Member

Choose a reason for hiding this comment

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

Just noting that this generated file has different whitespsce style. Is there an easy way to fix it?

@@ -1,212 +1,254 @@
[
Copy link
Member

@gziolo gziolo Jun 28, 2018

Choose a reason for hiding this comment

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

Can we add a comment at the top of this file explaining that it was auto-generated? I bet someone will update it manually soon 😃

Copy link
Contributor Author

@youknowriad youknowriad Jun 28, 2018

Choose a reason for hiding this comment

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

Unfortunately, comments are not allowed in JSON?

Copy link
Member

Choose a reason for hiding this comment

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

😿

/**
* Node dependencies
*/
const lodash = require( 'lodash' );
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This file could use object destructuring for lodash method 😎

{
"title": "Data Package Reference",
"slug": "packages-data",
"markdown_source": "https://github.com/WordPress/gutenberg/master/docs/data/index.md",
Copy link
Member

Choose a reason for hiding this comment

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

Can this file be renamed to README.md to enable the default GitHub support in the browser when browsing repository?

@youknowriad youknowriad merged commit 41be78b into master Jun 28, 2018
@youknowriad youknowriad deleted the try/generate-docs-manifest branch June 28, 2018 07:37
@@ -150,7 +150,7 @@
"predev": "npm run check-engines",
"dev": "npm run build:packages && concurrently \"cross-env webpack --watch\" \"npm run dev:packages\"",
"dev:packages": "node ./bin/packages/watch.js",
"docs:generate-data-reference": "node docs/data/tool",
"docs:build": "node docs/tool",
Copy link
Member

Choose a reason for hiding this comment

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

We have both docs:build and build:packages scripts. We should be consistent with our naming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants