AntelopeIO / docsgen

Other
0 stars 0 forks source link

Programmable Docusaurus Configuration #9

Open ericpassmore opened 1 year ago

ericpassmore commented 1 year ago

Summary

Use m4 macros to build docusuaurus.config.js @kj4ezj @lparisc @iamveritas for review

Problem Statement

By design the Docusaurus config is one large file with all the options https://docusaurus.io/docs/configuration This creates issues.

  1. All versions of documents listed in the config need to exist for a successful build Today we have two configuration files to support the two states.
    • docusaurus.config.js for the initial build, used when building from nothing
    • docusaurus.config.js.new for the multi version build for the end state This causes confusion.
    • Hard to figure out which file to update
    • Hard to keep both files in sync
  2. Lack of isolation. Today you build and test everything, with all versions of documentation and all features enabled. Currently the configuration and text for the homepage is stored in the config file. If you want to update some text on the homepage you need to edit this massive config file. There are other examples, the point is many sections of the config are separate and distinct. There is no need for everything to be in a single configuration file. This massive config causes issues
    • Long build times for testing
    • Need to install lots of software like doxybook and java8 to support the full build
    • Hard to isolate issues to your work, as you need to pull in everything
    • Accidentally change the wrong config

Scenarios

Requirements

Keep it simple, and only target 4 configuration sections.

Seperate File

Easy enough the m4 macro pulls in contents of a file

Navigation Macro

List of repositories is set at build time. There are two macros. The m4 navigation-macro generate a navigation element from the argument passed in. Will need to build an array of repositories in m4 language, iterate over the array, and call the navigation-macro with the positional argument.

Version Configuration

Three macros. A Macro for the version. A Macro for the entire configuration group. Finally a macro to iterate over the possible version.

ericpassmore commented 1 year ago

started work with redocly macros completed in ENF staging