View Source mix magma.vault.sync.code (Magma v0.2.0)

A Mix task for syncing the module documents in the Magma vault with the ones in the codebase.

This Mix task is used to create corresponding Magma documents for all public and non-ignored modules in the codebase. This is particularly useful when new modules have been added after the initial vault creation. The task can be run from the command line using mix magma.vault.sync.code.

A module is considered ignored and will be skipped in the sync process:

  • If it has a # Magma pragma: ignore comment at the beginning of its source code, or
  • If it is marked as hidden (e.g. with @moduledoc false) and does not have a # Magma pragma: include comment at the beginning of its source code.

For each non-ignored module, the following Magma documents are created (unless they already exist):

Configuration

A set of tags to be added on all generated documents can be configured with the default_tags application key. This can be useful for separating Magma documents from other documents in your vault. e.g. to filter them.

config :magma,  
  default_tags: ["magma-vault"]

Command line options

  • --force - Forces the overwrite of all existing documents without user confirmation
  • --all - Includes modules for already existing documents in the synchronization process

Summary

Functions

Callback implementation for Mix.Task.run/1.

Functions

Callback implementation for Mix.Task.run/1.