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

[1/?] Add ability to run code examples in the playground: Move code samples to separate files #544

Merged
merged 28 commits into from
May 21, 2024

Conversation

shaedrich
Copy link
Collaborator

See #340

Fun fact: Loading snippets from gists, would have been possible via url_download config option 😉

Key points

  • top-level /code-samples directory
  • flat structure within /code-samples
  • file names within /code-samples having the page name, they are primarily used in as a prefix
    • a few files only consist of said prefix
  • file names consist of [a-z-]
  • code samples are embedded, using the snippet feature with the two dashes each syntax (--8<--)
  • code samples are reused when the same code is used elsewhere or lines from it (snippet lines syntax). Code sample reuse, that could only be achieved by the block format is not done
  • code samples currently have no new line at EOF
  • we currently have code samples in the following languages:
    • pony (see below)
    • Bash (.sh; 13)
    • C (9)
    • Error (.txt; 3)

Progress

  • Getting Started (16 code samples, 12 unique snippets)
  • Types (46 code samples, 43 unique snippets)
  • Expressions (131 code samples, 129 unique snippets)
  • Reference Capabilities (22 code samples, 21 unique snippets)
  • Object Capabilities (6 code samples, 4 unique snippets)
  • Generics (22 code samples, 18 unique snippets)
  • Packages (8 code samples/snippets)
  • Testing (6 code samples/snippets)
  • C-FFI (34 code samples/snippets)
  • Gotchas (8 code samples/snippets)
  • Where Next?
  • Appendices (36 code samples/snippets)

= 313 code samples, 298 unique snippets

shaedrich and others added 27 commits April 21, 2024 05:35
to mark array entry as object rather than a string
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label May 8, 2024
Copy link

netlify bot commented May 8, 2024

Deploy Preview for pony-tutorial ready!

Name Link
🔨 Latest commit db1eb11
🔍 Latest deploy log https://app.netlify.com/sites/pony-tutorial/deploys/6644d8e99fad65000711bba1
😎 Deploy Preview https://deploy-preview-544--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.

Copy link
Member

@jemc jemc left a comment

Choose a reason for hiding this comment

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

Looks mostly good to go - I just had the one question above about non-Pony-source-code samples.

code-samples/ponypath-unix-mac.sh Outdated Show resolved Hide resolved
Co-authored-by: jemc <joe.eli.mac@gmail.com>

As requested in #544 (comment)
@jemc jemc merged commit caae6e2 into main May 21, 2024
17 checks passed
@jemc jemc deleted the code-samples-separate-files branch May 21, 2024 18:08
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label May 21, 2024
shaedrich added a commit to shaedrich/pony-tutorial that referenced this pull request May 21, 2024
Co-authored-by: Joe Eli McIlvain <joe.eli.mac@gmail.com>

As requested in ponylang#544 (comment)

From db1eb11
shaedrich added a commit to shaedrich/pony-tutorial that referenced this pull request May 22, 2024
Co-authored-by: Joe Eli McIlvain <joe.eli.mac@gmail.com>

As requested in ponylang#544 (comment)

From db1eb11
shaedrich added a commit to shaedrich/pony-tutorial that referenced this pull request May 22, 2024
Co-authored-by: Joe Eli McIlvain <joe.eli.mac@gmail.com>

As requested in ponylang#544 (comment)

From db1eb11

Follow-up to 3339fd2
shaedrich added a commit to shaedrich/pony-tutorial that referenced this pull request May 22, 2024
Co-authored-by: Joe Eli McIlvain <joe.eli.mac@gmail.com>

As requested in ponylang#544 (comment)

From db1eb11

Follow-up to 3339fd2
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.

None yet

3 participants