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

Allow Markdown in separate md file #813

Open
henrikingo opened this issue Jun 20, 2022 · 2 comments
Open

Allow Markdown in separate md file #813

henrikingo opened this issue Jun 20, 2022 · 2 comments

Comments

@henrikingo
Copy link
Member

One idea I've had when creating slides with Markdown is to allow to put the Markdown text into a separate file. The impress html presentation would reference the file and its contents would be added as text content for the element. Something like:

<div id="ext-markdown" class="step slide markdown" data-rel-x="0" data-rel-y="900" data-markdown-file="content.md">

This would enable a use case where you can have an empty impress.js html presentation as a template and engine, and the úser creating the slides just writes the content.md file.

@thawk
Copy link
Contributor

thawk commented Jun 27, 2022

Maybe we can use <script type="text/template" src="xxx.md"> to include external file without introducing new attribute?

Currently, we can use <script type="text/template"> to embed markdown contents. The advantage of using <script> is that we don't need to escape </>/&...

<div class="slide markdown">
  <script type="text/template">
  We can use html tag like `<pre>` directly, don't need to escape it.
  </script>
</div>

<script> supports a src attribute, but as said at javascript - Explanation of <script type = "text/template"> ... </script> - Stack Overflow, it seems that browsers WON'T load external source, so we still have to load it manually.

@henrikingo
Copy link
Member Author

I generally like the suggestion to reuse existing tag... even if overloading existing HTML tags feels a bit "potentially dangerous".

I'm not sure I follow your thinking about escaping <, >, &... It seems to me rather a disadvantage that such content would behave differently compared to the same content inside a <div class="step" ...>

Also, note that Markdown content can create multiple slides using ----- separator. But in your suggestion the markdown content is inside a div that is a step. It would be unintuitive that an element inside the div can create more div's at the parent level.

In short, I seem to prefer that we introduce a new attribute to the step div.

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

No branches or pull requests

2 participants