Summary: This adds a new npm package "internaldocs-fb-helpers", and shows example usage in the flipper package. This will stop everyone from having to inline the function definitions everywhere as is currently the case. (It's using the old internaldocs name, to match the existing docusaurus-plugin-internaldocs-fb package - I don't think that's a big deal.) It currently exports two methods: * `fbContent(internalContent, publicContent)` * Allows you to return internal or external content based on build variant. * Has named args so you don't accidentally put internal stuff in the external arg. * `isInternal(): boolean` * Not strictly necessary, but helps if you want to write your docs using an boolean variable rather than a switching function every time. * `fbInternalOnly(internalContent)` * Convenience method for when you want internal content, or nothing. I could have put these inside the existing docusaurus plugin, but that has docu v2 as a peer dependency, and I want these helpers to work on v1 as well, so made it a standalone package. Reviewed By: passy Differential Revision: D23474462 fbshipit-source-id: 22e5be6de2f3233deb298f1542a06e3575b6555a
4.3 KiB
4.3 KiB