Skip to content

figure directive #12

Closed

Description

@Mpdreamz

Figure

Kind Link
Reference https://mystmd.org/guide/directives#directive-figure
Documentation https://mystmd.org/guide/figures#figure-directive

Implementation

  • Parses directives and aliases
  • Emits HTML
  • Unit tests
  • Validation (emits, warnings and errors).

Specification compliance:

  • Argument (string)
    • The filename of an image (e.g. my-fig.png)
    • Or an ID of a Jupyter Notebook cell (e.g. #my-cell).
      Pending discussion on embed directive #11 to see if we need to support id references
  • Directive Body (parsed)
    If an argument is provided to the figure directive, the body will be the figure caption. You may also omit the figure directive argument and provide images in the body of the figure, these will be parsed into sub figures.
  • Options
    • label, name (string) - Label the figure to be cross-referenced or explicitly linked to.
    • enumerated, numbered (boolean) - Turn on/off the numbering for the specific figure
    • enumerator, number (string) - Explicitly set the figure number
    • class, figclass (string)
      CSS classes to add to your figure. Special classes include:
      full-width: changes the figure environment to cover two columns in LaTeX
    • height, h (string) - The figure height, in CSS units, for example 4em or 300px.
    • width, w, figwidth (string) - The figure width, in CSS units, for example 50% or 300px.
    • alt (string) - Alternative text for the image
    • align (string) - The alignment of the image in the figure. Choose one of left, center or right
    • remove-input (boolean) - If the argument is a notebook cell, use this flag to remove the input code from the cell.
    • remove-output (boolean) - If the argument is a notebook cell, use this flag to remove the output from the cell.
    • placeholder (string)
      A placeholder image when using a notebook cell as the figure contents. This will be shown in place of the Jupyter output until an execution environment is attached. It will also be used in static outputs, such as a PDF output.
    • no-subfigures, no-subfig, no-subfigure (boolean) - * Disallow implicit subfigure creation from child nodes*
    • kind (string)
      Override the figures “kind”, which changes the enumeration to start counting independently for that kind. For example, kind: "example". The default enumeration and referencing will be the capitalized kind followed by a number (e.g. “Example 1”).

Activity

  1. added
    authoring
    and removed on Nov 6, 2024
  2. Mpdreamz commented on Nov 14, 2024

    @Mpdreamz
    MemberAuthor

    Closed by #68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authoring

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions