pony-tutorial icon indicating copy to clipboard operation
pony-tutorial copied to clipboard

Custom code fence

Open shaedrich opened this issue 1 year ago • 1 comments

🚧 Work in progress. Coming soon

Options

  • class (constant: .ponylang)
  • snippet: file name from ./code-samples (can optionally include line syntax after :; see lines) (see Snippets extension for details)
  • dedent_subsections: bool (see dedent_subsections option of the Snippets extension for details)
  • lines: list of lines to include
    • just one line (lines="1" or lines="6")
    • range (lines="1-3")
    • list of lines (lines="1,6,8")
    • a combination of the options above (lines="1-3,6,8-10")
  • runnable: bool Indicates whether the code block contains a Main actor and doesn't result in an error unless intended

Examples

Example 1

```{ .ponylang snippet="hello-world-main.pony" dedent_subsections=false }
Gibberish
```
  • Snippet hello-world-main.pony from ./code-samples is included and content ("Gibberish") is discarded
  • Indention is not reduced from the snippet lines

Example 2

```{ .ponylang snippet="classes-wombat.pony:1-3,6" dedent_subsections=false }
Lorem ipsum
```
  • From the snippet classes-wombat.pony from ./code-samples the lines 1 to 3 as well as 6 are included and content ("Lorem ipsum") is discarded
  • Indention is not reduced from the snippet lines

Example 3

```{ .ponylang }
actor Main
    new create(env: Env):
        env.out.print("Hello world!")
```
  • Content (actor Main […]) is displayed as is

shaedrich avatar Jun 05 '24 15:06 shaedrich

Deploy Preview for pony-tutorial ready!

Name Link
Latest commit aba775672a0ec9741808d707562438906b641980
Latest deploy log https://app.netlify.com/sites/pony-tutorial/deploys/6661185b8c3b720007a55c78
Deploy Preview https://deploy-preview-555--pony-tutorial.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Jun 05 '24 15:06 netlify[bot]