dotnet / try

Try .NET provides developers and content authors with tools to create interactive experiences.
MIT License
2.87k stars 520 forks source link

support for publishing standalone Markdown, static HTML, WebAssembly hosts #214

Open jonsequitur opened 5 years ago

jonsequitur commented 5 years ago

Some aspects of the Try .NET Markdown format make the source Markdown file less than ideal for display directly within e.g. a GitHub readme.md:

Additionally, we should support static site generators and content management systems by doing the Markdown-to-HTML conversion at publish time rather than expecting it to be done at runtime.

The following command line examples are just sketches. In all cases, new files are emitted to <output dir> and source Markdown files are left unchanged.

akshita31 commented 5 years ago

This looks really good. A couple questions: What will be a general usage pattern for the publish step.

  1. Like is it my responsibility as a content author that whenever I make some changes to my markdown file or to my backing project, I should run the command and then submit the PR ?
  2. Or, it will be a task in the build pipeline that will execute everytime a PR is submitted ?

If we go for the first case then the things might go "off-sync". And in the second case,if there are any changes that need to be published, will the build system automatically create a PR for it or directly publish the changes somehow.

Not sure if we need to think this to that extent but I was just curious 🔢

akshita31 commented 5 years ago

Also, we should start using "dotnet try verify" in our CI/CD pipeline for the samples or the docs folder so that we are able to have an example for others who might want to do the same.

jonsequitur commented 5 years ago

We do currently test this: https://github.com/dotnet/try/blob/b1b6dc73a1ef3f7186904251edfa635a903d5a6c/MLS.Agent.Tests/CommandLine/DemoCommandTests.cs#L28

jimbobbennett commented 5 years ago

dotnet try publish --format Markdown --interactive:false <output dir>:

  • Emits a Markdown file for each source Markdown file.
  • Populates code fences using the latest backing source in a format suitable for use as read-only, non-interactive documentation, e.g. in GitHub's readme or wiki.

Would love this. When publishing tutorials to GitHub it would be great if they were readable straight away without installing the tool and running it. Having it done automatically also makes this a great way to validate static code in tutorials or workshops - compile behind the scenes then auto-populate with working code as part of a CI/CD step in a PR.