Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom code fence #555

Draft
wants to merge 70 commits into
base: main
Choose a base branch
from
Draft

Custom code fence #555

wants to merge 70 commits into from

Conversation

shaedrich
Copy link
Collaborator

@shaedrich shaedrich commented Jun 5, 2024

🚧 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

Copy link

netlify bot commented Jun 5, 2024

Deploy Preview for pony-tutorial ready!

Name Link
🔨 Latest commit aba7756
🔍 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.

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jun 5, 2024
@@ -37,6 +42,7 @@ plugins:
raise_error_excludes:
429: ["https://github.com/ponylang", "https://web.archive.org/*"]
404: ["https://github.com/ponylang"]
504: ["https://web.archive.org/*"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appears unrelated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jemc jemc removed the discuss during sync Should be discussed during an upcoming sync label Jun 25, 2024
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jun 30, 2024
@jemc jemc removed the discuss during sync Should be discussed during an upcoming sync label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants