VSpaceCode/vspacecode.github.io

Content tagging for internal/public builds

ArtFlag opened this issue ยท 2 comments

Problem

I haven't found a way to do single-sourcing with Docusaurus.

The idea of single-sourcing is to generate different outputs with one set of source files.
A typical example is for private and public docs, where the private docs are a superset of the public docs.

This is done by tagging content that can be included or excluded at build time.

Solution

Flare, Sphinx and other docs-specific tools allow writers to tag content, very much like Docusaurus uses admonitions.

Sphinx example

non-tagged content
 
.. only:: my-admin-content-tag
 
   some tagged text

non-tagged content

And you can include this tag in the output with

sphinx-build -t my-admin-content-tag #this builds the admin docs

That's a great system to not limit the number of outputs.

Example with Docusaurus

Maybe 1 new admonition would do the trick as a first step, for instance, internal:

That's public text. It will be in the internal and public output.

:::internal
That bit is internal only and will not appear in the public output.
:::

Then we could build the internal docs with a flag:

yarn build --internal

Giving us:

That's public text. It will be in the internal and public output.

That bit is internal only and will not appear in the public output.

Would this be achievable?

I am new to Docusaurus and AFAIK it doesn't seem like they have something like that. May I ask why do we need that in this repo?

Ooooops, the day I submitted this, I clearly had one too many github tabs open ๐Ÿ˜†
That was meant for the docusaurus repo, obviously. Sorry about this ๐Ÿ˜ƒ