Skip to content

[Migration tooling] Code callouts #102

Closed

Activity

  1. changed the title [-]Support code callouts (needs issue)[/-] [+]Support code callouts[/+] on Dec 10, 2024
  2. added
    authoring
    on Dec 10, 2024
  3. changed the title [-]Support code callouts[/-] [+][Migration tooling] Code callouts[/+] on Dec 17, 2024
  4. Mpdreamz commented on Dec 18, 2024

    @Mpdreamz
    Member

    I'm close to implementing this just a note on the syntax

    ```yaml
    project:
      title: MyST Markdown 
      github: https://github.com/jupyter-book/mystmd
      license:
        code: MIT
        content: CC-BY-4.0 <1>
      subject: MyST Markdown 
    ```
    
    1. The license

    A code block can include <\d+> at the end to indicate code callouts. A code block with this style of callouts needs to be followed by an ordered list with an equal amount of items as called out. Otherwise the docs-builder will throw an error.

    Image

    magic mode

    We will also support 'magic' callouts:

    ```csharp
    var apiKey = new ApiKey("<API_KEY>"); // Set up the api key
    var client = new ElasticsearchClient("<CLOUD_ID>", apiKey); 
    ```

    Here nothing needs to be numbered and // Set up the api key will be removed from the code block and rendered as the first callout.

    This currently works for comments starting with // and # which will cover the majority of languages.

    Note the comments have the follow code to be hoisted as a callout.

    ```csharp
    // THIS IS NOT A CALLOUT
    var apiKey = new ApiKey("<API_KEY>"); // THIS IS
    var client = new ElasticsearchClient("<CLOUD_ID>", apiKey); 
    ```

    This style will allow the callouts to render correctly and for the embedded code to be still syntactically correct.

  5. bmorelli25 commented on Dec 18, 2024

    @bmorelli25
    MemberAuthor

    This is fantastic! Syntax LGTM. Magic mode will be very nice for short-form callouts.

  6. linked a pull request that will close this issueAdd support for code callouts #118on Dec 19, 2024
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