Skip to content

Guide and principles

Rishabh Poddar edited this page Jul 6, 2021 · 5 revisions

Structure

What goes in recipe docs

  • All questions about "how to do something". For example, how to embed the login widget in a page?
  • Step by step guide on implementing SuperTokens for various frameworks.

What goes in SDK level docs

  • All questions about "what are / is something". For example, what are all the config options for the init function call?

Custom tooling

About COPY DOCS directive

  • This allows you to replicate the contents of a .md file into another .md file. It is used in cases where a page across recipes has exactly the same content.
  • To use this, add the following to the top of your .md file:
    ---
    id: functions
    title: Functions
    ---
    
    <!-- COPY DOCS -->
    <!-- ./website/docs/usage/override/functions.md -->
    
    # Page title...
    
    Here we see that the contents of this docs will be copied from /website/docs/usage/override/functions.md. Specifically, everything below the <!-- ./website/docs/usage/override/functions.md --> line.
  • When editing a .md file, please be sure to check if it has the <!-- COPY DOCS --> directive on top. If it does, then go and change that file instead.

About running JS on each page load

  • The file docs/static/scripts/commonDocsBuilder.js, is loaded on each page load and can run any JS and modify the page content.
  • After running all the JS, it shows the page content so that there is no flicker.

Other important points

  • When linking to within the same docusaurus project, use relative path, else, use absolute path