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 #541

Closed
wants to merge 27 commits into from

Conversation

shaedrich
Copy link
Collaborator

@shaedrich shaedrich commented Apr 21, 2024

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

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Apr 21, 2024
shaedrich and others added 24 commits April 21, 2024 06:08
to mark array entry as object rather than a string
@shaedrich
Copy link
Collaborator Author

shaedrich commented Apr 30, 2024

fyi: the last commit didn't change any of the markdown or config files, yet the build failed.

7:14:14 AM: Build ready to start
7:14:19 AM: Error checking out repo.

@jemc
Copy link
Member

jemc commented May 8, 2024

@shaedrich - I couldn't figure out how to enable Netlify deploy preview for forks, so I have given you commit access to this repository.

Now you can move your PR branches to this repo, and the Netlify deploy preview should work.

Sorry for the trouble.

@shaedrich
Copy link
Collaborator Author

@jemc No problem. I resubmitted the PR as #544

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